From: h.sandeep Date: Tue, 28 Mar 2017 10:53:30 +0000 (+0530) Subject: Bluez Upgrade: Add Bluez 5.43 open source code. X-Git-Tag: accepted/tizen/common/20170330.151746~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec4e4c90efd95e55905d26368a2e1c266c8d055e;p=platform%2Fupstream%2Fbluez.git Bluez Upgrade: Add Bluez 5.43 open source code. Change-Id: Ife8b8b7b7163ca2d6c521cdb7f99c2ae90b14ba0 Signed-off-by: h.sandeep --- diff --git a/.gbs.conf b/.gbs.conf deleted file mode 100644 index 9ef3025..0000000 --- a/.gbs.conf +++ /dev/null @@ -1,2 +0,0 @@ -[general] -upstream_branch=tizen_upstream diff --git a/AUTHORS b/AUTHORS old mode 100644 new mode 100755 index 16fb14c..176b55b --- a/AUTHORS +++ b/AUTHORS @@ -99,3 +99,4 @@ Gowtham Anandha Babu Bharat Panda Marie Janssen Jaganath Kanakkassery +Michał Narajowski diff --git a/COPYING b/COPYING old mode 100644 new mode 100755 diff --git a/COPYING.LIB b/COPYING.LIB old mode 100644 new mode 100755 diff --git a/ChangeLog b/ChangeLog old mode 100644 new mode 100755 index c7a4fc0..8e01791 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,66 @@ +ver 5.43: + Fix issue with HID over GATT support. + Fix issue with ATT Find By Type response handling. + Fix issue with handling insufficient authentication. + Fix issue with bonding while pairing is in progress. + Fix issue with BR/EDR pairing for dual-mode devices. + Fix issue with handling profile policy resets. + Fix issue with connecting state of services. + Fix issue with handling PAN GN Master role. + Add support for enabling LE Privacy feature. + +ver 5.42: + Fix issue with PBAP call logs from different folders. + Fix issue with OBEX over L2CAP and PowerPC architecture. + Fix issue with BR/EDR over LE selection during discovery. + Fix issue with selection of bearer after bonding. + Fix issue with handling socket recv() return values. + Fix issue with setting connecting service state. + Fix issue with setting correct ATT default MTU value. + Fix issue with not setting AVRCP player identifier. + Fix issue with handling AVRCP browsable player. + Fix issue with addressing AVRCP player changes. + Add support for new management tracing capability. + Mark GATT D-Bus APIs as stable interfaces. + +ver 5.41: + Fix issue with service state changes handling. + Fix issue with AVRCP and no available player. + Fix issue with handling discovery filters. + Fix issue with handling temporary addresses. + Fix issue with GATT MTU size and BR/EDR links. + Fix issue with OBEX and creating directories. + +ver 5.40: + Fix issue with not storing GATT attributes. + Fix issue with optional GATT notifications. + Fix issue with reading GATT extended properties. + Fix issue with GATT device name properties. + Fix issue with previously paired devices. + Fix issue with handling device removal. + Fix issue with profile connection handling. + Add support for TTY monitor protocol. + +ver 5.39: + Fix issue with missing uHID kernel support. + Fix issue with GATT reliable write handling. + Fix issue with GATT service changed handling. + Fix issue with GATT execute write handling. + Fix issue with AVRCP player event handling. + Fix issue with AVRCP controller handling. + Fix issue with AVDTP connection handling. + Fix issue with AVDTP error handling. + +ver 5.38: + Fix issue with stack overflow and UUID handling. + Fix issue with ObjectManager interface and GATT. + Fix issue with GATT database and error handling. + Fix issue with GATT client notifications. + Fix issue with GATT object ordering. + Fix issue with GATT default MTU exchange. + Fix issue with device attribute clearing. + Fix issue with AVRCP capabilities request. + ver 5.37: Fix issue with registering external profiles. Fix issue with connecting external profiles. diff --git a/HACKING b/HACKING deleted file mode 100644 index a8fb403..0000000 --- a/HACKING +++ /dev/null @@ -1,130 +0,0 @@ -Hacking on BlueZ -**************** - -Build tools requirements -======================== - -When building and testing directly from the repository it is important to -have at least automake version 1.10 or later installed. All modern -distributions should default to the latest version, but it seems that -Debian's default is still an earlier version: - - Check version - # dpkg -l '*automake*' - - Install new version - # apt-get install automake1.10 - # update-alternatives --config automake - - -Working with the source code repository -======================================= - -The repository contains two extra scripts that accomplish the bootstrap -process. One is called "bootstrap" which is the basic scripts that uses the -autotools scripts to create the needed files for building and installing. -It makes sure to call the right programs depending on the usage of shared or -static libraries or translations etc. - -The second program is called "bootstrap-configure". This program will make -sure to properly clean the repository, call the "bootstrap" script and then -call configure with proper settings for development. It will use the best -options and pass them over to configure. These options normally include -the enabling the maintainer mode and the debugging features. - -So while in a normal source project the call "./configure ..." is used to -configure the project with its settings like prefix and extra options. In -case of bare repositories call "./bootstrap-configure" and it will bootstrap -the repository and calls configure with all the correct options to make -development easier. - -In case of preparing for a release with "make distcheck", don't use -bootstrap-configure since it could export development specific settings. - -So the normal steps to checkout, build and install such a repository is -like this: - - Checkout repository - # git clone git://git.kernel.org/pub/scm/bluetooth/bluez.git - # cd bluez - - Configure and build - # ./bootstrap-configure - # make - - Configure and build with cgcc (Sparse) - # ./bootstrap-configure CC=cgcc - # make - - Run unit tests - # make check - - Check installation - # make install DESTDIR=$PWD/x - # find x - # rm -rf x - - Check distribution - # make distcheck - - Final installation - # sudo make install - - Remove autogenerated files - # make maintainer-clean - - -Running from within the source code repository -============================================== - -When using "./configure --enable-maintainer-mode" the automake scripts will -use the plugins directly from within the repository. This removes the need -to use "make install" when testing "bluetoothd". The "bootstrap-configure" -automatically includes this option. - - Copy configuration file which specifies the required security policies - # sudo cp ./src/bluetooth.conf /etc/dbus-1/system.d/ - - Run daemon in foreground with debugging - # sudo ./src/bluetoothd -n -d - - Run daemon with valgrind - # sudo valgrind --trace-children=yes --track-origins=yes --track-fds=yes \ - --show-possibly-lost=no --leak-check=full --suppressions=./tools/valgrind.supp \ - ./src/bluetoothd -n -d - -For production installations or distribution packaging it is important that -the "--enable-maintainer-mode" option is NOT used. - -Note multiple arguments to -d can be specified, colon, comma or space -separated. The arguments are relative source code filenames for which -debugging output should be enabled; output shell-style globs are -accepted (e.g.: 'plugins/*:src/main.c'). - -Submitting patches -================== - -If you fixed a bug or you want to add support for something, patches are -welcome! In order to ease the inclusion of your patch, it's important to follow -some rules, otherwise it will likely be rejected by maintainers. - -BlueZ rules for submitting patches follow most of the rules used by Linux kernel -(https://www.kernel.org/doc/Documentation/SubmittingPatches) with some remarks: - -1) Do *not* add "Signed-off-by" lines in your commit messages. BlueZ does not -use them, so including them is actually an error. - -2) Be sure to follow the coding style rules of BlueZ. They are listed in -doc/coding-style.txt. - -3) Split your patch according to the top-level directories. E.g.: if you added -a feature that touches files under 'include/', 'src/' and 'drivers/' -directories, split in three separated patches, taking care not to -break compilation. - -4) Bug fixes should be sent first as they take priority over new features. - -5) The commit message should follow 50/72 formatting which means the header -should be limited to 50 characters and the description should be wrapped at 72 -characters except if it contains quoted information from debug tools like -backtraces, compiler errors, etc. diff --git a/INSTALL b/INSTALL old mode 100644 new mode 100755 diff --git a/LICENSE.Apache-2.0 b/LICENSE.Apache-2.0 deleted file mode 100644 index 57bc88a..0000000 --- a/LICENSE.Apache-2.0 +++ /dev/null @@ -1,202 +0,0 @@ - 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 old mode 100644 new mode 100755 index e1a0328..c469a6c --- a/Makefile.am +++ b/Makefile.am @@ -80,7 +80,7 @@ include_HEADERS += $(lib_headers) lib_LTLIBRARIES += lib/libbluetooth.la lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources) -lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 21:10:18 +lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 21:14:18 lib_libbluetooth_la_DEPENDENCIES = $(local_headers) endif @@ -118,7 +118,8 @@ shared_sources = src/shared/io.h src/shared/timeout.h \ src/shared/gatt-client.h src/shared/gatt-client.c \ src/shared/gatt-server.h src/shared/gatt-server.c \ src/shared/gatt-db.h src/shared/gatt-db.c \ - src/shared/gap.h src/shared/gap.c + src/shared/gap.h src/shared/gap.c \ + src/shared/tty.h src_libshared_glib_la_SOURCES = $(shared_sources) \ src/shared/io-glib.c \ @@ -181,17 +182,16 @@ src_bluetoothd_SOURCES = $(builtin_sources) \ src/agent.h src/agent.c \ src/error.h src/error.c \ src/adapter.h src/adapter.c \ - src/adapter_le_vsc_features.h src/adapter_le_vsc_features.c \ src/profile.h src/profile.c \ src/service.h src/service.c \ src/gatt-client.h src/gatt-client.c \ - src/device.h src/device.c src/attio.h \ + src/device.h src/device.c \ src/dbus-common.c src/dbus-common.h \ src/eir.h src/eir.c src_bluetoothd_LDADD = lib/libbluetooth-internal.la \ gdbus/libgdbus-internal.la \ src/libshared-glib.la \ - @BACKTRACE_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ @LIBXML_LIBS@ @INIPARSER_LIBS@ -ldl -lrt + @BACKTRACE_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \ -Wl,--version-script=$(srcdir)/src/bluetooth.ver @@ -213,7 +213,7 @@ CLEANFILES += $(builtin_files) src/bluetooth.service man_MANS = src/bluetoothd.8 EXTRA_DIST += src/genbuiltin src/bluetooth.conf \ - src/main_m.conf src/main_w.conf profiles/network/network.conf \ + src/main.conf profiles/network/network.conf \ profiles/input/input.conf profiles/proximity/proximity.conf test_scripts = @@ -262,9 +262,11 @@ EXTRA_DIST += doc/obex-api.txt doc/obex-agent-api.txt EXTRA_DIST += doc/pics-opp.txt doc/pixit-opp.txt \ doc/pts-opp.txt +EXTRA_DIST += doc/btsnoop.txt + EXTRA_DIST += tools/magic.btsnoop -AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@ @LIBXML_CFLAGS@ @INIPARSER_CFLAGS@ +AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@ AM_CPPFLAGS = -I$(builddir)/lib @@ -424,6 +426,17 @@ noinst_PROGRAMS += $(unit_tests) endif TESTS = $(unit_tests) +AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69 + +if DBUS_RUN_SESSION +AM_TESTS_ENVIRONMENT += dbus-run-session -- +endif + +if VALGRIND +LOG_COMPILER = valgrind --error-exitcode=1 --num-callers=30 +LOG_FLAGS = --trace-children=yes --leak-check=full --show-reachable=no \ + --suppressions=$(srcdir)/tools/valgrind.supp --quiet +endif pkgconfigdir = $(libdir)/pkgconfig @@ -440,7 +453,7 @@ endif EXTRA_DIST += $(manual_pages:.1=.txt) DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \ - --enable-manpages \ + --enable-manpages --enable-android \ --disable-systemd --disable-udev DISTCLEANFILES = $(pkgconfig_DATA) $(unit_tests) $(manual_pages) diff --git a/Makefile.in b/Makefile.in new file mode 100755 index 0000000..e9f6dbe --- /dev/null +++ b/Makefile.in @@ -0,0 +1,9180 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ + $(am__EXEEXT_4) +noinst_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ + $(am__EXEEXT_8) $(am__EXEEXT_11) +libexec_PROGRAMS = src/bluetoothd$(EXEEXT) obexd/src/obexd$(EXEEXT) +@LIBRARY_TRUE@am__append_1 = $(lib_headers) +@LIBRARY_TRUE@am__append_2 = lib/libbluetooth.la +DIST_COMMON = $(srcdir)/Makefile.plugins $(srcdir)/Makefile.tools \ + $(srcdir)/Makefile.obexd $(srcdir)/android/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in $(top_srcdir)/src/bluetoothd.8.in \ + $(top_srcdir)/lib/bluez.pc.in depcomp $(dist_man_MANS) \ + $(am__include_HEADERS_DIST) test-driver AUTHORS COPYING \ + COPYING.LIB ChangeLog INSTALL NEWS README TODO compile \ + config.guess config.sub install-sh missing ltmain.sh +@MAINTAINER_MODE_TRUE@am__append_3 = gatt_example +@MAINTAINER_MODE_TRUE@am__append_4 = plugins/gatt-example.c +@EXPERIMENTAL_TRUE@am__append_5 = neard sap +@EXPERIMENTAL_TRUE@am__append_6 = plugins/neard.c profiles/sap/main.c \ +@EXPERIMENTAL_TRUE@ profiles/sap/manager.h \ +@EXPERIMENTAL_TRUE@ profiles/sap/manager.c \ +@EXPERIMENTAL_TRUE@ profiles/sap/server.h profiles/sap/server.c \ +@EXPERIMENTAL_TRUE@ profiles/sap/sap.h profiles/sap/sap-dummy.c +@EXPERIMENTAL_TRUE@am__append_7 = profiles/sap/libsap.a +@EXPERIMENTAL_TRUE@am__append_8 = health +@EXPERIMENTAL_TRUE@am__append_9 = profiles/health/mcap.h profiles/health/mcap.c \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_main.c profiles/health/hdp_types.h \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_manager.h \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_manager.c \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp.h profiles/health/hdp.c \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_util.h profiles/health/hdp_util.c + +@SIXAXIS_TRUE@am__append_10 = plugins/sixaxis.la +@MAINTAINER_MODE_TRUE@am__append_11 = plugins/external-dummy.la +@CLIENT_TRUE@am__append_12 = client/bluetoothctl +@MONITOR_TRUE@am__append_13 = monitor/btmon +@EXPERIMENTAL_TRUE@am__append_14 = emulator/btvirt emulator/b1ee \ +@EXPERIMENTAL_TRUE@ emulator/hfp peripheral/btsensor tools/3dsp \ +@EXPERIMENTAL_TRUE@ tools/mgmt-tester tools/gap-tester \ +@EXPERIMENTAL_TRUE@ tools/l2cap-tester tools/sco-tester \ +@EXPERIMENTAL_TRUE@ tools/smp-tester tools/hci-tester \ +@EXPERIMENTAL_TRUE@ tools/rfcomm-tester tools/bnep-tester \ +@EXPERIMENTAL_TRUE@ tools/userchan-tester tools/bdaddr \ +@EXPERIMENTAL_TRUE@ tools/avinfo tools/avtest tools/scotest \ +@EXPERIMENTAL_TRUE@ tools/amptest tools/hwdb tools/hcieventmask \ +@EXPERIMENTAL_TRUE@ tools/hcisecfilter tools/btinfo \ +@EXPERIMENTAL_TRUE@ tools/btsnoop tools/btproxy tools/btiotest \ +@EXPERIMENTAL_TRUE@ tools/bneptest tools/mcaptest tools/cltest \ +@EXPERIMENTAL_TRUE@ tools/oobtest tools/seq2bseq tools/nokfw \ +@EXPERIMENTAL_TRUE@ tools/create-image tools/eddystone \ +@EXPERIMENTAL_TRUE@ tools/ibeacon tools/btgatt-client \ +@EXPERIMENTAL_TRUE@ tools/btgatt-server tools/test-runner \ +@EXPERIMENTAL_TRUE@ tools/check-selftest +@TOOLS_TRUE@am__append_15 = tools/hciattach tools/hciconfig tools/hcitool tools/hcidump \ +@TOOLS_TRUE@ tools/rfcomm tools/rctest tools/l2test tools/l2ping \ +@TOOLS_TRUE@ tools/sdptool tools/ciptool tools/bccmd \ +@TOOLS_TRUE@ tools/bluemoon tools/hex2hcd tools/mpris-proxy + +@TOOLS_TRUE@am__append_16 = tools/hciattach.1 tools/hciconfig.1 \ +@TOOLS_TRUE@ tools/hcitool.1 tools/hcidump.1 \ +@TOOLS_TRUE@ tools/rfcomm.1 tools/rctest.1 tools/l2ping.1 \ +@TOOLS_TRUE@ tools/sdptool.1 tools/ciptool.1 tools/bccmd.1 + +@TOOLS_FALSE@am__append_17 = tools/hciattach.1 tools/hciconfig.1 \ +@TOOLS_FALSE@ tools/hcitool.1 tools/hcidump.1 \ +@TOOLS_FALSE@ tools/rfcomm.1 tools/rctest.1 tools/l2ping.1 \ +@TOOLS_FALSE@ tools/sdptool.1 tools/ciptool.1 tools/bccmd.1 + +@HID2HCI_TRUE@udev_PROGRAMS = tools/hid2hci$(EXEEXT) +@HID2HCI_TRUE@am__append_18 = tools/hid2hci.1 +@HID2HCI_FALSE@am__append_19 = tools/hid2hci.1 +@EXPERIMENTAL_TRUE@am__append_20 = tools/btattach +@EXPERIMENTAL_TRUE@am__append_21 = tools/btattach.1 +@EXPERIMENTAL_TRUE@am__append_22 = tools/bdaddr.1 +@EXPERIMENTAL_FALSE@am__append_23 = tools/btattach.1 +@READLINE_TRUE@am__append_24 = attrib/gatttool tools/btmgmt \ +@READLINE_TRUE@ tools/obex-client-tool tools/obex-server-tool \ +@READLINE_TRUE@ tools/bluetooth-player tools/obexctl + +@EXPERIMENTAL_TRUE@am__append_25 = tools/gatt-service \ +@EXPERIMENTAL_TRUE@ profiles/iap/iapd +@CUPS_TRUE@cups_PROGRAMS = profiles/cups/bluetooth$(EXEEXT) +@EXPERIMENTAL_TRUE@am__append_26 = pcsuite +@EXPERIMENTAL_TRUE@am__append_27 = obexd/plugins/pcsuite.c +@OBEX_TRUE@am__append_28 = irmc pbap +@OBEX_TRUE@am__append_29 = obexd/plugins/irmc.c obexd/plugins/pbap.c \ +@OBEX_TRUE@ obexd/plugins/vcard.h obexd/plugins/vcard.c \ +@OBEX_TRUE@ obexd/plugins/phonebook.h \ +@OBEX_TRUE@ obexd/plugins/phonebook-dummy.c +@ANDROID_TRUE@am__append_30 = -DANDROID_VERSION=0x050100 +@ANDROID_TRUE@am__append_31 = android/system-emulator \ +@ANDROID_TRUE@ android/bluetoothd-snoop android/bluetoothd \ +@ANDROID_TRUE@ android/avdtptest android/haltest \ +@ANDROID_TRUE@ android/android-tester android/ipc-tester +@ANDROID_TRUE@am__append_32 = android/bluetooth.default.la \ +@ANDROID_TRUE@ android/audio.a2dp.default.la \ +@ANDROID_TRUE@ android/audio.sco.default.la +@ANDROID_TRUE@am__append_33 = android/test-ipc +@HID2HCI_TRUE@am__append_34 = $(rules_DATA) +@MAINTAINER_MODE_TRUE@am__append_35 = $(unit_tests) +TESTS = $(am__EXEEXT_10) +@DBUS_RUN_SESSION_TRUE@am__append_36 = dbus-run-session -- +@MANPAGES_TRUE@am__append_37 = $(manual_pages) +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = src/bluetoothd.8 lib/bluez.pc +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +profiles_sap_libsap_a_AR = $(AR) $(ARFLAGS) +profiles_sap_libsap_a_LIBADD = +am__profiles_sap_libsap_a_SOURCES_DIST = profiles/sap/sap.h \ + profiles/sap/sap-u8500.c +am__dirstamp = $(am__leading_dot)dirstamp +@EXPERIMENTAL_TRUE@am_profiles_sap_libsap_a_OBJECTS = \ +@EXPERIMENTAL_TRUE@ profiles/sap/sap-u8500.$(OBJEXT) +profiles_sap_libsap_a_OBJECTS = $(am_profiles_sap_libsap_a_OBJECTS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" \ + "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsdir)" \ + "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(udevdir)" \ + "$(DESTDIR)$(testdir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" \ + "$(DESTDIR)$(dbusdir)" "$(DESTDIR)$(dbussessionbusdir)" \ + "$(DESTDIR)$(dbussystembusdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(rulesdir)" "$(DESTDIR)$(statedir)" \ + "$(DESTDIR)$(systemdsystemunitdir)" \ + "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) \ + $(plugin_LTLIBRARIES) +android_audio_a2dp_default_la_DEPENDENCIES = +am__android_audio_a2dp_default_la_SOURCES_DIST = android/audio-msg.h \ + android/hal-msg.h android/hal-audio.h android/hal-audio.c \ + android/hal-audio-sbc.c android/hal-audio-aptx.c \ + android/hardware/audio.h android/hardware/audio_effect.h \ + android/hardware/hardware.h android/system/audio.h +@ANDROID_TRUE@am_android_audio_a2dp_default_la_OBJECTS = android/android_audio_a2dp_default_la-hal-audio.lo \ +@ANDROID_TRUE@ android/android_audio_a2dp_default_la-hal-audio-sbc.lo \ +@ANDROID_TRUE@ android/android_audio_a2dp_default_la-hal-audio-aptx.lo +android_audio_a2dp_default_la_OBJECTS = \ + $(am_android_audio_a2dp_default_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +android_audio_a2dp_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) \ + $(android_audio_a2dp_default_la_LDFLAGS) $(LDFLAGS) -o $@ +@ANDROID_TRUE@am_android_audio_a2dp_default_la_rpath = -rpath \ +@ANDROID_TRUE@ $(plugindir) +android_audio_sco_default_la_DEPENDENCIES = +am__android_audio_sco_default_la_SOURCES_DIST = android/hal-log.h \ + android/sco-msg.h android/hal-sco.c android/hardware/audio.h \ + android/hardware/audio_effect.h android/hardware/hardware.h \ + android/audio_utils/resampler.c \ + android/audio_utils/resampler.h android/system/audio.h +@ANDROID_TRUE@am_android_audio_sco_default_la_OBJECTS = \ +@ANDROID_TRUE@ android/android_audio_sco_default_la-hal-sco.lo \ +@ANDROID_TRUE@ android/audio_utils/android_audio_sco_default_la-resampler.lo +android_audio_sco_default_la_OBJECTS = \ + $(am_android_audio_sco_default_la_OBJECTS) +android_audio_sco_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) \ + $(android_audio_sco_default_la_LDFLAGS) $(LDFLAGS) -o $@ +@ANDROID_TRUE@am_android_audio_sco_default_la_rpath = -rpath \ +@ANDROID_TRUE@ $(plugindir) +android_bluetooth_default_la_LIBADD = +am__android_bluetooth_default_la_SOURCES_DIST = android/hal.h \ + android/hal-bluetooth.c android/hal-socket.c \ + android/hal-hidhost.c android/hal-health.c android/hal-pan.c \ + android/hal-a2dp.c android/hal-a2dp-sink.c android/hal-avrcp.c \ + android/hal-avrcp-ctrl.c android/hal-handsfree.c \ + android/hal-handsfree-client.c android/hal-gatt.c \ + android/hal-map-client.c android/hardware/bluetooth.h \ + android/hardware/bt_av.h android/hardware/bt_gatt.h \ + android/hardware/bt_gatt_client.h \ + android/hardware/bt_gatt_server.h \ + android/hardware/bt_gatt_types.h android/hardware/bt_hf.h \ + android/hardware/bt_hh.h android/hardware/bt_hl.h \ + android/hardware/bt_pan.h android/hardware/bt_rc.h \ + android/hardware/bt_sock.h android/hardware/bt_hf_client.h \ + android/hardware/bt_mce.h android/hardware/hardware.h \ + android/cutils/properties.h android/ipc-common.h \ + android/hal-log.h android/hal-ipc.h android/hal-ipc.c \ + android/hal-utils.h android/hal-utils.c +@ANDROID_TRUE@am_android_bluetooth_default_la_OBJECTS = android/android_bluetooth_default_la-hal-bluetooth.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-socket.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-hidhost.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-health.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-pan.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-a2dp.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-a2dp-sink.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-avrcp.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-avrcp-ctrl.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-handsfree.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-handsfree-client.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-gatt.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-map-client.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-ipc.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-utils.lo +android_bluetooth_default_la_OBJECTS = \ + $(am_android_bluetooth_default_la_OBJECTS) +android_bluetooth_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) \ + $(android_bluetooth_default_la_LDFLAGS) $(LDFLAGS) -o $@ +@ANDROID_TRUE@am_android_bluetooth_default_la_rpath = -rpath \ +@ANDROID_TRUE@ $(plugindir) +gdbus_libgdbus_internal_la_LIBADD = +am_gdbus_libgdbus_internal_la_OBJECTS = gdbus/mainloop.lo \ + gdbus/watch.lo gdbus/object.lo gdbus/client.lo gdbus/polkit.lo +gdbus_libgdbus_internal_la_OBJECTS = \ + $(am_gdbus_libgdbus_internal_la_OBJECTS) +lib_libbluetooth_internal_la_LIBADD = +am__objects_1 = +am__objects_2 = lib/bluetooth.lo lib/hci.lo lib/sdp.lo +am__objects_3 = lib/uuid.lo +am_lib_libbluetooth_internal_la_OBJECTS = $(am__objects_1) \ + $(am__objects_2) $(am__objects_1) $(am__objects_3) +lib_libbluetooth_internal_la_OBJECTS = \ + $(am_lib_libbluetooth_internal_la_OBJECTS) +lib_libbluetooth_la_LIBADD = +am__lib_libbluetooth_la_SOURCES_DIST = lib/bluetooth.h lib/hci.h \ + lib/hci_lib.h lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \ + lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h lib/bluetooth.c \ + lib/hci.c lib/sdp.c +@LIBRARY_TRUE@am_lib_libbluetooth_la_OBJECTS = $(am__objects_1) \ +@LIBRARY_TRUE@ $(am__objects_2) +lib_libbluetooth_la_OBJECTS = $(am_lib_libbluetooth_la_OBJECTS) +lib_libbluetooth_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(lib_libbluetooth_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@LIBRARY_TRUE@am_lib_libbluetooth_la_rpath = -rpath $(libdir) +plugins_external_dummy_la_LIBADD = +am__plugins_external_dummy_la_SOURCES_DIST = plugins/external-dummy.c +@MAINTAINER_MODE_TRUE@am_plugins_external_dummy_la_OBJECTS = plugins/plugins_external_dummy_la-external-dummy.lo +plugins_external_dummy_la_OBJECTS = \ + $(am_plugins_external_dummy_la_OBJECTS) +plugins_external_dummy_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) \ + $(plugins_external_dummy_la_LDFLAGS) $(LDFLAGS) -o $@ +@MAINTAINER_MODE_TRUE@am_plugins_external_dummy_la_rpath = -rpath \ +@MAINTAINER_MODE_TRUE@ $(plugindir) +plugins_sixaxis_la_LIBADD = +am__plugins_sixaxis_la_SOURCES_DIST = plugins/sixaxis.c +@SIXAXIS_TRUE@am_plugins_sixaxis_la_OBJECTS = \ +@SIXAXIS_TRUE@ plugins/plugins_sixaxis_la-sixaxis.lo +plugins_sixaxis_la_OBJECTS = $(am_plugins_sixaxis_la_OBJECTS) +plugins_sixaxis_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) \ + $(plugins_sixaxis_la_LDFLAGS) $(LDFLAGS) -o $@ +@SIXAXIS_TRUE@am_plugins_sixaxis_la_rpath = -rpath $(plugindir) +src_libshared_glib_la_LIBADD = +am__objects_4 = src/shared/queue.lo src/shared/util.lo \ + src/shared/mgmt.lo src/shared/crypto.lo src/shared/ecc.lo \ + src/shared/ringbuf.lo src/shared/tester.lo src/shared/hci.lo \ + src/shared/hci-crypto.lo src/shared/hfp.lo src/shared/uhid.lo \ + src/shared/pcap.lo src/shared/btsnoop.lo src/shared/ad.lo \ + src/shared/att.lo src/shared/gatt-helpers.lo \ + src/shared/gatt-client.lo src/shared/gatt-server.lo \ + src/shared/gatt-db.lo src/shared/gap.lo +am_src_libshared_glib_la_OBJECTS = $(am__objects_4) \ + src/shared/io-glib.lo src/shared/timeout-glib.lo +src_libshared_glib_la_OBJECTS = $(am_src_libshared_glib_la_OBJECTS) +src_libshared_mainloop_la_LIBADD = +am_src_libshared_mainloop_la_OBJECTS = $(am__objects_4) \ + src/shared/io-mainloop.lo src/shared/timeout-mainloop.lo \ + src/shared/mainloop.lo +src_libshared_mainloop_la_OBJECTS = \ + $(am_src_libshared_mainloop_la_OBJECTS) +@CLIENT_TRUE@am__EXEEXT_1 = client/bluetoothctl$(EXEEXT) +@MONITOR_TRUE@am__EXEEXT_2 = monitor/btmon$(EXEEXT) +@TOOLS_TRUE@am__EXEEXT_3 = tools/hciattach$(EXEEXT) \ +@TOOLS_TRUE@ tools/hciconfig$(EXEEXT) tools/hcitool$(EXEEXT) \ +@TOOLS_TRUE@ tools/hcidump$(EXEEXT) tools/rfcomm$(EXEEXT) \ +@TOOLS_TRUE@ tools/rctest$(EXEEXT) tools/l2test$(EXEEXT) \ +@TOOLS_TRUE@ tools/l2ping$(EXEEXT) tools/sdptool$(EXEEXT) \ +@TOOLS_TRUE@ tools/ciptool$(EXEEXT) tools/bccmd$(EXEEXT) \ +@TOOLS_TRUE@ tools/bluemoon$(EXEEXT) tools/hex2hcd$(EXEEXT) \ +@TOOLS_TRUE@ tools/mpris-proxy$(EXEEXT) +@EXPERIMENTAL_TRUE@am__EXEEXT_4 = tools/btattach$(EXEEXT) +@EXPERIMENTAL_TRUE@am__EXEEXT_5 = emulator/btvirt$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ emulator/b1ee$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hfp$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ peripheral/btsensor$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/3dsp$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/mgmt-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/gap-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/l2cap-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/sco-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/smp-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/hci-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/rfcomm-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/bnep-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/userchan-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/bdaddr$(EXEEXT) tools/avinfo$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/avtest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/scotest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/amptest$(EXEEXT) tools/hwdb$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/hcieventmask$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/hcisecfilter$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btinfo$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btsnoop$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btproxy$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btiotest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/bneptest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/mcaptest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/cltest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/oobtest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/seq2bseq$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/nokfw$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/create-image$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/eddystone$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/ibeacon$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btgatt-client$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btgatt-server$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/test-runner$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/check-selftest$(EXEEXT) +@READLINE_TRUE@am__EXEEXT_6 = attrib/gatttool$(EXEEXT) \ +@READLINE_TRUE@ tools/btmgmt$(EXEEXT) \ +@READLINE_TRUE@ tools/obex-client-tool$(EXEEXT) \ +@READLINE_TRUE@ tools/obex-server-tool$(EXEEXT) \ +@READLINE_TRUE@ tools/bluetooth-player$(EXEEXT) \ +@READLINE_TRUE@ tools/obexctl$(EXEEXT) +@EXPERIMENTAL_TRUE@am__EXEEXT_7 = tools/gatt-service$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ profiles/iap/iapd$(EXEEXT) +@ANDROID_TRUE@am__EXEEXT_8 = android/system-emulator$(EXEEXT) \ +@ANDROID_TRUE@ android/bluetoothd-snoop$(EXEEXT) \ +@ANDROID_TRUE@ android/bluetoothd$(EXEEXT) \ +@ANDROID_TRUE@ android/avdtptest$(EXEEXT) \ +@ANDROID_TRUE@ android/haltest$(EXEEXT) \ +@ANDROID_TRUE@ android/android-tester$(EXEEXT) \ +@ANDROID_TRUE@ android/ipc-tester$(EXEEXT) +@ANDROID_TRUE@am__EXEEXT_9 = android/test-ipc$(EXEEXT) +am__EXEEXT_10 = $(am__EXEEXT_9) unit/test-eir$(EXEEXT) \ + unit/test-uuid$(EXEEXT) unit/test-textfile$(EXEEXT) \ + unit/test-crc$(EXEEXT) unit/test-crypto$(EXEEXT) \ + unit/test-ecc$(EXEEXT) unit/test-ringbuf$(EXEEXT) \ + unit/test-queue$(EXEEXT) unit/test-mgmt$(EXEEXT) \ + unit/test-uhid$(EXEEXT) unit/test-sdp$(EXEEXT) \ + unit/test-avdtp$(EXEEXT) unit/test-avctp$(EXEEXT) \ + unit/test-avrcp$(EXEEXT) unit/test-hfp$(EXEEXT) \ + unit/test-gdbus-client$(EXEEXT) \ + unit/test-gobex-header$(EXEEXT) \ + unit/test-gobex-packet$(EXEEXT) unit/test-gobex$(EXEEXT) \ + unit/test-gobex-transfer$(EXEEXT) \ + unit/test-gobex-apparam$(EXEEXT) unit/test-lib$(EXEEXT) \ + unit/test-gatt$(EXEEXT) unit/test-hog$(EXEEXT) \ + unit/test-gattrib$(EXEEXT) +@MAINTAINER_MODE_TRUE@am__EXEEXT_11 = $(am__EXEEXT_10) +PROGRAMS = $(bin_PROGRAMS) $(cups_PROGRAMS) $(libexec_PROGRAMS) \ + $(noinst_PROGRAMS) $(udev_PROGRAMS) +am__android_android_tester_SOURCES_DIST = emulator/hciemu.h \ + emulator/hciemu.c emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c emulator/smp.c \ + monitor/rfcomm.h android/hardware/hardware.c \ + android/tester-bluetooth.c android/tester-socket.c \ + android/tester-hidhost.c android/tester-pan.c \ + android/tester-hdp.c android/tester-a2dp.c \ + android/tester-avrcp.c android/tester-gatt.c \ + android/tester-map-client.c android/tester-main.h \ + android/tester-main.c +@ANDROID_TRUE@am_android_android_tester_OBJECTS = emulator/android_android_tester-hciemu.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_android_tester-btdev.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_android_tester-bthost.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_android_tester-smp.$(OBJEXT) \ +@ANDROID_TRUE@ android/hardware/android_android_tester-hardware.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-bluetooth.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-socket.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-hidhost.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-pan.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-hdp.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-a2dp.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-avrcp.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-gatt.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-map-client.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-tester-main.$(OBJEXT) +android_android_tester_OBJECTS = $(am_android_android_tester_OBJECTS) +@ANDROID_TRUE@android_android_tester_DEPENDENCIES = \ +@ANDROID_TRUE@ lib/libbluetooth-internal.la \ +@ANDROID_TRUE@ src/libshared-glib.la +android_android_tester_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_android_tester_CFLAGS) $(CFLAGS) \ + $(android_android_tester_LDFLAGS) $(LDFLAGS) -o $@ +am__android_avdtptest_SOURCES_DIST = android/avdtptest.c src/log.h \ + src/log.c btio/btio.h btio/btio.c src/shared/util.h \ + src/shared/util.c src/shared/queue.h src/shared/queue.c \ + android/avdtp.h android/avdtp.c +@ANDROID_TRUE@am_android_avdtptest_OBJECTS = \ +@ANDROID_TRUE@ android/android_avdtptest-avdtptest.$(OBJEXT) \ +@ANDROID_TRUE@ src/android_avdtptest-log.$(OBJEXT) \ +@ANDROID_TRUE@ btio/android_avdtptest-btio.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_avdtptest-util.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_avdtptest-queue.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_avdtptest-avdtp.$(OBJEXT) +android_avdtptest_OBJECTS = $(am_android_avdtptest_OBJECTS) +@ANDROID_TRUE@android_avdtptest_DEPENDENCIES = \ +@ANDROID_TRUE@ lib/libbluetooth-internal.la +android_avdtptest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_avdtptest_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +am__android_bluetoothd_SOURCES_DIST = android/main.c src/log.c \ + android/hal-msg.h android/audio-msg.h android/sco-msg.h \ + android/utils.h src/sdpd-database.c src/sdpd-server.c \ + src/sdpd-service.c src/sdpd-request.c src/uuid-helper.h \ + src/uuid-helper.c src/eir.h src/eir.c android/bluetooth.h \ + android/bluetooth.c android/hidhost.h android/hidhost.c \ + profiles/scanparam/scpp.h profiles/scanparam/scpp.c \ + profiles/deviceinfo/dis.h profiles/deviceinfo/dis.c \ + profiles/battery/bas.h profiles/battery/bas.c \ + profiles/input/hog-lib.h profiles/input/hog-lib.c \ + android/ipc-common.h android/ipc.h android/ipc.c \ + android/avdtp.h android/avdtp.c android/a2dp.h android/a2dp.c \ + android/a2dp-sink.h android/a2dp-sink.c android/avctp.h \ + android/avctp.c android/avrcp.h android/avrcp.c \ + android/avrcp-lib.h android/avrcp-lib.c android/socket.h \ + android/socket.c android/sco.h android/sco.c android/pan.h \ + android/pan.c android/handsfree.h android/handsfree.c \ + android/handsfree-client.c android/handsfree-client.h \ + android/gatt.h android/gatt.c android/health.h \ + android/health.c profiles/health/mcap.h profiles/health/mcap.c \ + android/map-client.h android/map-client.c attrib/att.c \ + attrib/att.h attrib/gatt.c attrib/gatt.h attrib/gattrib.c \ + attrib/gattrib.h btio/btio.h btio/btio.c src/sdp-client.h \ + src/sdp-client.c profiles/network/bnep.h \ + profiles/network/bnep.c +@ANDROID_TRUE@am_android_bluetoothd_OBJECTS = android/main.$(OBJEXT) \ +@ANDROID_TRUE@ src/log.$(OBJEXT) src/sdpd-database.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdpd-server.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdpd-service.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdpd-request.$(OBJEXT) \ +@ANDROID_TRUE@ src/uuid-helper.$(OBJEXT) src/eir.$(OBJEXT) \ +@ANDROID_TRUE@ android/bluetooth.$(OBJEXT) \ +@ANDROID_TRUE@ android/hidhost.$(OBJEXT) \ +@ANDROID_TRUE@ profiles/scanparam/scpp.$(OBJEXT) \ +@ANDROID_TRUE@ profiles/deviceinfo/dis.$(OBJEXT) \ +@ANDROID_TRUE@ profiles/battery/bas.$(OBJEXT) \ +@ANDROID_TRUE@ profiles/input/hog-lib.$(OBJEXT) \ +@ANDROID_TRUE@ android/ipc.$(OBJEXT) android/avdtp.$(OBJEXT) \ +@ANDROID_TRUE@ android/a2dp.$(OBJEXT) \ +@ANDROID_TRUE@ android/a2dp-sink.$(OBJEXT) \ +@ANDROID_TRUE@ android/avctp.$(OBJEXT) android/avrcp.$(OBJEXT) \ +@ANDROID_TRUE@ android/avrcp-lib.$(OBJEXT) \ +@ANDROID_TRUE@ android/socket.$(OBJEXT) android/sco.$(OBJEXT) \ +@ANDROID_TRUE@ android/pan.$(OBJEXT) \ +@ANDROID_TRUE@ android/handsfree.$(OBJEXT) \ +@ANDROID_TRUE@ android/handsfree-client.$(OBJEXT) \ +@ANDROID_TRUE@ android/gatt.$(OBJEXT) android/health.$(OBJEXT) \ +@ANDROID_TRUE@ profiles/health/mcap.$(OBJEXT) \ +@ANDROID_TRUE@ android/map-client.$(OBJEXT) \ +@ANDROID_TRUE@ attrib/att.$(OBJEXT) attrib/gatt.$(OBJEXT) \ +@ANDROID_TRUE@ attrib/gattrib.$(OBJEXT) btio/btio.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdp-client.$(OBJEXT) \ +@ANDROID_TRUE@ profiles/network/bnep.$(OBJEXT) +android_bluetoothd_OBJECTS = $(am_android_bluetoothd_OBJECTS) +@ANDROID_TRUE@android_bluetoothd_DEPENDENCIES = \ +@ANDROID_TRUE@ lib/libbluetooth-internal.la \ +@ANDROID_TRUE@ src/libshared-glib.la +am__android_bluetoothd_snoop_SOURCES_DIST = \ + android/bluetoothd-snoop.c src/log.c +@ANDROID_TRUE@am_android_bluetoothd_snoop_OBJECTS = \ +@ANDROID_TRUE@ android/bluetoothd-snoop.$(OBJEXT) \ +@ANDROID_TRUE@ src/log.$(OBJEXT) +android_bluetoothd_snoop_OBJECTS = \ + $(am_android_bluetoothd_snoop_OBJECTS) +@ANDROID_TRUE@android_bluetoothd_snoop_DEPENDENCIES = \ +@ANDROID_TRUE@ src/libshared-mainloop.la +am__android_haltest_SOURCES_DIST = android/client/haltest.c \ + android/client/pollhandler.h android/client/pollhandler.c \ + android/client/terminal.h android/client/terminal.c \ + android/client/history.h android/client/history.c \ + android/client/tabcompletion.c android/client/if-main.h \ + android/client/if-av.c android/client/if-av-sink.c \ + android/client/if-rc.c android/client/if-rc-ctrl.c \ + android/client/if-bt.c android/client/if-gatt.c \ + android/client/if-hf.c android/client/if-hf-client.c \ + android/client/if-hh.c android/client/if-pan.c \ + android/client/if-hl.c android/client/if-sock.c \ + android/client/if-audio.c android/client/if-sco.c \ + android/client/if-mce.c android/hardware/hardware.c \ + android/hal-utils.h android/hal-utils.c +@ANDROID_TRUE@am_android_haltest_OBJECTS = android/client/android_haltest-haltest.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-pollhandler.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-terminal.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-history.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-tabcompletion.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-av.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-av-sink.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-rc.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-rc-ctrl.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-bt.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-gatt.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-hf.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-hf-client.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-hh.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-pan.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-hl.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-sock.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-audio.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-sco.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-mce.$(OBJEXT) \ +@ANDROID_TRUE@ android/hardware/android_haltest-hardware.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_haltest-hal-utils.$(OBJEXT) +android_haltest_OBJECTS = $(am_android_haltest_OBJECTS) +android_haltest_LDADD = $(LDADD) +android_haltest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_haltest_CFLAGS) $(CFLAGS) $(android_haltest_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__android_ipc_tester_SOURCES_DIST = emulator/hciemu.h \ + emulator/hciemu.c emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c emulator/smp.c \ + android/hal-utils.h android/hal-utils.c android/ipc-common.h \ + android/ipc-tester.c +@ANDROID_TRUE@am_android_ipc_tester_OBJECTS = \ +@ANDROID_TRUE@ emulator/android_ipc_tester-hciemu.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_ipc_tester-btdev.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_ipc_tester-bthost.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_ipc_tester-smp.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_ipc_tester-hal-utils.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_ipc_tester-ipc-tester.$(OBJEXT) +android_ipc_tester_OBJECTS = $(am_android_ipc_tester_OBJECTS) +@ANDROID_TRUE@android_ipc_tester_DEPENDENCIES = \ +@ANDROID_TRUE@ lib/libbluetooth-internal.la \ +@ANDROID_TRUE@ src/libshared-glib.la +android_ipc_tester_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_ipc_tester_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__android_system_emulator_SOURCES_DIST = android/system-emulator.c +@ANDROID_TRUE@am_android_system_emulator_OBJECTS = \ +@ANDROID_TRUE@ android/system-emulator.$(OBJEXT) +android_system_emulator_OBJECTS = \ + $(am_android_system_emulator_OBJECTS) +@ANDROID_TRUE@android_system_emulator_DEPENDENCIES = \ +@ANDROID_TRUE@ src/libshared-mainloop.la +am__android_test_ipc_SOURCES_DIST = android/test-ipc.c src/log.h \ + src/log.c android/ipc-common.h android/ipc.c android/ipc.h +@ANDROID_TRUE@am_android_test_ipc_OBJECTS = \ +@ANDROID_TRUE@ android/test-ipc.$(OBJEXT) src/log.$(OBJEXT) \ +@ANDROID_TRUE@ android/ipc.$(OBJEXT) +android_test_ipc_OBJECTS = $(am_android_test_ipc_OBJECTS) +@ANDROID_TRUE@android_test_ipc_DEPENDENCIES = src/libshared-glib.la +am__attrib_gatttool_SOURCES_DIST = attrib/gatttool.c attrib/att.c \ + attrib/gatt.c attrib/gattrib.c btio/btio.c attrib/gatttool.h \ + attrib/interactive.c attrib/utils.c src/log.c client/display.c \ + client/display.h +@READLINE_TRUE@am_attrib_gatttool_OBJECTS = attrib/gatttool.$(OBJEXT) \ +@READLINE_TRUE@ attrib/att.$(OBJEXT) attrib/gatt.$(OBJEXT) \ +@READLINE_TRUE@ attrib/gattrib.$(OBJEXT) btio/btio.$(OBJEXT) \ +@READLINE_TRUE@ attrib/interactive.$(OBJEXT) \ +@READLINE_TRUE@ attrib/utils.$(OBJEXT) src/log.$(OBJEXT) \ +@READLINE_TRUE@ client/display.$(OBJEXT) +attrib_gatttool_OBJECTS = $(am_attrib_gatttool_OBJECTS) +@READLINE_TRUE@attrib_gatttool_DEPENDENCIES = \ +@READLINE_TRUE@ lib/libbluetooth-internal.la \ +@READLINE_TRUE@ src/libshared-glib.la +am__client_bluetoothctl_SOURCES_DIST = client/main.c client/display.h \ + client/display.c client/agent.h client/agent.c \ + client/advertising.h client/advertising.c client/gatt.h \ + client/gatt.c monitor/uuid.h monitor/uuid.c +@CLIENT_TRUE@am_client_bluetoothctl_OBJECTS = client/main.$(OBJEXT) \ +@CLIENT_TRUE@ client/display.$(OBJEXT) client/agent.$(OBJEXT) \ +@CLIENT_TRUE@ client/advertising.$(OBJEXT) \ +@CLIENT_TRUE@ client/gatt.$(OBJEXT) monitor/uuid.$(OBJEXT) +client_bluetoothctl_OBJECTS = $(am_client_bluetoothctl_OBJECTS) +@CLIENT_TRUE@client_bluetoothctl_DEPENDENCIES = \ +@CLIENT_TRUE@ gdbus/libgdbus-internal.la +am__emulator_b1ee_SOURCES_DIST = emulator/b1ee.c +@EXPERIMENTAL_TRUE@am_emulator_b1ee_OBJECTS = emulator/b1ee.$(OBJEXT) +emulator_b1ee_OBJECTS = $(am_emulator_b1ee_OBJECTS) +@EXPERIMENTAL_TRUE@emulator_b1ee_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__emulator_btvirt_SOURCES_DIST = emulator/main.c monitor/bt.h \ + emulator/serial.h emulator/serial.c emulator/server.h \ + emulator/server.c emulator/vhci.h emulator/vhci.c \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c emulator/phy.h emulator/phy.c \ + emulator/amp.h emulator/amp.c emulator/le.h emulator/le.c +@EXPERIMENTAL_TRUE@am_emulator_btvirt_OBJECTS = \ +@EXPERIMENTAL_TRUE@ emulator/main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/serial.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/server.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/vhci.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/phy.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/amp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/le.$(OBJEXT) +emulator_btvirt_OBJECTS = $(am_emulator_btvirt_OBJECTS) +@EXPERIMENTAL_TRUE@emulator_btvirt_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__emulator_hfp_SOURCES_DIST = emulator/hfp.c +@EXPERIMENTAL_TRUE@am_emulator_hfp_OBJECTS = emulator/hfp.$(OBJEXT) +emulator_hfp_OBJECTS = $(am_emulator_hfp_OBJECTS) +@EXPERIMENTAL_TRUE@emulator_hfp_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__monitor_btmon_SOURCES_DIST = monitor/main.c monitor/bt.h \ + monitor/display.h monitor/display.c monitor/hcidump.h \ + monitor/hcidump.c monitor/ellisys.h monitor/ellisys.c \ + monitor/control.h monitor/control.c monitor/packet.h \ + monitor/packet.c monitor/vendor.h monitor/vendor.c \ + monitor/lmp.h monitor/lmp.c monitor/crc.h monitor/crc.c \ + monitor/ll.h monitor/ll.c monitor/l2cap.h monitor/l2cap.c \ + monitor/sdp.h monitor/sdp.c monitor/avctp.h monitor/avctp.c \ + monitor/avdtp.h monitor/avdtp.c monitor/a2dp.h monitor/a2dp.c \ + monitor/rfcomm.h monitor/rfcomm.c monitor/bnep.h \ + monitor/bnep.c monitor/uuid.h monitor/uuid.c monitor/hwdb.h \ + monitor/hwdb.c monitor/keys.h monitor/keys.c monitor/analyze.h \ + monitor/analyze.c monitor/intel.h monitor/intel.c \ + monitor/broadcom.h monitor/broadcom.c monitor/tty.h +@MONITOR_TRUE@am_monitor_btmon_OBJECTS = monitor/main.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/display.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/hcidump.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/ellisys.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/control.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/packet.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/vendor.$(OBJEXT) monitor/lmp.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/crc.$(OBJEXT) monitor/ll.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/l2cap.$(OBJEXT) monitor/sdp.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/avctp.$(OBJEXT) monitor/avdtp.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/a2dp.$(OBJEXT) monitor/rfcomm.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/bnep.$(OBJEXT) monitor/uuid.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/hwdb.$(OBJEXT) monitor/keys.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/analyze.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/intel.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/broadcom.$(OBJEXT) +monitor_btmon_OBJECTS = $(am_monitor_btmon_OBJECTS) +@MONITOR_TRUE@monitor_btmon_DEPENDENCIES = \ +@MONITOR_TRUE@ lib/libbluetooth-internal.la \ +@MONITOR_TRUE@ src/libshared-mainloop.la +am__obexd_src_obexd_SOURCES_DIST = btio/btio.h btio/btio.c \ + gobex/gobex.h gobex/gobex.c gobex/gobex-defs.h \ + gobex/gobex-defs.c gobex/gobex-packet.c gobex/gobex-packet.h \ + gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h \ + obexd/plugins/filesystem.c obexd/plugins/filesystem.h \ + obexd/plugins/bluetooth.c obexd/plugins/pcsuite.c \ + obexd/plugins/opp.c obexd/plugins/ftp.c obexd/plugins/ftp.h \ + obexd/plugins/irmc.c obexd/plugins/pbap.c \ + obexd/plugins/vcard.h obexd/plugins/vcard.c \ + obexd/plugins/phonebook.h obexd/plugins/phonebook-dummy.c \ + obexd/plugins/mas.c obexd/src/map_ap.h \ + obexd/plugins/messages.h obexd/plugins/messages-dummy.c \ + obexd/client/mns.c obexd/client/map-event.h obexd/src/main.c \ + obexd/src/obexd.h obexd/src/plugin.h obexd/src/plugin.c \ + obexd/src/log.h obexd/src/log.c obexd/src/manager.h \ + obexd/src/manager.c obexd/src/obex.h obexd/src/obex.c \ + obexd/src/obex-priv.h obexd/src/mimetype.h \ + obexd/src/mimetype.c obexd/src/service.h obexd/src/service.c \ + obexd/src/transport.h obexd/src/transport.c obexd/src/server.h \ + obexd/src/server.c obexd/client/manager.h \ + obexd/client/manager.c obexd/client/session.h \ + obexd/client/session.c obexd/client/bluetooth.h \ + obexd/client/bluetooth.c obexd/client/sync.h \ + obexd/client/sync.c obexd/client/pbap.h obexd/client/pbap.c \ + obexd/client/ftp.h obexd/client/ftp.c obexd/client/opp.h \ + obexd/client/opp.c obexd/client/map.h obexd/client/map.c \ + obexd/client/map-event.c obexd/client/transfer.h \ + obexd/client/transfer.c obexd/client/transport.h \ + obexd/client/transport.c obexd/client/dbus.h \ + obexd/client/dbus.c obexd/client/driver.h \ + obexd/client/driver.c +am__objects_5 = btio/obexd-btio.$(OBJEXT) +am__objects_6 = gobex/obexd-gobex.$(OBJEXT) \ + gobex/obexd-gobex-defs.$(OBJEXT) \ + gobex/obexd-gobex-packet.$(OBJEXT) \ + gobex/obexd-gobex-header.$(OBJEXT) \ + gobex/obexd-gobex-transfer.$(OBJEXT) \ + gobex/obexd-gobex-apparam.$(OBJEXT) +@EXPERIMENTAL_TRUE@am__objects_7 = \ +@EXPERIMENTAL_TRUE@ obexd/plugins/obexd-pcsuite.$(OBJEXT) +@OBEX_TRUE@am__objects_8 = obexd/plugins/obexd-irmc.$(OBJEXT) \ +@OBEX_TRUE@ obexd/plugins/obexd-pbap.$(OBJEXT) \ +@OBEX_TRUE@ obexd/plugins/obexd-vcard.$(OBJEXT) \ +@OBEX_TRUE@ obexd/plugins/obexd-phonebook-dummy.$(OBJEXT) +am__objects_9 = obexd/plugins/obexd-filesystem.$(OBJEXT) \ + obexd/plugins/obexd-bluetooth.$(OBJEXT) $(am__objects_7) \ + obexd/plugins/obexd-opp.$(OBJEXT) \ + obexd/plugins/obexd-ftp.$(OBJEXT) $(am__objects_8) \ + obexd/plugins/obexd-mas.$(OBJEXT) \ + obexd/plugins/obexd-messages-dummy.$(OBJEXT) \ + obexd/client/obexd-mns.$(OBJEXT) +am_obexd_src_obexd_OBJECTS = $(am__objects_5) $(am__objects_6) \ + $(am__objects_9) obexd/src/obexd-main.$(OBJEXT) \ + obexd/src/obexd-plugin.$(OBJEXT) obexd/src/obexd-log.$(OBJEXT) \ + obexd/src/obexd-manager.$(OBJEXT) \ + obexd/src/obexd-obex.$(OBJEXT) \ + obexd/src/obexd-mimetype.$(OBJEXT) \ + obexd/src/obexd-service.$(OBJEXT) \ + obexd/src/obexd-transport.$(OBJEXT) \ + obexd/src/obexd-server.$(OBJEXT) \ + obexd/client/obexd-manager.$(OBJEXT) \ + obexd/client/obexd-session.$(OBJEXT) \ + obexd/client/obexd-bluetooth.$(OBJEXT) \ + obexd/client/obexd-sync.$(OBJEXT) \ + obexd/client/obexd-pbap.$(OBJEXT) \ + obexd/client/obexd-ftp.$(OBJEXT) \ + obexd/client/obexd-opp.$(OBJEXT) \ + obexd/client/obexd-map.$(OBJEXT) \ + obexd/client/obexd-map-event.$(OBJEXT) \ + obexd/client/obexd-transfer.$(OBJEXT) \ + obexd/client/obexd-transport.$(OBJEXT) \ + obexd/client/obexd-dbus.$(OBJEXT) \ + obexd/client/obexd-driver.$(OBJEXT) +am__objects_10 = $(am__objects_1) +nodist_obexd_src_obexd_OBJECTS = $(am__objects_10) +obexd_src_obexd_OBJECTS = $(am_obexd_src_obexd_OBJECTS) \ + $(nodist_obexd_src_obexd_OBJECTS) +obexd_src_obexd_DEPENDENCIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la +obexd_src_obexd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(obexd_src_obexd_CFLAGS) $(CFLAGS) $(obexd_src_obexd_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__peripheral_btsensor_SOURCES_DIST = peripheral/main.c \ + peripheral/efivars.h peripheral/efivars.c peripheral/attach.h \ + peripheral/attach.c peripheral/log.h peripheral/log.c \ + peripheral/gap.h peripheral/gap.c peripheral/gatt.h \ + peripheral/gatt.c +@EXPERIMENTAL_TRUE@am_peripheral_btsensor_OBJECTS = \ +@EXPERIMENTAL_TRUE@ peripheral/main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ peripheral/efivars.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ peripheral/attach.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ peripheral/log.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ peripheral/gap.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ peripheral/gatt.$(OBJEXT) +peripheral_btsensor_OBJECTS = $(am_peripheral_btsensor_OBJECTS) +@EXPERIMENTAL_TRUE@peripheral_btsensor_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__profiles_cups_bluetooth_SOURCES_DIST = profiles/cups/main.c \ + profiles/cups/cups.h profiles/cups/sdp.c profiles/cups/spp.c \ + profiles/cups/hcrp.c +@CUPS_TRUE@am_profiles_cups_bluetooth_OBJECTS = \ +@CUPS_TRUE@ profiles/cups/main.$(OBJEXT) \ +@CUPS_TRUE@ profiles/cups/sdp.$(OBJEXT) \ +@CUPS_TRUE@ profiles/cups/spp.$(OBJEXT) \ +@CUPS_TRUE@ profiles/cups/hcrp.$(OBJEXT) +profiles_cups_bluetooth_OBJECTS = \ + $(am_profiles_cups_bluetooth_OBJECTS) +@CUPS_TRUE@profiles_cups_bluetooth_DEPENDENCIES = \ +@CUPS_TRUE@ lib/libbluetooth-internal.la \ +@CUPS_TRUE@ gdbus/libgdbus-internal.la +am__profiles_iap_iapd_SOURCES_DIST = profiles/iap/main.c +@EXPERIMENTAL_TRUE@am_profiles_iap_iapd_OBJECTS = \ +@EXPERIMENTAL_TRUE@ profiles/iap/main.$(OBJEXT) +profiles_iap_iapd_OBJECTS = $(am_profiles_iap_iapd_OBJECTS) +@EXPERIMENTAL_TRUE@profiles_iap_iapd_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la +am__src_bluetoothd_SOURCES_DIST = plugins/hostname.c plugins/wiimote.c \ + plugins/autopair.c plugins/policy.c plugins/gatt-example.c \ + plugins/neard.c profiles/sap/main.c profiles/sap/manager.h \ + profiles/sap/manager.c profiles/sap/server.h \ + profiles/sap/server.c profiles/sap/sap.h \ + profiles/sap/sap-dummy.c profiles/audio/source.h \ + profiles/audio/source.c profiles/audio/sink.h \ + profiles/audio/sink.c profiles/audio/a2dp.h \ + profiles/audio/a2dp.c profiles/audio/avdtp.h \ + profiles/audio/avdtp.c profiles/audio/media.h \ + profiles/audio/media.c profiles/audio/transport.h \ + profiles/audio/transport.c profiles/audio/a2dp-codecs.h \ + profiles/audio/control.h profiles/audio/control.c \ + profiles/audio/avctp.h profiles/audio/avctp.c \ + profiles/audio/avrcp.h profiles/audio/avrcp.c \ + profiles/audio/player.h profiles/audio/player.c \ + profiles/network/manager.c profiles/network/bnep.h \ + profiles/network/bnep.c profiles/network/server.h \ + profiles/network/server.c profiles/network/connection.h \ + profiles/network/connection.c profiles/input/manager.c \ + profiles/input/server.h profiles/input/server.c \ + profiles/input/device.h profiles/input/device.c \ + profiles/input/hidp_defs.h profiles/input/hog.c \ + profiles/input/uhid_copy.h profiles/input/hog-lib.c \ + profiles/input/hog-lib.h profiles/deviceinfo/dis.c \ + profiles/deviceinfo/dis.h profiles/battery/bas.c \ + profiles/battery/bas.h profiles/scanparam/scpp.c \ + profiles/scanparam/scpp.h profiles/input/suspend.h \ + profiles/input/suspend-none.c profiles/health/mcap.h \ + profiles/health/mcap.c profiles/health/hdp_main.c \ + profiles/health/hdp_types.h profiles/health/hdp_manager.h \ + profiles/health/hdp_manager.c profiles/health/hdp.h \ + profiles/health/hdp.c profiles/health/hdp_util.h \ + profiles/health/hdp_util.c profiles/gap/gas.c \ + profiles/scanparam/scan.c profiles/deviceinfo/deviceinfo.c \ + attrib/att.h attrib/att-database.h attrib/att.c attrib/gatt.h \ + attrib/gatt.c attrib/gattrib.h attrib/gattrib.c \ + attrib/gatt-service.h attrib/gatt-service.c btio/btio.h \ + btio/btio.c src/bluetooth.ver src/main.c src/log.h src/log.c \ + src/backtrace.h src/backtrace.c src/systemd.h src/systemd.c \ + src/rfkill.c src/hcid.h src/sdpd.h src/sdpd-server.c \ + src/sdpd-request.c src/sdpd-service.c src/sdpd-database.c \ + src/attrib-server.h src/attrib-server.c src/gatt-database.h \ + src/gatt-database.c src/sdp-xml.h src/sdp-xml.c \ + src/sdp-client.h src/sdp-client.c src/textfile.h \ + src/textfile.c src/uuid-helper.h src/uuid-helper.c \ + src/uinput.h src/plugin.h src/plugin.c src/storage.h \ + src/storage.c src/advertising.h src/advertising.c src/agent.h \ + src/agent.c src/error.h src/error.c src/adapter.h \ + src/adapter.c src/profile.h src/profile.c src/service.h \ + src/service.c src/gatt-client.h src/gatt-client.c src/device.h \ + src/device.c src/dbus-common.c src/dbus-common.h src/eir.h \ + src/eir.c +@MAINTAINER_MODE_TRUE@am__objects_11 = plugins/bluetoothd-gatt-example.$(OBJEXT) +@EXPERIMENTAL_TRUE@am__objects_12 = \ +@EXPERIMENTAL_TRUE@ plugins/bluetoothd-neard.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-manager.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-server.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-sap-dummy.$(OBJEXT) +@EXPERIMENTAL_TRUE@am__objects_13 = \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-mcap.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp_main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp_manager.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp_util.$(OBJEXT) +am__objects_14 = plugins/bluetoothd-hostname.$(OBJEXT) \ + plugins/bluetoothd-wiimote.$(OBJEXT) \ + plugins/bluetoothd-autopair.$(OBJEXT) \ + plugins/bluetoothd-policy.$(OBJEXT) $(am__objects_11) \ + $(am__objects_12) profiles/audio/bluetoothd-source.$(OBJEXT) \ + profiles/audio/bluetoothd-sink.$(OBJEXT) \ + profiles/audio/bluetoothd-a2dp.$(OBJEXT) \ + profiles/audio/bluetoothd-avdtp.$(OBJEXT) \ + profiles/audio/bluetoothd-media.$(OBJEXT) \ + profiles/audio/bluetoothd-transport.$(OBJEXT) \ + profiles/audio/bluetoothd-control.$(OBJEXT) \ + profiles/audio/bluetoothd-avctp.$(OBJEXT) \ + profiles/audio/bluetoothd-avrcp.$(OBJEXT) \ + profiles/audio/bluetoothd-player.$(OBJEXT) \ + profiles/network/bluetoothd-manager.$(OBJEXT) \ + profiles/network/bluetoothd-bnep.$(OBJEXT) \ + profiles/network/bluetoothd-server.$(OBJEXT) \ + profiles/network/bluetoothd-connection.$(OBJEXT) \ + profiles/input/bluetoothd-manager.$(OBJEXT) \ + profiles/input/bluetoothd-server.$(OBJEXT) \ + profiles/input/bluetoothd-device.$(OBJEXT) \ + profiles/input/bluetoothd-hog.$(OBJEXT) \ + profiles/input/bluetoothd-hog-lib.$(OBJEXT) \ + profiles/deviceinfo/bluetoothd-dis.$(OBJEXT) \ + profiles/battery/bluetoothd-bas.$(OBJEXT) \ + profiles/scanparam/bluetoothd-scpp.$(OBJEXT) \ + profiles/input/bluetoothd-suspend-none.$(OBJEXT) \ + $(am__objects_13) profiles/gap/bluetoothd-gas.$(OBJEXT) \ + profiles/scanparam/bluetoothd-scan.$(OBJEXT) \ + profiles/deviceinfo/bluetoothd-deviceinfo.$(OBJEXT) +am__objects_15 = attrib/bluetoothd-att.$(OBJEXT) \ + attrib/bluetoothd-gatt.$(OBJEXT) \ + attrib/bluetoothd-gattrib.$(OBJEXT) \ + attrib/bluetoothd-gatt-service.$(OBJEXT) +am__objects_16 = btio/bluetoothd-btio.$(OBJEXT) +am_src_bluetoothd_OBJECTS = $(am__objects_14) $(am__objects_15) \ + $(am__objects_16) src/bluetoothd-main.$(OBJEXT) \ + src/bluetoothd-log.$(OBJEXT) \ + src/bluetoothd-backtrace.$(OBJEXT) \ + src/bluetoothd-systemd.$(OBJEXT) \ + src/bluetoothd-rfkill.$(OBJEXT) \ + src/bluetoothd-sdpd-server.$(OBJEXT) \ + src/bluetoothd-sdpd-request.$(OBJEXT) \ + src/bluetoothd-sdpd-service.$(OBJEXT) \ + src/bluetoothd-sdpd-database.$(OBJEXT) \ + src/bluetoothd-attrib-server.$(OBJEXT) \ + src/bluetoothd-gatt-database.$(OBJEXT) \ + src/bluetoothd-sdp-xml.$(OBJEXT) \ + src/bluetoothd-sdp-client.$(OBJEXT) \ + src/bluetoothd-textfile.$(OBJEXT) \ + src/bluetoothd-uuid-helper.$(OBJEXT) \ + src/bluetoothd-plugin.$(OBJEXT) \ + src/bluetoothd-storage.$(OBJEXT) \ + src/bluetoothd-advertising.$(OBJEXT) \ + src/bluetoothd-agent.$(OBJEXT) src/bluetoothd-error.$(OBJEXT) \ + src/bluetoothd-adapter.$(OBJEXT) \ + src/bluetoothd-profile.$(OBJEXT) \ + src/bluetoothd-service.$(OBJEXT) \ + src/bluetoothd-gatt-client.$(OBJEXT) \ + src/bluetoothd-device.$(OBJEXT) \ + src/bluetoothd-dbus-common.$(OBJEXT) \ + src/bluetoothd-eir.$(OBJEXT) +nodist_src_bluetoothd_OBJECTS = $(am__objects_10) +src_bluetoothd_OBJECTS = $(am_src_bluetoothd_OBJECTS) \ + $(nodist_src_bluetoothd_OBJECTS) +src_bluetoothd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(src_bluetoothd_CFLAGS) $(CFLAGS) $(src_bluetoothd_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__tools_3dsp_SOURCES_DIST = tools/3dsp.c monitor/bt.h +@EXPERIMENTAL_TRUE@am_tools_3dsp_OBJECTS = tools/3dsp.$(OBJEXT) +tools_3dsp_OBJECTS = $(am_tools_3dsp_OBJECTS) +@EXPERIMENTAL_TRUE@tools_3dsp_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +tools_amptest_SOURCES = tools/amptest.c +tools_amptest_OBJECTS = tools/amptest.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_amptest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_avinfo_SOURCES = tools/avinfo.c +tools_avinfo_OBJECTS = tools/avinfo.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_avinfo_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_avtest_SOURCES = tools/avtest.c +tools_avtest_OBJECTS = tools/avtest.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_avtest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_bccmd_SOURCES_DIST = tools/bccmd.c tools/csr.h tools/csr.c \ + tools/csr_hci.c tools/csr_usb.c tools/csr_h4.c \ + tools/csr_3wire.c tools/csr_bcsp.c tools/ubcsp.h tools/ubcsp.c +@TOOLS_TRUE@am_tools_bccmd_OBJECTS = tools/bccmd.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr.$(OBJEXT) tools/csr_hci.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr_usb.$(OBJEXT) tools/csr_h4.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr_3wire.$(OBJEXT) tools/csr_bcsp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/ubcsp.$(OBJEXT) +tools_bccmd_OBJECTS = $(am_tools_bccmd_OBJECTS) +@TOOLS_TRUE@tools_bccmd_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_bdaddr_SOURCES_DIST = tools/bdaddr.c src/oui.h src/oui.c +@EXPERIMENTAL_TRUE@am_tools_bdaddr_OBJECTS = tools/bdaddr.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/oui.$(OBJEXT) +tools_bdaddr_OBJECTS = $(am_tools_bdaddr_OBJECTS) +@EXPERIMENTAL_TRUE@tools_bdaddr_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_bluemoon_SOURCES_DIST = tools/bluemoon.c monitor/bt.h +@TOOLS_TRUE@am_tools_bluemoon_OBJECTS = tools/bluemoon.$(OBJEXT) +tools_bluemoon_OBJECTS = $(am_tools_bluemoon_OBJECTS) +@TOOLS_TRUE@tools_bluemoon_DEPENDENCIES = src/libshared-mainloop.la +am__tools_bluetooth_player_SOURCES_DIST = tools/bluetooth-player.c \ + client/display.h client/display.c +@READLINE_TRUE@am_tools_bluetooth_player_OBJECTS = \ +@READLINE_TRUE@ tools/bluetooth-player.$(OBJEXT) \ +@READLINE_TRUE@ client/display.$(OBJEXT) +tools_bluetooth_player_OBJECTS = $(am_tools_bluetooth_player_OBJECTS) +@READLINE_TRUE@tools_bluetooth_player_DEPENDENCIES = \ +@READLINE_TRUE@ gdbus/libgdbus-internal.la +am__tools_bnep_tester_SOURCES_DIST = tools/bnep-tester.c monitor/bt.h \ + emulator/hciemu.h emulator/hciemu.c emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_bnep_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/bnep-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_bnep_tester_OBJECTS = $(am_tools_bnep_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_bnep_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +am__tools_bneptest_SOURCES_DIST = tools/bneptest.c btio/btio.h \ + btio/btio.c src/log.h src/log.c profiles/network/bnep.h \ + profiles/network/bnep.c +@EXPERIMENTAL_TRUE@am_tools_bneptest_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/bneptest.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ btio/btio.$(OBJEXT) src/log.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/network/bnep.$(OBJEXT) +tools_bneptest_OBJECTS = $(am_tools_bneptest_OBJECTS) +@EXPERIMENTAL_TRUE@tools_bneptest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_btattach_SOURCES_DIST = tools/btattach.c monitor/bt.h +@EXPERIMENTAL_TRUE@am_tools_btattach_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/btattach.$(OBJEXT) +tools_btattach_OBJECTS = $(am_tools_btattach_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btattach_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__tools_btgatt_client_SOURCES_DIST = tools/btgatt-client.c \ + src/uuid-helper.c +@EXPERIMENTAL_TRUE@am_tools_btgatt_client_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/btgatt-client.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/uuid-helper.$(OBJEXT) +tools_btgatt_client_OBJECTS = $(am_tools_btgatt_client_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btgatt_client_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_btgatt_server_SOURCES_DIST = tools/btgatt-server.c \ + src/uuid-helper.c +@EXPERIMENTAL_TRUE@am_tools_btgatt_server_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/btgatt-server.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/uuid-helper.$(OBJEXT) +tools_btgatt_server_OBJECTS = $(am_tools_btgatt_server_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btgatt_server_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_btinfo_SOURCES_DIST = tools/btinfo.c monitor/bt.h +@EXPERIMENTAL_TRUE@am_tools_btinfo_OBJECTS = tools/btinfo.$(OBJEXT) +tools_btinfo_OBJECTS = $(am_tools_btinfo_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btinfo_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__tools_btiotest_SOURCES_DIST = tools/btiotest.c btio/btio.h \ + btio/btio.c +@EXPERIMENTAL_TRUE@am_tools_btiotest_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/btiotest.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ btio/btio.$(OBJEXT) +tools_btiotest_OBJECTS = $(am_tools_btiotest_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btiotest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_btmgmt_SOURCES_DIST = tools/btmgmt.c src/uuid-helper.c \ + client/display.c +@READLINE_TRUE@am_tools_btmgmt_OBJECTS = tools/btmgmt.$(OBJEXT) \ +@READLINE_TRUE@ src/uuid-helper.$(OBJEXT) \ +@READLINE_TRUE@ client/display.$(OBJEXT) +tools_btmgmt_OBJECTS = $(am_tools_btmgmt_OBJECTS) +@READLINE_TRUE@tools_btmgmt_DEPENDENCIES = \ +@READLINE_TRUE@ lib/libbluetooth-internal.la \ +@READLINE_TRUE@ src/libshared-mainloop.la +am__tools_btproxy_SOURCES_DIST = tools/btproxy.c monitor/bt.h +@EXPERIMENTAL_TRUE@am_tools_btproxy_OBJECTS = tools/btproxy.$(OBJEXT) +tools_btproxy_OBJECTS = $(am_tools_btproxy_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btproxy_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__tools_btsnoop_SOURCES_DIST = tools/btsnoop.c +@EXPERIMENTAL_TRUE@am_tools_btsnoop_OBJECTS = tools/btsnoop.$(OBJEXT) +tools_btsnoop_OBJECTS = $(am_tools_btsnoop_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btsnoop_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +tools_check_selftest_SOURCES = tools/check-selftest.c +tools_check_selftest_OBJECTS = tools/check-selftest.$(OBJEXT) +tools_check_selftest_LDADD = $(LDADD) +tools_ciptool_SOURCES = tools/ciptool.c +tools_ciptool_OBJECTS = tools/ciptool.$(OBJEXT) +@TOOLS_TRUE@tools_ciptool_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_cltest_SOURCES_DIST = tools/cltest.c +@EXPERIMENTAL_TRUE@am_tools_cltest_OBJECTS = tools/cltest.$(OBJEXT) +tools_cltest_OBJECTS = $(am_tools_cltest_OBJECTS) +@EXPERIMENTAL_TRUE@tools_cltest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__tools_create_image_SOURCES_DIST = tools/create-image.c +@EXPERIMENTAL_TRUE@am_tools_create_image_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/create-image.$(OBJEXT) +tools_create_image_OBJECTS = $(am_tools_create_image_OBJECTS) +tools_create_image_LDADD = $(LDADD) +am__tools_eddystone_SOURCES_DIST = tools/eddystone.c monitor/bt.h +@EXPERIMENTAL_TRUE@am_tools_eddystone_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/eddystone.$(OBJEXT) +tools_eddystone_OBJECTS = $(am_tools_eddystone_OBJECTS) +@EXPERIMENTAL_TRUE@tools_eddystone_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__tools_gap_tester_SOURCES_DIST = tools/gap-tester.c monitor/bt.h \ + emulator/hciemu.h emulator/hciemu.c emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_gap_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/gap-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_gap_tester_OBJECTS = $(am_tools_gap_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_gap_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +am__tools_gatt_service_SOURCES_DIST = tools/gatt-service.c +@EXPERIMENTAL_TRUE@am_tools_gatt_service_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/gatt-service.$(OBJEXT) +tools_gatt_service_OBJECTS = $(am_tools_gatt_service_OBJECTS) +@EXPERIMENTAL_TRUE@tools_gatt_service_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la +am__tools_hci_tester_SOURCES_DIST = tools/hci-tester.c monitor/bt.h +@EXPERIMENTAL_TRUE@am_tools_hci_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/hci-tester.$(OBJEXT) +tools_hci_tester_OBJECTS = $(am_tools_hci_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_hci_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +am__tools_hciattach_SOURCES_DIST = tools/hciattach.c tools/hciattach.h \ + tools/hciattach_st.c tools/hciattach_ti.c \ + tools/hciattach_tialt.c tools/hciattach_ath3k.c \ + tools/hciattach_qualcomm.c tools/hciattach_intel.c \ + tools/hciattach_bcm43xx.c +@TOOLS_TRUE@am_tools_hciattach_OBJECTS = tools/hciattach.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_st.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_ti.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_tialt.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_ath3k.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_qualcomm.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_intel.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_bcm43xx.$(OBJEXT) +tools_hciattach_OBJECTS = $(am_tools_hciattach_OBJECTS) +@TOOLS_TRUE@tools_hciattach_DEPENDENCIES = \ +@TOOLS_TRUE@ lib/libbluetooth-internal.la +am__tools_hciconfig_SOURCES_DIST = tools/hciconfig.c tools/csr.h \ + tools/csr.c +@TOOLS_TRUE@am_tools_hciconfig_OBJECTS = tools/hciconfig.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr.$(OBJEXT) +tools_hciconfig_OBJECTS = $(am_tools_hciconfig_OBJECTS) +@TOOLS_TRUE@tools_hciconfig_DEPENDENCIES = \ +@TOOLS_TRUE@ lib/libbluetooth-internal.la +am__tools_hcidump_SOURCES_DIST = tools/hcidump.c tools/parser/parser.h \ + tools/parser/parser.c tools/parser/lmp.c tools/parser/hci.c \ + tools/parser/l2cap.h tools/parser/l2cap.c tools/parser/amp.c \ + tools/parser/smp.c tools/parser/att.c tools/parser/sdp.h \ + tools/parser/sdp.c tools/parser/rfcomm.h tools/parser/rfcomm.c \ + tools/parser/bnep.c tools/parser/cmtp.c tools/parser/hidp.c \ + tools/parser/hcrp.c tools/parser/avdtp.c tools/parser/avctp.c \ + tools/parser/avrcp.c tools/parser/sap.c tools/parser/obex.c \ + tools/parser/capi.c tools/parser/ppp.c tools/parser/tcpip.c \ + tools/parser/ericsson.c tools/parser/csr.c tools/parser/bpa.c +@TOOLS_TRUE@am_tools_hcidump_OBJECTS = tools/hcidump.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/parser.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/lmp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/hci.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/l2cap.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/amp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/smp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/att.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/sdp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/rfcomm.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/bnep.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/cmtp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/hidp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/hcrp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/avdtp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/avctp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/avrcp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/sap.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/obex.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/capi.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/ppp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/tcpip.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/ericsson.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/csr.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/bpa.$(OBJEXT) +tools_hcidump_OBJECTS = $(am_tools_hcidump_OBJECTS) +@TOOLS_TRUE@tools_hcidump_DEPENDENCIES = lib/libbluetooth-internal.la +tools_hcieventmask_SOURCES = tools/hcieventmask.c +tools_hcieventmask_OBJECTS = tools/hcieventmask.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_hcieventmask_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_hcisecfilter_SOURCES = tools/hcisecfilter.c +tools_hcisecfilter_OBJECTS = tools/hcisecfilter.$(OBJEXT) +tools_hcisecfilter_LDADD = $(LDADD) +am__tools_hcitool_SOURCES_DIST = tools/hcitool.c src/oui.h src/oui.c +@TOOLS_TRUE@am_tools_hcitool_OBJECTS = tools/hcitool.$(OBJEXT) \ +@TOOLS_TRUE@ src/oui.$(OBJEXT) +tools_hcitool_OBJECTS = $(am_tools_hcitool_OBJECTS) +@TOOLS_TRUE@tools_hcitool_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_hex2hcd_SOURCES_DIST = tools/hex2hcd.c +@TOOLS_TRUE@am_tools_hex2hcd_OBJECTS = tools/hex2hcd.$(OBJEXT) +tools_hex2hcd_OBJECTS = $(am_tools_hex2hcd_OBJECTS) +tools_hex2hcd_LDADD = $(LDADD) +tools_hid2hci_SOURCES = tools/hid2hci.c +tools_hid2hci_OBJECTS = tools/hid2hci.$(OBJEXT) +tools_hid2hci_DEPENDENCIES = +tools_hwdb_SOURCES = tools/hwdb.c +tools_hwdb_OBJECTS = tools/hwdb.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_hwdb_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_ibeacon_SOURCES_DIST = tools/ibeacon.c monitor/bt.h +@EXPERIMENTAL_TRUE@am_tools_ibeacon_OBJECTS = tools/ibeacon.$(OBJEXT) +tools_ibeacon_OBJECTS = $(am_tools_ibeacon_OBJECTS) +@EXPERIMENTAL_TRUE@tools_ibeacon_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +am__tools_l2cap_tester_SOURCES_DIST = tools/l2cap-tester.c \ + monitor/bt.h emulator/hciemu.h emulator/hciemu.c \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_l2cap_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/l2cap-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_l2cap_tester_OBJECTS = $(am_tools_l2cap_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_l2cap_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +tools_l2ping_SOURCES = tools/l2ping.c +tools_l2ping_OBJECTS = tools/l2ping.$(OBJEXT) +@TOOLS_TRUE@tools_l2ping_DEPENDENCIES = lib/libbluetooth-internal.la +tools_l2test_SOURCES = tools/l2test.c +tools_l2test_OBJECTS = tools/l2test.$(OBJEXT) +@TOOLS_TRUE@tools_l2test_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_mcaptest_SOURCES_DIST = tools/mcaptest.c btio/btio.h \ + btio/btio.c src/log.c src/log.h profiles/health/mcap.h \ + profiles/health/mcap.c +@EXPERIMENTAL_TRUE@am_tools_mcaptest_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/mcaptest.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ btio/btio.$(OBJEXT) src/log.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/mcap.$(OBJEXT) +tools_mcaptest_OBJECTS = $(am_tools_mcaptest_OBJECTS) +@EXPERIMENTAL_TRUE@tools_mcaptest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_mgmt_tester_SOURCES_DIST = tools/mgmt-tester.c monitor/bt.h \ + emulator/hciemu.h emulator/hciemu.c emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_mgmt_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/mgmt-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_mgmt_tester_OBJECTS = $(am_tools_mgmt_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_mgmt_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +am__tools_mpris_proxy_SOURCES_DIST = tools/mpris-proxy.c +@TOOLS_TRUE@am_tools_mpris_proxy_OBJECTS = \ +@TOOLS_TRUE@ tools/mpris-proxy.$(OBJEXT) +tools_mpris_proxy_OBJECTS = $(am_tools_mpris_proxy_OBJECTS) +@TOOLS_TRUE@tools_mpris_proxy_DEPENDENCIES = \ +@TOOLS_TRUE@ gdbus/libgdbus-internal.la +am__tools_nokfw_SOURCES_DIST = tools/nokfw.c +@EXPERIMENTAL_TRUE@am_tools_nokfw_OBJECTS = tools/nokfw.$(OBJEXT) +tools_nokfw_OBJECTS = $(am_tools_nokfw_OBJECTS) +tools_nokfw_LDADD = $(LDADD) +am__tools_obex_client_tool_SOURCES_DIST = gobex/gobex.h gobex/gobex.c \ + gobex/gobex-defs.h gobex/gobex-defs.c gobex/gobex-packet.c \ + gobex/gobex-packet.h gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h btio/btio.h \ + btio/btio.c tools/obex-client-tool.c +am__objects_17 = gobex/gobex.$(OBJEXT) gobex/gobex-defs.$(OBJEXT) \ + gobex/gobex-packet.$(OBJEXT) gobex/gobex-header.$(OBJEXT) \ + gobex/gobex-transfer.$(OBJEXT) gobex/gobex-apparam.$(OBJEXT) +am__objects_18 = btio/btio.$(OBJEXT) +@READLINE_TRUE@am_tools_obex_client_tool_OBJECTS = $(am__objects_17) \ +@READLINE_TRUE@ $(am__objects_18) \ +@READLINE_TRUE@ tools/obex-client-tool.$(OBJEXT) +tools_obex_client_tool_OBJECTS = $(am_tools_obex_client_tool_OBJECTS) +@READLINE_TRUE@tools_obex_client_tool_DEPENDENCIES = \ +@READLINE_TRUE@ lib/libbluetooth-internal.la +am__tools_obex_server_tool_SOURCES_DIST = gobex/gobex.h gobex/gobex.c \ + gobex/gobex-defs.h gobex/gobex-defs.c gobex/gobex-packet.c \ + gobex/gobex-packet.h gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h btio/btio.h \ + btio/btio.c tools/obex-server-tool.c +@READLINE_TRUE@am_tools_obex_server_tool_OBJECTS = $(am__objects_17) \ +@READLINE_TRUE@ $(am__objects_18) \ +@READLINE_TRUE@ tools/obex-server-tool.$(OBJEXT) +tools_obex_server_tool_OBJECTS = $(am_tools_obex_server_tool_OBJECTS) +@READLINE_TRUE@tools_obex_server_tool_DEPENDENCIES = \ +@READLINE_TRUE@ lib/libbluetooth-internal.la +am__tools_obexctl_SOURCES_DIST = tools/obexctl.c client/display.h \ + client/display.c +@READLINE_TRUE@am_tools_obexctl_OBJECTS = tools/obexctl.$(OBJEXT) \ +@READLINE_TRUE@ client/display.$(OBJEXT) +tools_obexctl_OBJECTS = $(am_tools_obexctl_OBJECTS) +@READLINE_TRUE@tools_obexctl_DEPENDENCIES = \ +@READLINE_TRUE@ gdbus/libgdbus-internal.la +am__tools_oobtest_SOURCES_DIST = tools/oobtest.c +@EXPERIMENTAL_TRUE@am_tools_oobtest_OBJECTS = tools/oobtest.$(OBJEXT) +tools_oobtest_OBJECTS = $(am_tools_oobtest_OBJECTS) +@EXPERIMENTAL_TRUE@tools_oobtest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-mainloop.la +tools_rctest_SOURCES = tools/rctest.c +tools_rctest_OBJECTS = tools/rctest.$(OBJEXT) +@TOOLS_TRUE@tools_rctest_DEPENDENCIES = lib/libbluetooth-internal.la +tools_rfcomm_SOURCES = tools/rfcomm.c +tools_rfcomm_OBJECTS = tools/rfcomm.$(OBJEXT) +@TOOLS_TRUE@tools_rfcomm_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_rfcomm_tester_SOURCES_DIST = tools/rfcomm-tester.c \ + monitor/bt.h emulator/hciemu.h emulator/hciemu.c \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_rfcomm_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/rfcomm-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_rfcomm_tester_OBJECTS = $(am_tools_rfcomm_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_rfcomm_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +am__tools_sco_tester_SOURCES_DIST = tools/sco-tester.c monitor/bt.h \ + emulator/hciemu.h emulator/hciemu.c emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_sco_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/sco-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_sco_tester_OBJECTS = $(am_tools_sco_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_sco_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +tools_scotest_SOURCES = tools/scotest.c +tools_scotest_OBJECTS = tools/scotest.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_scotest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_sdptool_SOURCES_DIST = tools/sdptool.c src/sdp-xml.h \ + src/sdp-xml.c +@TOOLS_TRUE@am_tools_sdptool_OBJECTS = tools/sdptool.$(OBJEXT) \ +@TOOLS_TRUE@ src/sdp-xml.$(OBJEXT) +tools_sdptool_OBJECTS = $(am_tools_sdptool_OBJECTS) +@TOOLS_TRUE@tools_sdptool_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_seq2bseq_SOURCES_DIST = tools/seq2bseq.c +@EXPERIMENTAL_TRUE@am_tools_seq2bseq_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/seq2bseq.$(OBJEXT) +tools_seq2bseq_OBJECTS = $(am_tools_seq2bseq_OBJECTS) +tools_seq2bseq_LDADD = $(LDADD) +am__tools_smp_tester_SOURCES_DIST = tools/smp-tester.c monitor/bt.h \ + emulator/hciemu.h emulator/hciemu.c emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_smp_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/smp-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_smp_tester_OBJECTS = $(am_tools_smp_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_smp_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +tools_test_runner_SOURCES = tools/test-runner.c +tools_test_runner_OBJECTS = tools/test-runner.$(OBJEXT) +tools_test_runner_LDADD = $(LDADD) +am__tools_userchan_tester_SOURCES_DIST = tools/userchan-tester.c \ + monitor/bt.h emulator/hciemu.h emulator/hciemu.c \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c +@EXPERIMENTAL_TRUE@am_tools_userchan_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/userchan-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) +tools_userchan_tester_OBJECTS = $(am_tools_userchan_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_userchan_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la +am_unit_test_avctp_OBJECTS = unit/test-avctp.$(OBJEXT) \ + src/log.$(OBJEXT) android/avctp.$(OBJEXT) +unit_test_avctp_OBJECTS = $(am_unit_test_avctp_OBJECTS) +unit_test_avctp_DEPENDENCIES = src/libshared-glib.la +am_unit_test_avdtp_OBJECTS = unit/test-avdtp.$(OBJEXT) \ + src/log.$(OBJEXT) android/avdtp.$(OBJEXT) +unit_test_avdtp_OBJECTS = $(am_unit_test_avdtp_OBJECTS) +unit_test_avdtp_DEPENDENCIES = src/libshared-glib.la +am_unit_test_avrcp_OBJECTS = unit/test-avrcp.$(OBJEXT) \ + src/log.$(OBJEXT) android/avctp.$(OBJEXT) \ + android/avrcp-lib.$(OBJEXT) +unit_test_avrcp_OBJECTS = $(am_unit_test_avrcp_OBJECTS) +unit_test_avrcp_DEPENDENCIES = lib/libbluetooth-internal.la \ + src/libshared-glib.la +am_unit_test_crc_OBJECTS = unit/test-crc.$(OBJEXT) \ + monitor/crc.$(OBJEXT) +unit_test_crc_OBJECTS = $(am_unit_test_crc_OBJECTS) +unit_test_crc_DEPENDENCIES = src/libshared-glib.la +am_unit_test_crypto_OBJECTS = unit/test-crypto.$(OBJEXT) +unit_test_crypto_OBJECTS = $(am_unit_test_crypto_OBJECTS) +unit_test_crypto_DEPENDENCIES = src/libshared-glib.la +am_unit_test_ecc_OBJECTS = unit/test-ecc.$(OBJEXT) +unit_test_ecc_OBJECTS = $(am_unit_test_ecc_OBJECTS) +unit_test_ecc_DEPENDENCIES = src/libshared-glib.la +am_unit_test_eir_OBJECTS = unit/test-eir.$(OBJEXT) src/eir.$(OBJEXT) \ + src/uuid-helper.$(OBJEXT) +unit_test_eir_OBJECTS = $(am_unit_test_eir_OBJECTS) +unit_test_eir_DEPENDENCIES = src/libshared-glib.la \ + lib/libbluetooth-internal.la +am_unit_test_gatt_OBJECTS = unit/test-gatt.$(OBJEXT) +unit_test_gatt_OBJECTS = $(am_unit_test_gatt_OBJECTS) +unit_test_gatt_DEPENDENCIES = src/libshared-glib.la \ + lib/libbluetooth-internal.la +am_unit_test_gattrib_OBJECTS = unit/test-gattrib.$(OBJEXT) \ + attrib/gattrib.$(OBJEXT) $(am__objects_18) src/log.$(OBJEXT) +unit_test_gattrib_OBJECTS = $(am_unit_test_gattrib_OBJECTS) +unit_test_gattrib_DEPENDENCIES = lib/libbluetooth-internal.la \ + src/libshared-glib.la +am_unit_test_gdbus_client_OBJECTS = unit/test-gdbus-client.$(OBJEXT) +unit_test_gdbus_client_OBJECTS = $(am_unit_test_gdbus_client_OBJECTS) +unit_test_gdbus_client_DEPENDENCIES = gdbus/libgdbus-internal.la \ + src/libshared-glib.la +am_unit_test_gobex_OBJECTS = $(am__objects_17) unit/util.$(OBJEXT) \ + unit/test-gobex.$(OBJEXT) +unit_test_gobex_OBJECTS = $(am_unit_test_gobex_OBJECTS) +unit_test_gobex_DEPENDENCIES = +am_unit_test_gobex_apparam_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-apparam.$(OBJEXT) +unit_test_gobex_apparam_OBJECTS = \ + $(am_unit_test_gobex_apparam_OBJECTS) +unit_test_gobex_apparam_DEPENDENCIES = +am_unit_test_gobex_header_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-header.$(OBJEXT) +unit_test_gobex_header_OBJECTS = $(am_unit_test_gobex_header_OBJECTS) +unit_test_gobex_header_DEPENDENCIES = +am_unit_test_gobex_packet_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-packet.$(OBJEXT) +unit_test_gobex_packet_OBJECTS = $(am_unit_test_gobex_packet_OBJECTS) +unit_test_gobex_packet_DEPENDENCIES = +am_unit_test_gobex_transfer_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-transfer.$(OBJEXT) +unit_test_gobex_transfer_OBJECTS = \ + $(am_unit_test_gobex_transfer_OBJECTS) +unit_test_gobex_transfer_DEPENDENCIES = +am_unit_test_hfp_OBJECTS = unit/test-hfp.$(OBJEXT) +unit_test_hfp_OBJECTS = $(am_unit_test_hfp_OBJECTS) +unit_test_hfp_DEPENDENCIES = src/libshared-glib.la +am_unit_test_hog_OBJECTS = unit/test-hog.$(OBJEXT) $(am__objects_18) \ + profiles/input/hog-lib.$(OBJEXT) \ + profiles/scanparam/scpp.$(OBJEXT) \ + profiles/battery/bas.$(OBJEXT) \ + profiles/deviceinfo/dis.$(OBJEXT) src/log.$(OBJEXT) \ + attrib/att.$(OBJEXT) attrib/gatt.$(OBJEXT) \ + attrib/gattrib.$(OBJEXT) +unit_test_hog_OBJECTS = $(am_unit_test_hog_OBJECTS) +unit_test_hog_DEPENDENCIES = src/libshared-glib.la \ + lib/libbluetooth-internal.la +am_unit_test_lib_OBJECTS = unit/test-lib.$(OBJEXT) +unit_test_lib_OBJECTS = $(am_unit_test_lib_OBJECTS) +unit_test_lib_DEPENDENCIES = src/libshared-glib.la \ + lib/libbluetooth-internal.la +am_unit_test_mgmt_OBJECTS = unit/test-mgmt.$(OBJEXT) +unit_test_mgmt_OBJECTS = $(am_unit_test_mgmt_OBJECTS) +unit_test_mgmt_DEPENDENCIES = src/libshared-glib.la +am_unit_test_queue_OBJECTS = unit/test-queue.$(OBJEXT) +unit_test_queue_OBJECTS = $(am_unit_test_queue_OBJECTS) +unit_test_queue_DEPENDENCIES = src/libshared-glib.la +am_unit_test_ringbuf_OBJECTS = unit/test-ringbuf.$(OBJEXT) +unit_test_ringbuf_OBJECTS = $(am_unit_test_ringbuf_OBJECTS) +unit_test_ringbuf_DEPENDENCIES = src/libshared-glib.la +am_unit_test_sdp_OBJECTS = unit/test-sdp.$(OBJEXT) \ + src/sdpd-database.$(OBJEXT) src/log.$(OBJEXT) \ + src/sdpd-service.$(OBJEXT) src/sdpd-request.$(OBJEXT) +unit_test_sdp_OBJECTS = $(am_unit_test_sdp_OBJECTS) +unit_test_sdp_DEPENDENCIES = lib/libbluetooth-internal.la \ + src/libshared-glib.la +am_unit_test_textfile_OBJECTS = unit/test-textfile.$(OBJEXT) \ + src/textfile.$(OBJEXT) +unit_test_textfile_OBJECTS = $(am_unit_test_textfile_OBJECTS) +unit_test_textfile_DEPENDENCIES = src/libshared-glib.la +am_unit_test_uhid_OBJECTS = unit/test-uhid.$(OBJEXT) +unit_test_uhid_OBJECTS = $(am_unit_test_uhid_OBJECTS) +unit_test_uhid_DEPENDENCIES = src/libshared-glib.la +am_unit_test_uuid_OBJECTS = unit/test-uuid.$(OBJEXT) +unit_test_uuid_OBJECTS = $(am_unit_test_uuid_OBJECTS) +unit_test_uuid_DEPENDENCIES = src/libshared-glib.la \ + lib/libbluetooth-internal.la +SCRIPTS = $(test_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(profiles_sap_libsap_a_SOURCES) \ + $(android_audio_a2dp_default_la_SOURCES) \ + $(android_audio_sco_default_la_SOURCES) \ + $(android_bluetooth_default_la_SOURCES) \ + $(gdbus_libgdbus_internal_la_SOURCES) \ + $(lib_libbluetooth_internal_la_SOURCES) \ + $(lib_libbluetooth_la_SOURCES) \ + $(plugins_external_dummy_la_SOURCES) \ + $(plugins_sixaxis_la_SOURCES) $(src_libshared_glib_la_SOURCES) \ + $(src_libshared_mainloop_la_SOURCES) \ + $(android_android_tester_SOURCES) $(android_avdtptest_SOURCES) \ + $(android_bluetoothd_SOURCES) \ + $(android_bluetoothd_snoop_SOURCES) $(android_haltest_SOURCES) \ + $(android_ipc_tester_SOURCES) \ + $(android_system_emulator_SOURCES) $(android_test_ipc_SOURCES) \ + $(attrib_gatttool_SOURCES) $(client_bluetoothctl_SOURCES) \ + $(emulator_b1ee_SOURCES) $(emulator_btvirt_SOURCES) \ + $(emulator_hfp_SOURCES) $(monitor_btmon_SOURCES) \ + $(obexd_src_obexd_SOURCES) $(nodist_obexd_src_obexd_SOURCES) \ + $(peripheral_btsensor_SOURCES) \ + $(profiles_cups_bluetooth_SOURCES) \ + $(profiles_iap_iapd_SOURCES) $(src_bluetoothd_SOURCES) \ + $(nodist_src_bluetoothd_SOURCES) $(tools_3dsp_SOURCES) \ + tools/amptest.c tools/avinfo.c tools/avtest.c \ + $(tools_bccmd_SOURCES) $(tools_bdaddr_SOURCES) \ + $(tools_bluemoon_SOURCES) $(tools_bluetooth_player_SOURCES) \ + $(tools_bnep_tester_SOURCES) $(tools_bneptest_SOURCES) \ + $(tools_btattach_SOURCES) $(tools_btgatt_client_SOURCES) \ + $(tools_btgatt_server_SOURCES) $(tools_btinfo_SOURCES) \ + $(tools_btiotest_SOURCES) $(tools_btmgmt_SOURCES) \ + $(tools_btproxy_SOURCES) $(tools_btsnoop_SOURCES) \ + tools/check-selftest.c tools/ciptool.c $(tools_cltest_SOURCES) \ + $(tools_create_image_SOURCES) $(tools_eddystone_SOURCES) \ + $(tools_gap_tester_SOURCES) $(tools_gatt_service_SOURCES) \ + $(tools_hci_tester_SOURCES) $(tools_hciattach_SOURCES) \ + $(tools_hciconfig_SOURCES) $(tools_hcidump_SOURCES) \ + tools/hcieventmask.c tools/hcisecfilter.c \ + $(tools_hcitool_SOURCES) $(tools_hex2hcd_SOURCES) \ + tools/hid2hci.c tools/hwdb.c $(tools_ibeacon_SOURCES) \ + $(tools_l2cap_tester_SOURCES) tools/l2ping.c tools/l2test.c \ + $(tools_mcaptest_SOURCES) $(tools_mgmt_tester_SOURCES) \ + $(tools_mpris_proxy_SOURCES) $(tools_nokfw_SOURCES) \ + $(tools_obex_client_tool_SOURCES) \ + $(tools_obex_server_tool_SOURCES) $(tools_obexctl_SOURCES) \ + $(tools_oobtest_SOURCES) tools/rctest.c tools/rfcomm.c \ + $(tools_rfcomm_tester_SOURCES) $(tools_sco_tester_SOURCES) \ + tools/scotest.c $(tools_sdptool_SOURCES) \ + $(tools_seq2bseq_SOURCES) $(tools_smp_tester_SOURCES) \ + tools/test-runner.c $(tools_userchan_tester_SOURCES) \ + $(unit_test_avctp_SOURCES) $(unit_test_avdtp_SOURCES) \ + $(unit_test_avrcp_SOURCES) $(unit_test_crc_SOURCES) \ + $(unit_test_crypto_SOURCES) $(unit_test_ecc_SOURCES) \ + $(unit_test_eir_SOURCES) $(unit_test_gatt_SOURCES) \ + $(unit_test_gattrib_SOURCES) $(unit_test_gdbus_client_SOURCES) \ + $(unit_test_gobex_SOURCES) $(unit_test_gobex_apparam_SOURCES) \ + $(unit_test_gobex_header_SOURCES) \ + $(unit_test_gobex_packet_SOURCES) \ + $(unit_test_gobex_transfer_SOURCES) $(unit_test_hfp_SOURCES) \ + $(unit_test_hog_SOURCES) $(unit_test_lib_SOURCES) \ + $(unit_test_mgmt_SOURCES) $(unit_test_queue_SOURCES) \ + $(unit_test_ringbuf_SOURCES) $(unit_test_sdp_SOURCES) \ + $(unit_test_textfile_SOURCES) $(unit_test_uhid_SOURCES) \ + $(unit_test_uuid_SOURCES) +DIST_SOURCES = $(am__profiles_sap_libsap_a_SOURCES_DIST) \ + $(am__android_audio_a2dp_default_la_SOURCES_DIST) \ + $(am__android_audio_sco_default_la_SOURCES_DIST) \ + $(am__android_bluetooth_default_la_SOURCES_DIST) \ + $(gdbus_libgdbus_internal_la_SOURCES) \ + $(lib_libbluetooth_internal_la_SOURCES) \ + $(am__lib_libbluetooth_la_SOURCES_DIST) \ + $(am__plugins_external_dummy_la_SOURCES_DIST) \ + $(am__plugins_sixaxis_la_SOURCES_DIST) \ + $(src_libshared_glib_la_SOURCES) \ + $(src_libshared_mainloop_la_SOURCES) \ + $(am__android_android_tester_SOURCES_DIST) \ + $(am__android_avdtptest_SOURCES_DIST) \ + $(am__android_bluetoothd_SOURCES_DIST) \ + $(am__android_bluetoothd_snoop_SOURCES_DIST) \ + $(am__android_haltest_SOURCES_DIST) \ + $(am__android_ipc_tester_SOURCES_DIST) \ + $(am__android_system_emulator_SOURCES_DIST) \ + $(am__android_test_ipc_SOURCES_DIST) \ + $(am__attrib_gatttool_SOURCES_DIST) \ + $(am__client_bluetoothctl_SOURCES_DIST) \ + $(am__emulator_b1ee_SOURCES_DIST) \ + $(am__emulator_btvirt_SOURCES_DIST) \ + $(am__emulator_hfp_SOURCES_DIST) \ + $(am__monitor_btmon_SOURCES_DIST) \ + $(am__obexd_src_obexd_SOURCES_DIST) \ + $(am__peripheral_btsensor_SOURCES_DIST) \ + $(am__profiles_cups_bluetooth_SOURCES_DIST) \ + $(am__profiles_iap_iapd_SOURCES_DIST) \ + $(am__src_bluetoothd_SOURCES_DIST) \ + $(am__tools_3dsp_SOURCES_DIST) tools/amptest.c tools/avinfo.c \ + tools/avtest.c $(am__tools_bccmd_SOURCES_DIST) \ + $(am__tools_bdaddr_SOURCES_DIST) \ + $(am__tools_bluemoon_SOURCES_DIST) \ + $(am__tools_bluetooth_player_SOURCES_DIST) \ + $(am__tools_bnep_tester_SOURCES_DIST) \ + $(am__tools_bneptest_SOURCES_DIST) \ + $(am__tools_btattach_SOURCES_DIST) \ + $(am__tools_btgatt_client_SOURCES_DIST) \ + $(am__tools_btgatt_server_SOURCES_DIST) \ + $(am__tools_btinfo_SOURCES_DIST) \ + $(am__tools_btiotest_SOURCES_DIST) \ + $(am__tools_btmgmt_SOURCES_DIST) \ + $(am__tools_btproxy_SOURCES_DIST) \ + $(am__tools_btsnoop_SOURCES_DIST) tools/check-selftest.c \ + tools/ciptool.c $(am__tools_cltest_SOURCES_DIST) \ + $(am__tools_create_image_SOURCES_DIST) \ + $(am__tools_eddystone_SOURCES_DIST) \ + $(am__tools_gap_tester_SOURCES_DIST) \ + $(am__tools_gatt_service_SOURCES_DIST) \ + $(am__tools_hci_tester_SOURCES_DIST) \ + $(am__tools_hciattach_SOURCES_DIST) \ + $(am__tools_hciconfig_SOURCES_DIST) \ + $(am__tools_hcidump_SOURCES_DIST) tools/hcieventmask.c \ + tools/hcisecfilter.c $(am__tools_hcitool_SOURCES_DIST) \ + $(am__tools_hex2hcd_SOURCES_DIST) tools/hid2hci.c tools/hwdb.c \ + $(am__tools_ibeacon_SOURCES_DIST) \ + $(am__tools_l2cap_tester_SOURCES_DIST) tools/l2ping.c \ + tools/l2test.c $(am__tools_mcaptest_SOURCES_DIST) \ + $(am__tools_mgmt_tester_SOURCES_DIST) \ + $(am__tools_mpris_proxy_SOURCES_DIST) \ + $(am__tools_nokfw_SOURCES_DIST) \ + $(am__tools_obex_client_tool_SOURCES_DIST) \ + $(am__tools_obex_server_tool_SOURCES_DIST) \ + $(am__tools_obexctl_SOURCES_DIST) \ + $(am__tools_oobtest_SOURCES_DIST) tools/rctest.c \ + tools/rfcomm.c $(am__tools_rfcomm_tester_SOURCES_DIST) \ + $(am__tools_sco_tester_SOURCES_DIST) tools/scotest.c \ + $(am__tools_sdptool_SOURCES_DIST) \ + $(am__tools_seq2bseq_SOURCES_DIST) \ + $(am__tools_smp_tester_SOURCES_DIST) tools/test-runner.c \ + $(am__tools_userchan_tester_SOURCES_DIST) \ + $(unit_test_avctp_SOURCES) $(unit_test_avdtp_SOURCES) \ + $(unit_test_avrcp_SOURCES) $(unit_test_crc_SOURCES) \ + $(unit_test_crypto_SOURCES) $(unit_test_ecc_SOURCES) \ + $(unit_test_eir_SOURCES) $(unit_test_gatt_SOURCES) \ + $(unit_test_gattrib_SOURCES) $(unit_test_gdbus_client_SOURCES) \ + $(unit_test_gobex_SOURCES) $(unit_test_gobex_apparam_SOURCES) \ + $(unit_test_gobex_header_SOURCES) \ + $(unit_test_gobex_packet_SOURCES) \ + $(unit_test_gobex_transfer_SOURCES) $(unit_test_hfp_SOURCES) \ + $(unit_test_hog_SOURCES) $(unit_test_lib_SOURCES) \ + $(unit_test_mgmt_SOURCES) $(unit_test_queue_SOURCES) \ + $(unit_test_ringbuf_SOURCES) $(unit_test_sdp_SOURCES) \ + $(unit_test_textfile_SOURCES) $(unit_test_uhid_SOURCES) \ + $(unit_test_uuid_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(dist_man_MANS) $(man_MANS) +DATA = $(conf_DATA) $(dbus_DATA) $(dbussessionbus_DATA) \ + $(dbussystembus_DATA) $(pkgconfig_DATA) $(rules_DATA) \ + $(state_DATA) $(systemdsystemunit_DATA) \ + $(systemduserunit_DATA) +am__include_HEADERS_DIST = lib/bluetooth.h lib/hci.h lib/hci_lib.h \ + lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h lib/rfcomm.h \ + lib/bnep.h lib/cmtp.h lib/hidp.h +HEADERS = $(include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope check recheck +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BACKTRACE_CFLAGS = @BACKTRACE_CFLAGS@ +BACKTRACE_LIBS = @BACKTRACE_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIGDIR = @CONFIGDIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_CONFDIR = @DBUS_CONFDIR@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SESSIONBUSDIR = @DBUS_SESSIONBUSDIR@ +DBUS_SYSTEMBUSDIR = @DBUS_SYSTEMBUSDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GREP = @GREP@ +GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ +GTHREAD_LIBS = @GTHREAD_LIBS@ +ICAL_CFLAGS = @ICAL_CFLAGS@ +ICAL_LIBS = @ICAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MISC_CFLAGS = @MISC_CFLAGS@ +MISC_LDFLAGS = @MISC_LDFLAGS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SBC_CFLAGS = @SBC_CFLAGS@ +SBC_LIBS = @SBC_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SPEEXDSP_CFLAGS = @SPEEXDSP_CFLAGS@ +SPEEXDSP_LIBS = @SPEEXDSP_LIBS@ +STRIP = @STRIP@ +SYSTEMD_SYSTEMUNITDIR = @SYSTEMD_SYSTEMUNITDIR@ +SYSTEMD_USERUNITDIR = @SYSTEMD_USERUNITDIR@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_DIR = @UDEV_DIR@ +UDEV_LIBS = @UDEV_LIBS@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +enable_coverage = @enable_coverage@ +enable_dbus_run_session = @enable_dbus_run_session@ +enable_valgrind = @enable_valgrind@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@/bluetooth +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@/bluetooth +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_MAKEFLAGS = --no-print-directory +lib_LTLIBRARIES = $(am__append_2) +noinst_LIBRARIES = $(am__append_7) +noinst_LTLIBRARIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la src/libshared-glib.la \ + src/libshared-mainloop.la +dist_man_MANS = $(am__append_16) $(am__append_18) $(am__append_21) +dist_noinst_MANS = $(am__append_37) +CLEANFILES = $(builtin_files) src/bluetooth.service \ + obexd/src/builtin.h $(builtin_files) obexd/src/obex.service \ + $(am__append_34) +EXTRA_DIST = src/bluetooth.service.in src/org.bluez.service \ + profiles/input/suspend-dummy.c src/genbuiltin \ + src/bluetooth.conf src/main.conf profiles/network/network.conf \ + profiles/input/input.conf profiles/proximity/proximity.conf \ + $(am__append_17) $(am__append_19) $(am__append_22) \ + $(am__append_23) obexd/src/obex.service.in \ + obexd/src/org.bluez.obex.service obexd/src/genbuiltin \ + android/Android.mk android/README \ + android/compat/readline/history.h \ + android/compat/readline/readline.h android/compat/wordexp.h \ + android/bluetoothd-wrapper.c android/log.c \ + android/bluetoothd.te android/bluetoothd_snoop.te \ + android/init.bluetooth.rc android/hal-ipc-api.txt \ + android/audio-ipc-api.txt android/cts.txt \ + android/pics-rfcomm.txt android/pics-spp.txt \ + android/pics-sdp.txt android/pics-l2cap.txt \ + android/pics-gap.txt android/pics-did.txt android/pics-hid.txt \ + android/pics-pan.txt android/pics-opp.txt android/pics-map.txt \ + android/pics-pbap.txt android/pics-a2dp.txt \ + android/pics-avctp.txt android/pics-avrcp.txt \ + android/pics-hsp.txt android/pics-hfp.txt \ + android/pics-gatt.txt android/pics-mcap.txt \ + android/pics-hdp.txt android/pics-iopt.txt android/pics-sm.txt \ + android/pics-mps.txt android/pics-hogp.txt \ + android/pics-scpp.txt android/pics-dis.txt \ + android/pics-avdtp.txt android/pics-gavdp.txt \ + android/pics-bnep.txt android/pixit-l2cap.txt \ + android/pixit-gap.txt android/pixit-did.txt \ + android/pixit-hid.txt android/pixit-pan.txt \ + android/pixit-opp.txt android/pixit-map.txt \ + android/pixit-pbap.txt android/pixit-a2dp.txt \ + android/pixit-avctp.txt android/pixit-avrcp.txt \ + android/pixit-hsp.txt android/pixit-hfp.txt \ + android/pixit-gatt.txt android/pixit-mcap.txt \ + android/pixit-hdp.txt android/pixit-iopt.txt \ + android/pixit-sm.txt android/pixit-mps.txt \ + android/pixit-hogp.txt android/pixit-scpp.txt \ + android/pixit-dis.txt android/pixit-rfcomm.txt \ + android/pixit-spp.txt android/pixit-avdtp.txt \ + android/pixit-gavdp.txt android/pixit-sdp.txt \ + android/pixit-bnep.txt android/pts-rfcomm.txt \ + android/pts-spp.txt android/pts-l2cap.txt android/pts-gap.txt \ + android/pts-did.txt android/pts-hid.txt android/pts-pan.txt \ + android/pts-opp.txt android/pts-map.txt android/pts-a2dp.txt \ + android/pts-avrcp.txt android/pts-avctp.txt \ + android/pts-pbap.txt android/pts-hfp.txt android/pts-gatt.txt \ + android/pts-hsp.txt android/pts-iopt.txt android/pts-hdp.txt \ + android/pts-mcap.txt android/pts-mps.txt android/pts-sm.txt \ + android/pts-hogp.txt android/pts-scpp.txt android/pts-dis.txt \ + android/pts-avdtp.txt android/pts-gavdp.txt \ + android/pts-sdp.txt android/pts-bnep.txt tools/hid2hci.rules \ + $(test_scripts) doc/assigned-numbers.txt \ + doc/supported-features.txt doc/test-coverage.txt \ + doc/test-runner.txt doc/settings-storage.txt doc/mgmt-api.txt \ + doc/adapter-api.txt doc/device-api.txt doc/agent-api.txt \ + doc/profile-api.txt doc/network-api.txt doc/media-api.txt \ + doc/health-api.txt doc/sap-api.txt doc/input-api.txt \ + doc/alert-api.txt doc/proximity-api.txt doc/heartrate-api.txt \ + doc/thermometer-api.txt doc/cyclingspeed-api.txt \ + doc/gatt-api.txt doc/advertising-api.txt doc/obex-api.txt \ + doc/obex-agent-api.txt doc/pics-opp.txt doc/pixit-opp.txt \ + doc/pts-opp.txt doc/btsnoop.txt tools/magic.btsnoop \ + $(manual_pages:.1=.txt) +include_HEADERS = $(am__append_1) +AM_CFLAGS = $(WARNING_CFLAGS) $(MISC_CFLAGS) $(am__append_30) \ + @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(am__empty) +AM_LDFLAGS = $(MISC_LDFLAGS) +@DATAFILES_TRUE@dbusdir = @DBUS_CONFDIR@/dbus-1/system.d +@DATAFILES_TRUE@dbus_DATA = src/bluetooth.conf +@DATAFILES_TRUE@confdir = $(sysconfdir)/bluetooth +@DATAFILES_TRUE@conf_DATA = +@DATAFILES_TRUE@statedir = $(localstatedir)/lib/bluetooth +@DATAFILES_TRUE@state_DATA = +@SYSTEMD_TRUE@systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@ +@SYSTEMD_TRUE@systemdsystemunit_DATA = src/bluetooth.service +@SYSTEMD_TRUE@dbussystembusdir = @DBUS_SYSTEMBUSDIR@ +@SYSTEMD_TRUE@dbussystembus_DATA = src/org.bluez.service +plugindir = $(libdir)/bluetooth/plugins +@MAINTAINER_MODE_FALSE@build_plugindir = $(plugindir) +@MAINTAINER_MODE_TRUE@build_plugindir = $(abs_top_srcdir)/plugins/.libs +plugin_LTLIBRARIES = $(am__append_10) $(am__append_11) \ + $(am__append_32) +lib_sources = lib/bluetooth.c lib/hci.c lib/sdp.c +lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \ + lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \ + lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h + +extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h +extra_sources = lib/uuid.c +local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file))) +BUILT_SOURCES = $(local_headers) src/builtin.h obexd/src/builtin.h +@LIBRARY_TRUE@lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources) +@LIBRARY_TRUE@lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 21:14:18 +@LIBRARY_TRUE@lib_libbluetooth_la_DEPENDENCIES = $(local_headers) +lib_libbluetooth_internal_la_SOURCES = $(lib_headers) $(lib_sources) \ + $(extra_headers) $(extra_sources) + +gdbus_libgdbus_internal_la_SOURCES = gdbus/gdbus.h \ + gdbus/mainloop.c gdbus/watch.c \ + gdbus/object.c gdbus/client.c gdbus/polkit.c + +shared_sources = src/shared/io.h src/shared/timeout.h \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/ecc.h src/shared/ecc.c \ + src/shared/ringbuf.h src/shared/ringbuf.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/hci.h src/shared/hci.c \ + src/shared/hci-crypto.h src/shared/hci-crypto.c \ + src/shared/hfp.h src/shared/hfp.c \ + src/shared/uhid.h src/shared/uhid.c \ + src/shared/pcap.h src/shared/pcap.c \ + src/shared/btsnoop.h src/shared/btsnoop.c \ + src/shared/ad.h src/shared/ad.c \ + src/shared/att-types.h \ + src/shared/att.h src/shared/att.c \ + src/shared/gatt-helpers.h src/shared/gatt-helpers.c \ + src/shared/gatt-client.h src/shared/gatt-client.c \ + src/shared/gatt-server.h src/shared/gatt-server.c \ + src/shared/gatt-db.h src/shared/gatt-db.c \ + src/shared/gap.h src/shared/gap.c \ + src/shared/tty.h + +src_libshared_glib_la_SOURCES = $(shared_sources) \ + src/shared/io-glib.c \ + src/shared/timeout-glib.c + +src_libshared_mainloop_la_SOURCES = $(shared_sources) \ + src/shared/io-mainloop.c \ + src/shared/timeout-mainloop.c \ + src/shared/mainloop.h src/shared/mainloop.c + +attrib_sources = attrib/att.h attrib/att-database.h attrib/att.c \ + attrib/gatt.h attrib/gatt.c \ + attrib/gattrib.h attrib/gattrib.c \ + attrib/gatt-service.h attrib/gatt-service.c + +btio_sources = btio/btio.h btio/btio.c +gobex_sources = gobex/gobex.h gobex/gobex.c \ + gobex/gobex-defs.h gobex/gobex-defs.c \ + gobex/gobex-packet.c gobex/gobex-packet.h \ + gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h + +builtin_modules = hostname wiimote autopair policy $(am__append_3) \ + $(am__append_5) a2dp avrcp network input hog $(am__append_8) \ + gap scanparam deviceinfo +builtin_sources = plugins/hostname.c plugins/wiimote.c \ + plugins/autopair.c plugins/policy.c $(am__append_4) \ + $(am__append_6) profiles/audio/source.h \ + profiles/audio/source.c profiles/audio/sink.h \ + profiles/audio/sink.c profiles/audio/a2dp.h \ + profiles/audio/a2dp.c profiles/audio/avdtp.h \ + profiles/audio/avdtp.c profiles/audio/media.h \ + profiles/audio/media.c profiles/audio/transport.h \ + profiles/audio/transport.c profiles/audio/a2dp-codecs.h \ + profiles/audio/control.h profiles/audio/control.c \ + profiles/audio/avctp.h profiles/audio/avctp.c \ + profiles/audio/avrcp.h profiles/audio/avrcp.c \ + profiles/audio/player.h profiles/audio/player.c \ + profiles/network/manager.c profiles/network/bnep.h \ + profiles/network/bnep.c profiles/network/server.h \ + profiles/network/server.c profiles/network/connection.h \ + profiles/network/connection.c profiles/input/manager.c \ + profiles/input/server.h profiles/input/server.c \ + profiles/input/device.h profiles/input/device.c \ + profiles/input/hidp_defs.h profiles/input/hog.c \ + profiles/input/uhid_copy.h profiles/input/hog-lib.c \ + profiles/input/hog-lib.h profiles/deviceinfo/dis.c \ + profiles/deviceinfo/dis.h profiles/battery/bas.c \ + profiles/battery/bas.h profiles/scanparam/scpp.c \ + profiles/scanparam/scpp.h profiles/input/suspend.h \ + profiles/input/suspend-none.c $(am__append_9) \ + profiles/gap/gas.c profiles/scanparam/scan.c \ + profiles/deviceinfo/deviceinfo.c +builtin_nodist = +@EXPERIMENTAL_TRUE@profiles_sap_libsap_a_SOURCES = profiles/sap/sap.h profiles/sap/sap-u8500.c +@SIXAXIS_TRUE@plugins_sixaxis_la_SOURCES = plugins/sixaxis.c +@SIXAXIS_TRUE@plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@SIXAXIS_TRUE@ -no-undefined @UDEV_LIBS@ + +@SIXAXIS_TRUE@plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @UDEV_CFLAGS@ +@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_SOURCES = plugins/external-dummy.c +@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@MAINTAINER_MODE_TRUE@ -no-undefined + +@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden +src_bluetoothd_SOURCES = $(builtin_sources) \ + $(attrib_sources) $(btio_sources) \ + src/bluetooth.ver \ + src/main.c src/log.h src/log.c \ + src/backtrace.h src/backtrace.c \ + src/systemd.h src/systemd.c \ + src/rfkill.c src/hcid.h src/sdpd.h \ + src/sdpd-server.c src/sdpd-request.c \ + src/sdpd-service.c src/sdpd-database.c \ + src/attrib-server.h src/attrib-server.c \ + src/gatt-database.h src/gatt-database.c \ + src/sdp-xml.h src/sdp-xml.c \ + src/sdp-client.h src/sdp-client.c \ + src/textfile.h src/textfile.c \ + src/uuid-helper.h src/uuid-helper.c \ + src/uinput.h \ + src/plugin.h src/plugin.c \ + src/storage.h src/storage.c \ + src/advertising.h src/advertising.c \ + src/agent.h src/agent.c \ + src/error.h src/error.c \ + src/adapter.h src/adapter.c \ + src/profile.h src/profile.c \ + src/service.h src/service.c \ + src/gatt-client.h src/gatt-client.c \ + src/device.h src/device.c \ + src/dbus-common.c src/dbus-common.h \ + src/eir.h src/eir.c + +src_bluetoothd_LDADD = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la \ + src/libshared-glib.la \ + @BACKTRACE_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt + +src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \ + -Wl,--version-script=$(srcdir)/src/bluetooth.ver + +src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la \ + src/libshared-glib.la \ + src/bluetooth.service + +src_bluetoothd_CFLAGS = $(AM_CFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \ + -DPLUGINDIR=\""$(build_plugindir)"\" + +src_bluetoothd_SHORTNAME = bluetoothd +builtin_files = src/builtin.h $(builtin_nodist) +nodist_src_bluetoothd_SOURCES = $(builtin_files) +man_MANS = src/bluetoothd.8 +test_scripts = test/sap_client.py test/bluezutils.py test/dbusdef.py \ + test/monitor-bluetooth test/list-devices test/test-discovery \ + test/test-manager test/test-adapter test/test-device \ + test/simple-agent test/simple-endpoint test/test-sap-server \ + test/test-proximity test/test-network test/test-thermometer \ + test/test-profile test/test-health test/test-health-sink \ + test/service-record.dtd test/service-did.xml \ + test/service-spp.xml test/service-opp.xml test/service-ftp.xml \ + test/simple-player test/test-nap test/test-heartrate \ + test/test-alert test/test-hfp test/test-cyclingspeed \ + test/opp-client test/ftp-client test/pbap-client \ + test/map-client test/example-advertisement \ + test/example-gatt-server test/example-gatt-client \ + test/test-gatt-profile +unit_tests = $(am__append_33) unit/test-eir unit/test-uuid \ + unit/test-textfile unit/test-crc unit/test-crypto \ + unit/test-ecc unit/test-ringbuf unit/test-queue unit/test-mgmt \ + unit/test-uhid unit/test-sdp unit/test-avdtp unit/test-avctp \ + unit/test-avrcp unit/test-hfp unit/test-gdbus-client \ + unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \ + unit/test-gobex-transfer unit/test-gobex-apparam unit/test-lib \ + unit/test-gatt unit/test-hog unit/test-gattrib +@CLIENT_TRUE@client_bluetoothctl_SOURCES = client/main.c \ +@CLIENT_TRUE@ client/display.h client/display.c \ +@CLIENT_TRUE@ client/agent.h client/agent.c \ +@CLIENT_TRUE@ client/advertising.h \ +@CLIENT_TRUE@ client/advertising.c \ +@CLIENT_TRUE@ client/gatt.h client/gatt.c \ +@CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c + +@CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ +@CLIENT_TRUE@ -lreadline + +@MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ +@MONITOR_TRUE@ monitor/display.h monitor/display.c \ +@MONITOR_TRUE@ monitor/hcidump.h monitor/hcidump.c \ +@MONITOR_TRUE@ monitor/ellisys.h monitor/ellisys.c \ +@MONITOR_TRUE@ monitor/control.h monitor/control.c \ +@MONITOR_TRUE@ monitor/packet.h monitor/packet.c \ +@MONITOR_TRUE@ monitor/vendor.h monitor/vendor.c \ +@MONITOR_TRUE@ monitor/lmp.h monitor/lmp.c \ +@MONITOR_TRUE@ monitor/crc.h monitor/crc.c \ +@MONITOR_TRUE@ monitor/ll.h monitor/ll.c \ +@MONITOR_TRUE@ monitor/l2cap.h monitor/l2cap.c \ +@MONITOR_TRUE@ monitor/sdp.h monitor/sdp.c \ +@MONITOR_TRUE@ monitor/avctp.h monitor/avctp.c \ +@MONITOR_TRUE@ monitor/avdtp.h monitor/avdtp.c \ +@MONITOR_TRUE@ monitor/a2dp.h monitor/a2dp.c \ +@MONITOR_TRUE@ monitor/rfcomm.h monitor/rfcomm.c \ +@MONITOR_TRUE@ monitor/bnep.h monitor/bnep.c \ +@MONITOR_TRUE@ monitor/uuid.h monitor/uuid.c \ +@MONITOR_TRUE@ monitor/hwdb.h monitor/hwdb.c \ +@MONITOR_TRUE@ monitor/keys.h monitor/keys.c \ +@MONITOR_TRUE@ monitor/analyze.h monitor/analyze.c \ +@MONITOR_TRUE@ monitor/intel.h monitor/intel.c \ +@MONITOR_TRUE@ monitor/broadcom.h monitor/broadcom.c \ +@MONITOR_TRUE@ monitor/tty.h + +@MONITOR_TRUE@monitor_btmon_LDADD = lib/libbluetooth-internal.la \ +@MONITOR_TRUE@ src/libshared-mainloop.la @UDEV_LIBS@ + +@EXPERIMENTAL_TRUE@emulator_btvirt_SOURCES = emulator/main.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/serial.h emulator/serial.c \ +@EXPERIMENTAL_TRUE@ emulator/server.h emulator/server.c \ +@EXPERIMENTAL_TRUE@ emulator/vhci.h emulator/vhci.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ emulator/phy.h emulator/phy.c \ +@EXPERIMENTAL_TRUE@ emulator/amp.h emulator/amp.c \ +@EXPERIMENTAL_TRUE@ emulator/le.h emulator/le.c + +@EXPERIMENTAL_TRUE@emulator_btvirt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@emulator_b1ee_SOURCES = emulator/b1ee.c +@EXPERIMENTAL_TRUE@emulator_b1ee_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@emulator_hfp_SOURCES = emulator/hfp.c +@EXPERIMENTAL_TRUE@emulator_hfp_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@peripheral_btsensor_SOURCES = peripheral/main.c \ +@EXPERIMENTAL_TRUE@ peripheral/efivars.h peripheral/efivars.c \ +@EXPERIMENTAL_TRUE@ peripheral/attach.h peripheral/attach.c \ +@EXPERIMENTAL_TRUE@ peripheral/log.h peripheral/log.c \ +@EXPERIMENTAL_TRUE@ peripheral/gap.h peripheral/gap.c \ +@EXPERIMENTAL_TRUE@ peripheral/gatt.h peripheral/gatt.c + +@EXPERIMENTAL_TRUE@peripheral_btsensor_LDADD = src/libshared-mainloop.la \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la + +@EXPERIMENTAL_TRUE@tools_3dsp_SOURCES = tools/3dsp.c monitor/bt.h +@EXPERIMENTAL_TRUE@tools_3dsp_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_mgmt_tester_SOURCES = tools/mgmt-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_mgmt_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@EXPERIMENTAL_TRUE@tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_l2cap_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@EXPERIMENTAL_TRUE@tools_rfcomm_tester_SOURCES = tools/rfcomm-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_rfcomm_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@EXPERIMENTAL_TRUE@tools_bnep_tester_SOURCES = tools/bnep-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_bnep_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@EXPERIMENTAL_TRUE@tools_smp_tester_SOURCES = tools/smp-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_smp_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@EXPERIMENTAL_TRUE@tools_gap_tester_SOURCES = tools/gap-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_gap_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la \ +@EXPERIMENTAL_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ + +@EXPERIMENTAL_TRUE@tools_sco_tester_SOURCES = tools/sco-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_sco_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@EXPERIMENTAL_TRUE@tools_hci_tester_SOURCES = tools/hci-tester.c monitor/bt.h +@EXPERIMENTAL_TRUE@tools_hci_tester_LDADD = src/libshared-glib.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_userchan_tester_SOURCES = tools/userchan-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/hciemu.h emulator/hciemu.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c + +@EXPERIMENTAL_TRUE@tools_userchan_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@TOOLS_TRUE@tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \ +@TOOLS_TRUE@ tools/hciattach_st.c \ +@TOOLS_TRUE@ tools/hciattach_ti.c \ +@TOOLS_TRUE@ tools/hciattach_tialt.c \ +@TOOLS_TRUE@ tools/hciattach_ath3k.c \ +@TOOLS_TRUE@ tools/hciattach_qualcomm.c \ +@TOOLS_TRUE@ tools/hciattach_intel.c \ +@TOOLS_TRUE@ tools/hciattach_bcm43xx.c + +@TOOLS_TRUE@tools_hciattach_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_hciconfig_SOURCES = tools/hciconfig.c tools/csr.h tools/csr.c +@TOOLS_TRUE@tools_hciconfig_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_hcitool_SOURCES = tools/hcitool.c src/oui.h src/oui.c +@TOOLS_TRUE@tools_hcitool_LDADD = lib/libbluetooth-internal.la @UDEV_LIBS@ +@TOOLS_TRUE@tools_hcidump_SOURCES = tools/hcidump.c \ +@TOOLS_TRUE@ tools/parser/parser.h tools/parser/parser.c \ +@TOOLS_TRUE@ tools/parser/lmp.c \ +@TOOLS_TRUE@ tools/parser/hci.c \ +@TOOLS_TRUE@ tools/parser/l2cap.h tools/parser/l2cap.c \ +@TOOLS_TRUE@ tools/parser/amp.c \ +@TOOLS_TRUE@ tools/parser/smp.c \ +@TOOLS_TRUE@ tools/parser/att.c \ +@TOOLS_TRUE@ tools/parser/sdp.h tools/parser/sdp.c \ +@TOOLS_TRUE@ tools/parser/rfcomm.h tools/parser/rfcomm.c \ +@TOOLS_TRUE@ tools/parser/bnep.c \ +@TOOLS_TRUE@ tools/parser/cmtp.c \ +@TOOLS_TRUE@ tools/parser/hidp.c \ +@TOOLS_TRUE@ tools/parser/hcrp.c \ +@TOOLS_TRUE@ tools/parser/avdtp.c \ +@TOOLS_TRUE@ tools/parser/avctp.c \ +@TOOLS_TRUE@ tools/parser/avrcp.c \ +@TOOLS_TRUE@ tools/parser/sap.c \ +@TOOLS_TRUE@ tools/parser/obex.c \ +@TOOLS_TRUE@ tools/parser/capi.c \ +@TOOLS_TRUE@ tools/parser/ppp.c \ +@TOOLS_TRUE@ tools/parser/tcpip.c \ +@TOOLS_TRUE@ tools/parser/ericsson.c \ +@TOOLS_TRUE@ tools/parser/csr.c \ +@TOOLS_TRUE@ tools/parser/bpa.c + +@TOOLS_TRUE@tools_hcidump_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_rfcomm_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_rctest_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_l2test_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_l2ping_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_sdptool_SOURCES = tools/sdptool.c src/sdp-xml.h src/sdp-xml.c +@TOOLS_TRUE@tools_sdptool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@TOOLS_TRUE@tools_ciptool_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_bccmd_SOURCES = tools/bccmd.c tools/csr.h tools/csr.c \ +@TOOLS_TRUE@ tools/csr_hci.c tools/csr_usb.c \ +@TOOLS_TRUE@ tools/csr_h4.c tools/csr_3wire.c \ +@TOOLS_TRUE@ tools/csr_bcsp.c tools/ubcsp.h tools/ubcsp.c + +@TOOLS_TRUE@tools_bccmd_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_bluemoon_SOURCES = tools/bluemoon.c monitor/bt.h +@TOOLS_TRUE@tools_bluemoon_LDADD = src/libshared-mainloop.la +@TOOLS_TRUE@tools_hex2hcd_SOURCES = tools/hex2hcd.c +@TOOLS_TRUE@tools_mpris_proxy_SOURCES = tools/mpris-proxy.c +@TOOLS_TRUE@tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ +@HID2HCI_TRUE@udevdir = @UDEV_DIR@ +@HID2HCI_TRUE@tools_hid2hci_LDADD = @UDEV_LIBS@ +@EXPERIMENTAL_TRUE@tools_bdaddr_SOURCES = tools/bdaddr.c src/oui.h src/oui.c +@EXPERIMENTAL_TRUE@tools_bdaddr_LDADD = lib/libbluetooth-internal.la @UDEV_LIBS@ +@EXPERIMENTAL_TRUE@tools_avinfo_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_avtest_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_scotest_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_amptest_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_hwdb_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h +@EXPERIMENTAL_TRUE@tools_btinfo_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_btattach_SOURCES = tools/btattach.c monitor/bt.h +@EXPERIMENTAL_TRUE@tools_btattach_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_btsnoop_SOURCES = tools/btsnoop.c +@EXPERIMENTAL_TRUE@tools_btsnoop_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_btproxy_SOURCES = tools/btproxy.c monitor/bt.h +@EXPERIMENTAL_TRUE@tools_btproxy_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_btiotest_SOURCES = tools/btiotest.c btio/btio.h btio/btio.c +@EXPERIMENTAL_TRUE@tools_btiotest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_mcaptest_SOURCES = tools/mcaptest.c \ +@EXPERIMENTAL_TRUE@ btio/btio.h btio/btio.c \ +@EXPERIMENTAL_TRUE@ src/log.c src/log.h \ +@EXPERIMENTAL_TRUE@ profiles/health/mcap.h profiles/health/mcap.c + +@EXPERIMENTAL_TRUE@tools_mcaptest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ -lrt +@EXPERIMENTAL_TRUE@tools_bneptest_SOURCES = tools/bneptest.c \ +@EXPERIMENTAL_TRUE@ btio/btio.h btio/btio.c \ +@EXPERIMENTAL_TRUE@ src/log.h src/log.c \ +@EXPERIMENTAL_TRUE@ profiles/network/bnep.h profiles/network/bnep.c + +@EXPERIMENTAL_TRUE@tools_bneptest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_cltest_SOURCES = tools/cltest.c +@EXPERIMENTAL_TRUE@tools_cltest_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_oobtest_SOURCES = tools/oobtest.c +@EXPERIMENTAL_TRUE@tools_oobtest_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_seq2bseq_SOURCES = tools/seq2bseq.c +@EXPERIMENTAL_TRUE@tools_nokfw_SOURCES = tools/nokfw.c +@EXPERIMENTAL_TRUE@tools_create_image_SOURCES = tools/create-image.c +@EXPERIMENTAL_TRUE@tools_eddystone_SOURCES = tools/eddystone.c monitor/bt.h +@EXPERIMENTAL_TRUE@tools_eddystone_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_ibeacon_SOURCES = tools/ibeacon.c monitor/bt.h +@EXPERIMENTAL_TRUE@tools_ibeacon_LDADD = src/libshared-mainloop.la +@EXPERIMENTAL_TRUE@tools_btgatt_client_SOURCES = tools/btgatt-client.c src/uuid-helper.c +@EXPERIMENTAL_TRUE@tools_btgatt_client_LDADD = src/libshared-mainloop.la \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la + +@EXPERIMENTAL_TRUE@tools_btgatt_server_SOURCES = tools/btgatt-server.c src/uuid-helper.c +@EXPERIMENTAL_TRUE@tools_btgatt_server_LDADD = src/libshared-mainloop.la \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la + +@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ +@READLINE_TRUE@ attrib/gattrib.c btio/btio.c \ +@READLINE_TRUE@ attrib/gatttool.h attrib/interactive.c \ +@READLINE_TRUE@ attrib/utils.c src/log.c client/display.c \ +@READLINE_TRUE@ client/display.h + +@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ +@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline + +@READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \ +@READLINE_TRUE@ tools/obex-client-tool.c + +@READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ +@READLINE_TRUE@ @GLIB_LIBS@ -lreadline + +@READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ +@READLINE_TRUE@ tools/obex-server-tool.c + +@READLINE_TRUE@tools_obex_server_tool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@READLINE_TRUE@tools_bluetooth_player_SOURCES = tools/bluetooth-player.c \ +@READLINE_TRUE@ client/display.h client/display.c + +@READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ +@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline + +@READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c \ +@READLINE_TRUE@ client/display.h client/display.c + +@READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la \ +@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline + +@READLINE_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c +@READLINE_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ +@READLINE_TRUE@ -lreadline + +@EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c +@EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la +@EXPERIMENTAL_TRUE@profiles_iap_iapd_SOURCES = profiles/iap/main.c +@EXPERIMENTAL_TRUE@profiles_iap_iapd_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ +@CUPS_TRUE@cupsdir = $(libdir)/cups/backend +@CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \ +@CUPS_TRUE@ profiles/cups/cups.h \ +@CUPS_TRUE@ profiles/cups/sdp.c \ +@CUPS_TRUE@ profiles/cups/spp.c \ +@CUPS_TRUE@ profiles/cups/hcrp.c + +@CUPS_TRUE@profiles_cups_bluetooth_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ \ +@CUPS_TRUE@ lib/libbluetooth-internal.la \ +@CUPS_TRUE@ gdbus/libgdbus-internal.la + +@SYSTEMD_TRUE@systemduserunitdir = @SYSTEMD_USERUNITDIR@ +@SYSTEMD_TRUE@systemduserunit_DATA = obexd/src/obex.service +@SYSTEMD_TRUE@dbussessionbusdir = @DBUS_SESSIONBUSDIR@ +@SYSTEMD_TRUE@dbussessionbus_DATA = obexd/src/org.bluez.obex.service +obex_plugindir = $(libdir)/obex/plugins +obexd_builtin_modules = filesystem bluetooth $(am__append_26) opp ftp \ + $(am__append_28) mas mns +obexd_builtin_sources = obexd/plugins/filesystem.c \ + obexd/plugins/filesystem.h obexd/plugins/bluetooth.c \ + $(am__append_27) obexd/plugins/opp.c obexd/plugins/ftp.c \ + obexd/plugins/ftp.h $(am__append_29) obexd/plugins/mas.c \ + obexd/src/map_ap.h obexd/plugins/messages.h \ + obexd/plugins/messages-dummy.c obexd/client/mns.c \ + obexd/src/map_ap.h obexd/client/map-event.h +obexd_builtin_nodist = +obexd_src_obexd_SOURCES = $(btio_sources) $(gobex_sources) \ + $(obexd_builtin_sources) \ + obexd/src/main.c obexd/src/obexd.h \ + obexd/src/plugin.h obexd/src/plugin.c \ + obexd/src/log.h obexd/src/log.c \ + obexd/src/manager.h obexd/src/manager.c \ + obexd/src/obex.h obexd/src/obex.c obexd/src/obex-priv.h \ + obexd/src/mimetype.h obexd/src/mimetype.c \ + obexd/src/service.h obexd/src/service.c \ + obexd/src/transport.h obexd/src/transport.c \ + obexd/src/server.h obexd/src/server.c \ + obexd/client/manager.h obexd/client/manager.c \ + obexd/client/session.h obexd/client/session.c \ + obexd/client/bluetooth.h obexd/client/bluetooth.c \ + obexd/client/sync.h obexd/client/sync.c \ + obexd/client/pbap.h obexd/client/pbap.c \ + obexd/client/ftp.h obexd/client/ftp.c \ + obexd/client/opp.h obexd/client/opp.c \ + obexd/client/map.h obexd/client/map.c \ + obexd/client/map-event.h obexd/client/map-event.c \ + obexd/client/transfer.h obexd/client/transfer.c \ + obexd/client/transport.h obexd/client/transport.c \ + obexd/client/dbus.h obexd/client/dbus.c \ + obexd/client/driver.h obexd/client/driver.c \ + obexd/src/map_ap.h + +obexd_src_obexd_LDADD = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la \ + @ICAL_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ -ldl + +obexd_src_obexd_LDFLAGS = -Wl,--export-dynamic +obexd_src_obexd_CFLAGS = $(AM_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ \ + @ICAL_CFLAGS@ -DOBEX_PLUGIN_BUILTIN \ + -DPLUGINDIR=\""$(obex_plugindir)"\" \ + -fPIC -D_FILE_OFFSET_BITS=64 + +obexd_src_obexd_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/obexd/src +obexd_src_obexd_SHORTNAME = obexd +obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist) +nodist_obexd_src_obexd_SOURCES = $(obexd_builtin_files) +@ANDROID_TRUE@android_plugindir = $(abs_top_srcdir)/android/.libs +@ANDROID_TRUE@android_system_emulator_SOURCES = android/system-emulator.c +@ANDROID_TRUE@android_system_emulator_LDADD = src/libshared-mainloop.la +@ANDROID_TRUE@android_bluetoothd_snoop_SOURCES = android/bluetoothd-snoop.c src/log.c +@ANDROID_TRUE@android_bluetoothd_snoop_LDADD = src/libshared-mainloop.la @GLIB_LIBS@ +@ANDROID_TRUE@android_bluetoothd_SOURCES = android/main.c \ +@ANDROID_TRUE@ src/log.c \ +@ANDROID_TRUE@ android/hal-msg.h \ +@ANDROID_TRUE@ android/audio-msg.h \ +@ANDROID_TRUE@ android/sco-msg.h \ +@ANDROID_TRUE@ android/utils.h \ +@ANDROID_TRUE@ src/sdpd-database.c src/sdpd-server.c \ +@ANDROID_TRUE@ src/sdpd-service.c src/sdpd-request.c \ +@ANDROID_TRUE@ src/uuid-helper.h src/uuid-helper.c \ +@ANDROID_TRUE@ src/eir.h src/eir.c \ +@ANDROID_TRUE@ android/bluetooth.h android/bluetooth.c \ +@ANDROID_TRUE@ android/hidhost.h android/hidhost.c \ +@ANDROID_TRUE@ profiles/scanparam/scpp.h \ +@ANDROID_TRUE@ profiles/scanparam/scpp.c \ +@ANDROID_TRUE@ profiles/deviceinfo/dis.h \ +@ANDROID_TRUE@ profiles/deviceinfo/dis.c \ +@ANDROID_TRUE@ profiles/battery/bas.h profiles/battery/bas.c \ +@ANDROID_TRUE@ profiles/input/hog-lib.h \ +@ANDROID_TRUE@ profiles/input/hog-lib.c \ +@ANDROID_TRUE@ android/ipc-common.h \ +@ANDROID_TRUE@ android/ipc.h android/ipc.c \ +@ANDROID_TRUE@ android/avdtp.h android/avdtp.c \ +@ANDROID_TRUE@ android/a2dp.h android/a2dp.c \ +@ANDROID_TRUE@ android/a2dp-sink.h android/a2dp-sink.c \ +@ANDROID_TRUE@ android/avctp.h android/avctp.c \ +@ANDROID_TRUE@ android/avrcp.h android/avrcp.c \ +@ANDROID_TRUE@ android/avrcp-lib.h android/avrcp-lib.c \ +@ANDROID_TRUE@ android/socket.h android/socket.c \ +@ANDROID_TRUE@ android/sco.h android/sco.c \ +@ANDROID_TRUE@ android/pan.h android/pan.c \ +@ANDROID_TRUE@ android/handsfree.h android/handsfree.c \ +@ANDROID_TRUE@ android/handsfree-client.c android/handsfree-client.h \ +@ANDROID_TRUE@ android/gatt.h android/gatt.c \ +@ANDROID_TRUE@ android/health.h android/health.c \ +@ANDROID_TRUE@ profiles/health/mcap.h profiles/health/mcap.c \ +@ANDROID_TRUE@ android/map-client.h android/map-client.c \ +@ANDROID_TRUE@ attrib/att.c attrib/att.h \ +@ANDROID_TRUE@ attrib/gatt.c attrib/gatt.h \ +@ANDROID_TRUE@ attrib/gattrib.c attrib/gattrib.h \ +@ANDROID_TRUE@ btio/btio.h btio/btio.c \ +@ANDROID_TRUE@ src/sdp-client.h src/sdp-client.c \ +@ANDROID_TRUE@ profiles/network/bnep.h profiles/network/bnep.c + +@ANDROID_TRUE@android_bluetoothd_LDADD = lib/libbluetooth-internal.la \ +@ANDROID_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@ANDROID_TRUE@android_bluetooth_default_la_SOURCES = android/hal.h android/hal-bluetooth.c \ +@ANDROID_TRUE@ android/hal-socket.c \ +@ANDROID_TRUE@ android/hal-hidhost.c \ +@ANDROID_TRUE@ android/hal-health.c \ +@ANDROID_TRUE@ android/hal-pan.c \ +@ANDROID_TRUE@ android/hal-a2dp.c \ +@ANDROID_TRUE@ android/hal-a2dp-sink.c \ +@ANDROID_TRUE@ android/hal-avrcp.c \ +@ANDROID_TRUE@ android/hal-avrcp-ctrl.c \ +@ANDROID_TRUE@ android/hal-handsfree.c \ +@ANDROID_TRUE@ android/hal-handsfree-client.c \ +@ANDROID_TRUE@ android/hal-gatt.c \ +@ANDROID_TRUE@ android/hal-map-client.c \ +@ANDROID_TRUE@ android/hardware/bluetooth.h \ +@ANDROID_TRUE@ android/hardware/bt_av.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt_client.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt_server.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt_types.h \ +@ANDROID_TRUE@ android/hardware/bt_hf.h \ +@ANDROID_TRUE@ android/hardware/bt_hh.h \ +@ANDROID_TRUE@ android/hardware/bt_hl.h \ +@ANDROID_TRUE@ android/hardware/bt_pan.h \ +@ANDROID_TRUE@ android/hardware/bt_rc.h \ +@ANDROID_TRUE@ android/hardware/bt_sock.h \ +@ANDROID_TRUE@ android/hardware/bt_hf_client.h \ +@ANDROID_TRUE@ android/hardware/bt_mce.h \ +@ANDROID_TRUE@ android/hardware/hardware.h \ +@ANDROID_TRUE@ android/cutils/properties.h \ +@ANDROID_TRUE@ android/ipc-common.h \ +@ANDROID_TRUE@ android/hal-log.h \ +@ANDROID_TRUE@ android/hal-ipc.h android/hal-ipc.c \ +@ANDROID_TRUE@ android/hal-utils.h android/hal-utils.c + +@ANDROID_TRUE@android_bluetooth_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android +@ANDROID_TRUE@android_bluetooth_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@ANDROID_TRUE@ -no-undefined + +@ANDROID_TRUE@android_avdtptest_SOURCES = android/avdtptest.c \ +@ANDROID_TRUE@ src/log.h src/log.c \ +@ANDROID_TRUE@ btio/btio.h btio/btio.c \ +@ANDROID_TRUE@ src/shared/util.h src/shared/util.c \ +@ANDROID_TRUE@ src/shared/queue.h src/shared/queue.c \ +@ANDROID_TRUE@ android/avdtp.h android/avdtp.c + +@ANDROID_TRUE@android_avdtptest_CFLAGS = $(AM_CFLAGS) +@ANDROID_TRUE@android_avdtptest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@ANDROID_TRUE@android_haltest_SOURCES = android/client/haltest.c \ +@ANDROID_TRUE@ android/client/pollhandler.h \ +@ANDROID_TRUE@ android/client/pollhandler.c \ +@ANDROID_TRUE@ android/client/terminal.h \ +@ANDROID_TRUE@ android/client/terminal.c \ +@ANDROID_TRUE@ android/client/history.h \ +@ANDROID_TRUE@ android/client/history.c \ +@ANDROID_TRUE@ android/client/tabcompletion.c \ +@ANDROID_TRUE@ android/client/if-main.h \ +@ANDROID_TRUE@ android/client/if-av.c \ +@ANDROID_TRUE@ android/client/if-av-sink.c \ +@ANDROID_TRUE@ android/client/if-rc.c \ +@ANDROID_TRUE@ android/client/if-rc-ctrl.c \ +@ANDROID_TRUE@ android/client/if-bt.c \ +@ANDROID_TRUE@ android/client/if-gatt.c \ +@ANDROID_TRUE@ android/client/if-hf.c \ +@ANDROID_TRUE@ android/client/if-hf-client.c \ +@ANDROID_TRUE@ android/client/if-hh.c \ +@ANDROID_TRUE@ android/client/if-pan.c \ +@ANDROID_TRUE@ android/client/if-hl.c \ +@ANDROID_TRUE@ android/client/if-sock.c \ +@ANDROID_TRUE@ android/client/if-audio.c \ +@ANDROID_TRUE@ android/client/if-sco.c \ +@ANDROID_TRUE@ android/client/if-mce.c \ +@ANDROID_TRUE@ android/hardware/hardware.c \ +@ANDROID_TRUE@ android/hal-utils.h android/hal-utils.c + +@ANDROID_TRUE@android_haltest_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \ +@ANDROID_TRUE@ -DPLUGINDIR=\""$(android_plugindir)"\" + +@ANDROID_TRUE@android_haltest_LDFLAGS = -pthread -ldl -lm +@ANDROID_TRUE@android_android_tester_SOURCES = emulator/hciemu.h emulator/hciemu.c \ +@ANDROID_TRUE@ emulator/btdev.h emulator/btdev.c \ +@ANDROID_TRUE@ emulator/bthost.h emulator/bthost.c \ +@ANDROID_TRUE@ emulator/smp.c \ +@ANDROID_TRUE@ monitor/rfcomm.h \ +@ANDROID_TRUE@ android/hardware/hardware.c \ +@ANDROID_TRUE@ android/tester-bluetooth.c \ +@ANDROID_TRUE@ android/tester-socket.c \ +@ANDROID_TRUE@ android/tester-hidhost.c \ +@ANDROID_TRUE@ android/tester-pan.c \ +@ANDROID_TRUE@ android/tester-hdp.c \ +@ANDROID_TRUE@ android/tester-a2dp.c \ +@ANDROID_TRUE@ android/tester-avrcp.c \ +@ANDROID_TRUE@ android/tester-gatt.c \ +@ANDROID_TRUE@ android/tester-map-client.c \ +@ANDROID_TRUE@ android/tester-main.h android/tester-main.c + +@ANDROID_TRUE@android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \ +@ANDROID_TRUE@ -DPLUGINDIR=\""$(android_plugindir)"\" + +@ANDROID_TRUE@android_android_tester_LDADD = lib/libbluetooth-internal.la \ +@ANDROID_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@ANDROID_TRUE@android_android_tester_LDFLAGS = -pthread -ldl +@ANDROID_TRUE@android_ipc_tester_SOURCES = emulator/hciemu.h emulator/hciemu.c \ +@ANDROID_TRUE@ emulator/btdev.h emulator/btdev.c \ +@ANDROID_TRUE@ emulator/bthost.h emulator/bthost.c \ +@ANDROID_TRUE@ emulator/smp.c \ +@ANDROID_TRUE@ android/hal-utils.h android/hal-utils.c \ +@ANDROID_TRUE@ android/ipc-common.h android/ipc-tester.c + +@ANDROID_TRUE@android_ipc_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android +@ANDROID_TRUE@android_ipc_tester_LDADD = lib/libbluetooth-internal.la \ +@ANDROID_TRUE@ src/libshared-glib.la @GLIB_LIBS@ + +@ANDROID_TRUE@android_audio_a2dp_default_la_SOURCES = android/audio-msg.h \ +@ANDROID_TRUE@ android/hal-msg.h \ +@ANDROID_TRUE@ android/hal-audio.h \ +@ANDROID_TRUE@ android/hal-audio.c \ +@ANDROID_TRUE@ android/hal-audio-sbc.c \ +@ANDROID_TRUE@ android/hal-audio-aptx.c \ +@ANDROID_TRUE@ android/hardware/audio.h \ +@ANDROID_TRUE@ android/hardware/audio_effect.h \ +@ANDROID_TRUE@ android/hardware/hardware.h \ +@ANDROID_TRUE@ android/system/audio.h + +@ANDROID_TRUE@android_audio_a2dp_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \ +@ANDROID_TRUE@ @SBC_CFLAGS@ + +@ANDROID_TRUE@android_audio_a2dp_default_la_LIBADD = @SBC_LIBS@ +@ANDROID_TRUE@android_audio_a2dp_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@ANDROID_TRUE@ -no-undefined -pthread -lrt + +@ANDROID_TRUE@android_audio_sco_default_la_SOURCES = android/hal-log.h \ +@ANDROID_TRUE@ android/sco-msg.h \ +@ANDROID_TRUE@ android/hal-sco.c \ +@ANDROID_TRUE@ android/hardware/audio.h \ +@ANDROID_TRUE@ android/hardware/audio_effect.h \ +@ANDROID_TRUE@ android/hardware/hardware.h \ +@ANDROID_TRUE@ android/audio_utils/resampler.c \ +@ANDROID_TRUE@ android/audio_utils/resampler.h \ +@ANDROID_TRUE@ android/system/audio.h + +@ANDROID_TRUE@android_audio_sco_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android +@ANDROID_TRUE@android_audio_sco_default_la_LIBADD = @SPEEXDSP_LIBS@ +@ANDROID_TRUE@android_audio_sco_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@ANDROID_TRUE@ -no-undefined -lrt + +@ANDROID_TRUE@android_test_ipc_SOURCES = android/test-ipc.c \ +@ANDROID_TRUE@ src/log.h src/log.c \ +@ANDROID_TRUE@ android/ipc-common.h \ +@ANDROID_TRUE@ android/ipc.c android/ipc.h + +@ANDROID_TRUE@android_test_ipc_LDADD = src/libshared-glib.la @GLIB_LIBS@ +@HID2HCI_TRUE@rulesdir = @UDEV_DIR@/rules.d +@HID2HCI_TRUE@rules_DATA = tools/97-hid2hci.rules +@TEST_TRUE@testdir = $(pkglibdir)/test +@TEST_TRUE@test_SCRIPTS = $(test_scripts) +AM_CPPFLAGS = -I$(builddir)/lib +unit_test_eir_SOURCES = unit/test-eir.c src/eir.c src/uuid-helper.c +unit_test_eir_LDADD = src/libshared-glib.la lib/libbluetooth-internal.la \ + @GLIB_LIBS@ + +unit_test_uuid_SOURCES = unit/test-uuid.c +unit_test_uuid_LDADD = src/libshared-glib.la lib/libbluetooth-internal.la \ + @GLIB_LIBS@ + +unit_test_textfile_SOURCES = unit/test-textfile.c src/textfile.h src/textfile.c +unit_test_textfile_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_crc_SOURCES = unit/test-crc.c monitor/crc.h monitor/crc.c +unit_test_crc_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_crypto_SOURCES = unit/test-crypto.c +unit_test_crypto_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_ecc_SOURCES = unit/test-ecc.c +unit_test_ecc_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_ringbuf_SOURCES = unit/test-ringbuf.c +unit_test_ringbuf_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_queue_SOURCES = unit/test-queue.c +unit_test_queue_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_mgmt_SOURCES = unit/test-mgmt.c +unit_test_mgmt_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_uhid_SOURCES = unit/test-uhid.c +unit_test_uhid_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_sdp_SOURCES = unit/test-sdp.c \ + src/sdpd.h src/sdpd-database.c \ + src/log.h src/log.c \ + src/sdpd-service.c src/sdpd-request.c + +unit_test_sdp_LDADD = lib/libbluetooth-internal.la \ + src/libshared-glib.la @GLIB_LIBS@ + +unit_test_avdtp_SOURCES = unit/test-avdtp.c \ + src/log.h src/log.c \ + android/avdtp.c android/avdtp.h + +unit_test_avdtp_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_avctp_SOURCES = unit/test-avctp.c \ + src/log.h src/log.c \ + android/avctp.c android/avctp.h + +unit_test_avctp_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_avrcp_SOURCES = unit/test-avrcp.c \ + src/log.h src/log.c \ + android/avctp.c android/avctp.h \ + android/avrcp-lib.c android/avrcp-lib.h + +unit_test_avrcp_LDADD = lib/libbluetooth-internal.la \ + src/libshared-glib.la @GLIB_LIBS@ + +unit_test_hfp_SOURCES = unit/test-hfp.c +unit_test_hfp_LDADD = src/libshared-glib.la @GLIB_LIBS@ +unit_test_gdbus_client_SOURCES = unit/test-gdbus-client.c +unit_test_gdbus_client_LDADD = gdbus/libgdbus-internal.la \ + src/libshared-glib.la @GLIB_LIBS@ @DBUS_LIBS@ + +unit_test_gobex_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex.c + +unit_test_gobex_LDADD = @GLIB_LIBS@ +unit_test_gobex_packet_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-packet.c + +unit_test_gobex_packet_LDADD = @GLIB_LIBS@ +unit_test_gobex_header_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-header.c + +unit_test_gobex_header_LDADD = @GLIB_LIBS@ +unit_test_gobex_transfer_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-transfer.c + +unit_test_gobex_transfer_LDADD = @GLIB_LIBS@ +unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-apparam.c + +unit_test_gobex_apparam_LDADD = @GLIB_LIBS@ +unit_test_lib_SOURCES = unit/test-lib.c +unit_test_lib_LDADD = src/libshared-glib.la \ + lib/libbluetooth-internal.la @GLIB_LIBS@ + +unit_test_gatt_SOURCES = unit/test-gatt.c +unit_test_gatt_LDADD = src/libshared-glib.la \ + lib/libbluetooth-internal.la @GLIB_LIBS@ + +unit_test_hog_SOURCES = unit/test-hog.c \ + $(btio_sources) \ + profiles/input/hog-lib.h profiles/input/hog-lib.c \ + profiles/scanparam/scpp.h profiles/scanparam/scpp.c \ + profiles/battery/bas.h profiles/battery/bas.c \ + profiles/deviceinfo/dis.h profiles/deviceinfo/dis.c \ + src/log.h src/log.c \ + attrib/att.h attrib/att.c \ + attrib/gatt.h attrib/gatt.c \ + attrib/gattrib.h attrib/gattrib.c + +unit_test_hog_LDADD = src/libshared-glib.la \ + lib/libbluetooth-internal.la @GLIB_LIBS@ + +unit_test_gattrib_SOURCES = unit/test-gattrib.c attrib/gattrib.c $(btio_sources) src/log.h src/log.c +unit_test_gattrib_LDADD = lib/libbluetooth-internal.la \ + src/libshared-glib.la \ + @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt + +AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69 \ + $(am__append_36) +@VALGRIND_TRUE@LOG_COMPILER = valgrind --error-exitcode=1 --num-callers=30 +@VALGRIND_TRUE@LOG_FLAGS = --trace-children=yes --leak-check=full --show-reachable=no \ +@VALGRIND_TRUE@ --suppressions=$(srcdir)/tools/valgrind.supp --quiet + +pkgconfigdir = $(libdir)/pkgconfig +@LIBRARY_TRUE@pkgconfig_DATA = lib/bluez.pc +manual_pages = doc/btmon.1 +DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \ + --enable-manpages --enable-android \ + --disable-systemd --disable-udev + +DISTCLEANFILES = $(pkgconfig_DATA) $(unit_tests) $(manual_pages) +MAINTAINERCLEANFILES = Makefile.in \ + aclocal.m4 configure config.h.in config.sub config.guess \ + ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver + +SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \ + < $< > $@ + +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.plugins $(srcdir)/Makefile.tools $(srcdir)/Makefile.obexd $(srcdir)/android/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; +$(srcdir)/Makefile.plugins $(srcdir)/Makefile.tools $(srcdir)/Makefile.obexd $(srcdir)/android/Makefile.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +src/bluetoothd.8: $(top_builddir)/config.status $(top_srcdir)/src/bluetoothd.8.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +lib/bluez.pc: $(top_builddir)/config.status $(top_srcdir)/lib/bluez.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +profiles/sap/$(am__dirstamp): + @$(MKDIR_P) profiles/sap + @: > profiles/sap/$(am__dirstamp) +profiles/sap/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/sap/$(DEPDIR) + @: > profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/sap-u8500.$(OBJEXT): profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) + +profiles/sap/libsap.a: $(profiles_sap_libsap_a_OBJECTS) $(profiles_sap_libsap_a_DEPENDENCIES) $(EXTRA_profiles_sap_libsap_a_DEPENDENCIES) profiles/sap/$(am__dirstamp) + $(AM_V_at)-rm -f profiles/sap/libsap.a + $(AM_V_AR)$(profiles_sap_libsap_a_AR) profiles/sap/libsap.a $(profiles_sap_libsap_a_OBJECTS) $(profiles_sap_libsap_a_LIBADD) + $(AM_V_at)$(RANLIB) profiles/sap/libsap.a + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ + } + +uninstall-pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ + done + +clean-pluginLTLIBRARIES: + -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) + @list='$(plugin_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +android/$(am__dirstamp): + @$(MKDIR_P) android + @: > android/$(am__dirstamp) +android/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) android/$(DEPDIR) + @: > android/$(DEPDIR)/$(am__dirstamp) +android/android_audio_a2dp_default_la-hal-audio.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_audio_a2dp_default_la-hal-audio-sbc.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_audio_a2dp_default_la-hal-audio-aptx.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/audio.a2dp.default.la: $(android_audio_a2dp_default_la_OBJECTS) $(android_audio_a2dp_default_la_DEPENDENCIES) $(EXTRA_android_audio_a2dp_default_la_DEPENDENCIES) android/$(am__dirstamp) + $(AM_V_CCLD)$(android_audio_a2dp_default_la_LINK) $(am_android_audio_a2dp_default_la_rpath) $(android_audio_a2dp_default_la_OBJECTS) $(android_audio_a2dp_default_la_LIBADD) $(LIBS) +android/android_audio_sco_default_la-hal-sco.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/audio_utils/$(am__dirstamp): + @$(MKDIR_P) android/audio_utils + @: > android/audio_utils/$(am__dirstamp) +android/audio_utils/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) android/audio_utils/$(DEPDIR) + @: > android/audio_utils/$(DEPDIR)/$(am__dirstamp) +android/audio_utils/android_audio_sco_default_la-resampler.lo: \ + android/audio_utils/$(am__dirstamp) \ + android/audio_utils/$(DEPDIR)/$(am__dirstamp) + +android/audio.sco.default.la: $(android_audio_sco_default_la_OBJECTS) $(android_audio_sco_default_la_DEPENDENCIES) $(EXTRA_android_audio_sco_default_la_DEPENDENCIES) android/$(am__dirstamp) + $(AM_V_CCLD)$(android_audio_sco_default_la_LINK) $(am_android_audio_sco_default_la_rpath) $(android_audio_sco_default_la_OBJECTS) $(android_audio_sco_default_la_LIBADD) $(LIBS) +android/android_bluetooth_default_la-hal-bluetooth.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-socket.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-hidhost.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-health.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-pan.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-a2dp.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-a2dp-sink.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-avrcp.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-avrcp-ctrl.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-handsfree.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-handsfree-client.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-gatt.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-map-client.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-ipc.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-utils.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/bluetooth.default.la: $(android_bluetooth_default_la_OBJECTS) $(android_bluetooth_default_la_DEPENDENCIES) $(EXTRA_android_bluetooth_default_la_DEPENDENCIES) android/$(am__dirstamp) + $(AM_V_CCLD)$(android_bluetooth_default_la_LINK) $(am_android_bluetooth_default_la_rpath) $(android_bluetooth_default_la_OBJECTS) $(android_bluetooth_default_la_LIBADD) $(LIBS) +gdbus/$(am__dirstamp): + @$(MKDIR_P) gdbus + @: > gdbus/$(am__dirstamp) +gdbus/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdbus/$(DEPDIR) + @: > gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/mainloop.lo: gdbus/$(am__dirstamp) \ + gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/watch.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/object.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/client.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/polkit.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) + +gdbus/libgdbus-internal.la: $(gdbus_libgdbus_internal_la_OBJECTS) $(gdbus_libgdbus_internal_la_DEPENDENCIES) $(EXTRA_gdbus_libgdbus_internal_la_DEPENDENCIES) gdbus/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(gdbus_libgdbus_internal_la_OBJECTS) $(gdbus_libgdbus_internal_la_LIBADD) $(LIBS) +lib/$(am__dirstamp): + @$(MKDIR_P) lib + @: > lib/$(am__dirstamp) +lib/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/$(DEPDIR) + @: > lib/$(DEPDIR)/$(am__dirstamp) +lib/bluetooth.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/hci.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/sdp.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/uuid.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) + +lib/libbluetooth-internal.la: $(lib_libbluetooth_internal_la_OBJECTS) $(lib_libbluetooth_internal_la_DEPENDENCIES) $(EXTRA_lib_libbluetooth_internal_la_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(lib_libbluetooth_internal_la_OBJECTS) $(lib_libbluetooth_internal_la_LIBADD) $(LIBS) + +lib/libbluetooth.la: $(lib_libbluetooth_la_OBJECTS) $(lib_libbluetooth_la_DEPENDENCIES) $(EXTRA_lib_libbluetooth_la_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_CCLD)$(lib_libbluetooth_la_LINK) $(am_lib_libbluetooth_la_rpath) $(lib_libbluetooth_la_OBJECTS) $(lib_libbluetooth_la_LIBADD) $(LIBS) +plugins/$(am__dirstamp): + @$(MKDIR_P) plugins + @: > plugins/$(am__dirstamp) +plugins/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) plugins/$(DEPDIR) + @: > plugins/$(DEPDIR)/$(am__dirstamp) +plugins/plugins_external_dummy_la-external-dummy.lo: \ + plugins/$(am__dirstamp) plugins/$(DEPDIR)/$(am__dirstamp) + +plugins/external-dummy.la: $(plugins_external_dummy_la_OBJECTS) $(plugins_external_dummy_la_DEPENDENCIES) $(EXTRA_plugins_external_dummy_la_DEPENDENCIES) plugins/$(am__dirstamp) + $(AM_V_CCLD)$(plugins_external_dummy_la_LINK) $(am_plugins_external_dummy_la_rpath) $(plugins_external_dummy_la_OBJECTS) $(plugins_external_dummy_la_LIBADD) $(LIBS) +plugins/plugins_sixaxis_la-sixaxis.lo: plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) + +plugins/sixaxis.la: $(plugins_sixaxis_la_OBJECTS) $(plugins_sixaxis_la_DEPENDENCIES) $(EXTRA_plugins_sixaxis_la_DEPENDENCIES) plugins/$(am__dirstamp) + $(AM_V_CCLD)$(plugins_sixaxis_la_LINK) $(am_plugins_sixaxis_la_rpath) $(plugins_sixaxis_la_OBJECTS) $(plugins_sixaxis_la_LIBADD) $(LIBS) +src/shared/$(am__dirstamp): + @$(MKDIR_P) src/shared + @: > src/shared/$(am__dirstamp) +src/shared/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/shared/$(DEPDIR) + @: > src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/queue.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/util.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/mgmt.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/crypto.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/ecc.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/ringbuf.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/tester.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/hci.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/hci-crypto.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/hfp.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/uhid.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/pcap.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/btsnoop.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/ad.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/att.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/gatt-helpers.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/gatt-client.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/gatt-server.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/gatt-db.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/gap.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/io-glib.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/timeout-glib.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) + +src/libshared-glib.la: $(src_libshared_glib_la_OBJECTS) $(src_libshared_glib_la_DEPENDENCIES) $(EXTRA_src_libshared_glib_la_DEPENDENCIES) src/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(src_libshared_glib_la_OBJECTS) $(src_libshared_glib_la_LIBADD) $(LIBS) +src/shared/io-mainloop.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/timeout-mainloop.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/mainloop.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +src/libshared-mainloop.la: $(src_libshared_mainloop_la_OBJECTS) $(src_libshared_mainloop_la_DEPENDENCIES) $(EXTRA_src_libshared_mainloop_la_DEPENDENCIES) src/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(src_libshared_mainloop_la_OBJECTS) $(src_libshared_mainloop_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-cupsPROGRAMS: $(cups_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(cups_PROGRAMS)'; test -n "$(cupsdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cupsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cupsdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(cupsdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(cupsdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-cupsPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(cups_PROGRAMS)'; test -n "$(cupsdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(cupsdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(cupsdir)" && rm -f $$files + +clean-cupsPROGRAMS: + @list='$(cups_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files + +clean-libexecPROGRAMS: + @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-udevPROGRAMS: $(udev_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(udev_PROGRAMS)'; test -n "$(udevdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(udevdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(udevdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(udevdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(udevdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-udevPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(udev_PROGRAMS)'; test -n "$(udevdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(udevdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(udevdir)" && rm -f $$files + +clean-udevPROGRAMS: + @list='$(udev_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +emulator/$(am__dirstamp): + @$(MKDIR_P) emulator + @: > emulator/$(am__dirstamp) +emulator/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) emulator/$(DEPDIR) + @: > emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_android_tester-hciemu.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_android_tester-btdev.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_android_tester-bthost.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_android_tester-smp.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +android/hardware/$(am__dirstamp): + @$(MKDIR_P) android/hardware + @: > android/hardware/$(am__dirstamp) +android/hardware/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) android/hardware/$(DEPDIR) + @: > android/hardware/$(DEPDIR)/$(am__dirstamp) +android/hardware/android_android_tester-hardware.$(OBJEXT): \ + android/hardware/$(am__dirstamp) \ + android/hardware/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-bluetooth.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-socket.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-hidhost.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-pan.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-hdp.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-a2dp.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-avrcp.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-gatt.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-map-client.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-tester-main.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/android-tester$(EXEEXT): $(android_android_tester_OBJECTS) $(android_android_tester_DEPENDENCIES) $(EXTRA_android_android_tester_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/android-tester$(EXEEXT) + $(AM_V_CCLD)$(android_android_tester_LINK) $(android_android_tester_OBJECTS) $(android_android_tester_LDADD) $(LIBS) +android/android_avdtptest-avdtptest.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/android_avdtptest-log.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +btio/$(am__dirstamp): + @$(MKDIR_P) btio + @: > btio/$(am__dirstamp) +btio/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) btio/$(DEPDIR) + @: > btio/$(DEPDIR)/$(am__dirstamp) +btio/android_avdtptest-btio.$(OBJEXT): btio/$(am__dirstamp) \ + btio/$(DEPDIR)/$(am__dirstamp) +src/shared/android_avdtptest-util.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_avdtptest-queue.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +android/android_avdtptest-avdtp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/avdtptest$(EXEEXT): $(android_avdtptest_OBJECTS) $(android_avdtptest_DEPENDENCIES) $(EXTRA_android_avdtptest_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/avdtptest$(EXEEXT) + $(AM_V_CCLD)$(android_avdtptest_LINK) $(android_avdtptest_OBJECTS) $(android_avdtptest_LDADD) $(LIBS) +android/main.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +src/log.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-database.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-server.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-service.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-request.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/uuid-helper.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/eir.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +android/bluetooth.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/hidhost.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +profiles/scanparam/$(am__dirstamp): + @$(MKDIR_P) profiles/scanparam + @: > profiles/scanparam/$(am__dirstamp) +profiles/scanparam/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/scanparam/$(DEPDIR) + @: > profiles/scanparam/$(DEPDIR)/$(am__dirstamp) +profiles/scanparam/scpp.$(OBJEXT): profiles/scanparam/$(am__dirstamp) \ + profiles/scanparam/$(DEPDIR)/$(am__dirstamp) +profiles/deviceinfo/$(am__dirstamp): + @$(MKDIR_P) profiles/deviceinfo + @: > profiles/deviceinfo/$(am__dirstamp) +profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/deviceinfo/$(DEPDIR) + @: > profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) +profiles/deviceinfo/dis.$(OBJEXT): \ + profiles/deviceinfo/$(am__dirstamp) \ + profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) +profiles/battery/$(am__dirstamp): + @$(MKDIR_P) profiles/battery + @: > profiles/battery/$(am__dirstamp) +profiles/battery/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/battery/$(DEPDIR) + @: > profiles/battery/$(DEPDIR)/$(am__dirstamp) +profiles/battery/bas.$(OBJEXT): profiles/battery/$(am__dirstamp) \ + profiles/battery/$(DEPDIR)/$(am__dirstamp) +profiles/input/$(am__dirstamp): + @$(MKDIR_P) profiles/input + @: > profiles/input/$(am__dirstamp) +profiles/input/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/input/$(DEPDIR) + @: > profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/hog-lib.$(OBJEXT): profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +android/ipc.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avdtp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/a2dp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/a2dp-sink.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avctp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avrcp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avrcp-lib.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/socket.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/sco.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/pan.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/handsfree.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/handsfree-client.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/gatt.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/health.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +profiles/health/$(am__dirstamp): + @$(MKDIR_P) profiles/health + @: > profiles/health/$(am__dirstamp) +profiles/health/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/health/$(DEPDIR) + @: > profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/mcap.$(OBJEXT): profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +android/map-client.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +attrib/$(am__dirstamp): + @$(MKDIR_P) attrib + @: > attrib/$(am__dirstamp) +attrib/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) attrib/$(DEPDIR) + @: > attrib/$(DEPDIR)/$(am__dirstamp) +attrib/att.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/gatt.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/gattrib.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +btio/btio.$(OBJEXT): btio/$(am__dirstamp) \ + btio/$(DEPDIR)/$(am__dirstamp) +src/sdp-client.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +profiles/network/$(am__dirstamp): + @$(MKDIR_P) profiles/network + @: > profiles/network/$(am__dirstamp) +profiles/network/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/network/$(DEPDIR) + @: > profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bnep.$(OBJEXT): profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) + +android/bluetoothd$(EXEEXT): $(android_bluetoothd_OBJECTS) $(android_bluetoothd_DEPENDENCIES) $(EXTRA_android_bluetoothd_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/bluetoothd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_bluetoothd_OBJECTS) $(android_bluetoothd_LDADD) $(LIBS) +android/bluetoothd-snoop.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/bluetoothd-snoop$(EXEEXT): $(android_bluetoothd_snoop_OBJECTS) $(android_bluetoothd_snoop_DEPENDENCIES) $(EXTRA_android_bluetoothd_snoop_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/bluetoothd-snoop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_bluetoothd_snoop_OBJECTS) $(android_bluetoothd_snoop_LDADD) $(LIBS) +android/client/$(am__dirstamp): + @$(MKDIR_P) android/client + @: > android/client/$(am__dirstamp) +android/client/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) android/client/$(DEPDIR) + @: > android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-haltest.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-pollhandler.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-terminal.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-history.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-tabcompletion.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-av.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-av-sink.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-rc.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-rc-ctrl.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-bt.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-gatt.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-hf.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-hf-client.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-hh.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-pan.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-hl.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-sock.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-audio.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-sco.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-mce.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/hardware/android_haltest-hardware.$(OBJEXT): \ + android/hardware/$(am__dirstamp) \ + android/hardware/$(DEPDIR)/$(am__dirstamp) +android/android_haltest-hal-utils.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/haltest$(EXEEXT): $(android_haltest_OBJECTS) $(android_haltest_DEPENDENCIES) $(EXTRA_android_haltest_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/haltest$(EXEEXT) + $(AM_V_CCLD)$(android_haltest_LINK) $(android_haltest_OBJECTS) $(android_haltest_LDADD) $(LIBS) +emulator/android_ipc_tester-hciemu.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_ipc_tester-btdev.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_ipc_tester-bthost.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_ipc_tester-smp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +android/android_ipc_tester-hal-utils.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_ipc_tester-ipc-tester.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/ipc-tester$(EXEEXT): $(android_ipc_tester_OBJECTS) $(android_ipc_tester_DEPENDENCIES) $(EXTRA_android_ipc_tester_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/ipc-tester$(EXEEXT) + $(AM_V_CCLD)$(android_ipc_tester_LINK) $(android_ipc_tester_OBJECTS) $(android_ipc_tester_LDADD) $(LIBS) +android/system-emulator.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/system-emulator$(EXEEXT): $(android_system_emulator_OBJECTS) $(android_system_emulator_DEPENDENCIES) $(EXTRA_android_system_emulator_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/system-emulator$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_system_emulator_OBJECTS) $(android_system_emulator_LDADD) $(LIBS) +android/test-ipc.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/test-ipc$(EXEEXT): $(android_test_ipc_OBJECTS) $(android_test_ipc_DEPENDENCIES) $(EXTRA_android_test_ipc_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/test-ipc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_test_ipc_OBJECTS) $(android_test_ipc_LDADD) $(LIBS) +attrib/gatttool.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/interactive.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/utils.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +client/$(am__dirstamp): + @$(MKDIR_P) client + @: > client/$(am__dirstamp) +client/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) client/$(DEPDIR) + @: > client/$(DEPDIR)/$(am__dirstamp) +client/display.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) + +attrib/gatttool$(EXEEXT): $(attrib_gatttool_OBJECTS) $(attrib_gatttool_DEPENDENCIES) $(EXTRA_attrib_gatttool_DEPENDENCIES) attrib/$(am__dirstamp) + @rm -f attrib/gatttool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attrib_gatttool_OBJECTS) $(attrib_gatttool_LDADD) $(LIBS) +client/main.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) +client/agent.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) +client/advertising.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) +client/gatt.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) +monitor/$(am__dirstamp): + @$(MKDIR_P) monitor + @: > monitor/$(am__dirstamp) +monitor/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) monitor/$(DEPDIR) + @: > monitor/$(DEPDIR)/$(am__dirstamp) +monitor/uuid.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) + +client/bluetoothctl$(EXEEXT): $(client_bluetoothctl_OBJECTS) $(client_bluetoothctl_DEPENDENCIES) $(EXTRA_client_bluetoothctl_DEPENDENCIES) client/$(am__dirstamp) + @rm -f client/bluetoothctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(client_bluetoothctl_OBJECTS) $(client_bluetoothctl_LDADD) $(LIBS) +emulator/b1ee.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) + +emulator/b1ee$(EXEEXT): $(emulator_b1ee_OBJECTS) $(emulator_b1ee_DEPENDENCIES) $(EXTRA_emulator_b1ee_DEPENDENCIES) emulator/$(am__dirstamp) + @rm -f emulator/b1ee$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(emulator_b1ee_OBJECTS) $(emulator_b1ee_LDADD) $(LIBS) +emulator/main.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/serial.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/server.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/vhci.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/btdev.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/bthost.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/smp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/phy.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/amp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/le.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) + +emulator/btvirt$(EXEEXT): $(emulator_btvirt_OBJECTS) $(emulator_btvirt_DEPENDENCIES) $(EXTRA_emulator_btvirt_DEPENDENCIES) emulator/$(am__dirstamp) + @rm -f emulator/btvirt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(emulator_btvirt_OBJECTS) $(emulator_btvirt_LDADD) $(LIBS) +emulator/hfp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) + +emulator/hfp$(EXEEXT): $(emulator_hfp_OBJECTS) $(emulator_hfp_DEPENDENCIES) $(EXTRA_emulator_hfp_DEPENDENCIES) emulator/$(am__dirstamp) + @rm -f emulator/hfp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(emulator_hfp_OBJECTS) $(emulator_hfp_LDADD) $(LIBS) +monitor/main.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/display.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/hcidump.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/ellisys.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/control.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/packet.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/vendor.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/lmp.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/crc.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/ll.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/l2cap.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/sdp.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/avctp.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/avdtp.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/a2dp.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/rfcomm.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/bnep.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/hwdb.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/keys.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/analyze.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/intel.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/broadcom.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) + +monitor/btmon$(EXEEXT): $(monitor_btmon_OBJECTS) $(monitor_btmon_DEPENDENCIES) $(EXTRA_monitor_btmon_DEPENDENCIES) monitor/$(am__dirstamp) + @rm -f monitor/btmon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(monitor_btmon_OBJECTS) $(monitor_btmon_LDADD) $(LIBS) +btio/obexd-btio.$(OBJEXT): btio/$(am__dirstamp) \ + btio/$(DEPDIR)/$(am__dirstamp) +gobex/$(am__dirstamp): + @$(MKDIR_P) gobex + @: > gobex/$(am__dirstamp) +gobex/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gobex/$(DEPDIR) + @: > gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-defs.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-packet.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-header.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-transfer.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-apparam.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/$(am__dirstamp): + @$(MKDIR_P) obexd/plugins + @: > obexd/plugins/$(am__dirstamp) +obexd/plugins/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) obexd/plugins/$(DEPDIR) + @: > obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-filesystem.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-bluetooth.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-pcsuite.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-opp.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-ftp.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-irmc.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-pbap.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-vcard.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-phonebook-dummy.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-mas.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-messages-dummy.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/client/$(am__dirstamp): + @$(MKDIR_P) obexd/client + @: > obexd/client/$(am__dirstamp) +obexd/client/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) obexd/client/$(DEPDIR) + @: > obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-mns.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/src/$(am__dirstamp): + @$(MKDIR_P) obexd/src + @: > obexd/src/$(am__dirstamp) +obexd/src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) obexd/src/$(DEPDIR) + @: > obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-main.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-plugin.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-log.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-manager.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-obex.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-mimetype.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-service.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-transport.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-server.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-manager.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-session.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-bluetooth.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-sync.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-pbap.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-ftp.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-opp.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-map.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-map-event.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-transfer.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-transport.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-dbus.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-driver.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) + +obexd/src/obexd$(EXEEXT): $(obexd_src_obexd_OBJECTS) $(obexd_src_obexd_DEPENDENCIES) $(EXTRA_obexd_src_obexd_DEPENDENCIES) obexd/src/$(am__dirstamp) + @rm -f obexd/src/obexd$(EXEEXT) + $(AM_V_CCLD)$(obexd_src_obexd_LINK) $(obexd_src_obexd_OBJECTS) $(obexd_src_obexd_LDADD) $(LIBS) +peripheral/$(am__dirstamp): + @$(MKDIR_P) peripheral + @: > peripheral/$(am__dirstamp) +peripheral/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) peripheral/$(DEPDIR) + @: > peripheral/$(DEPDIR)/$(am__dirstamp) +peripheral/main.$(OBJEXT): peripheral/$(am__dirstamp) \ + peripheral/$(DEPDIR)/$(am__dirstamp) +peripheral/efivars.$(OBJEXT): peripheral/$(am__dirstamp) \ + peripheral/$(DEPDIR)/$(am__dirstamp) +peripheral/attach.$(OBJEXT): peripheral/$(am__dirstamp) \ + peripheral/$(DEPDIR)/$(am__dirstamp) +peripheral/log.$(OBJEXT): peripheral/$(am__dirstamp) \ + peripheral/$(DEPDIR)/$(am__dirstamp) +peripheral/gap.$(OBJEXT): peripheral/$(am__dirstamp) \ + peripheral/$(DEPDIR)/$(am__dirstamp) +peripheral/gatt.$(OBJEXT): peripheral/$(am__dirstamp) \ + peripheral/$(DEPDIR)/$(am__dirstamp) + +peripheral/btsensor$(EXEEXT): $(peripheral_btsensor_OBJECTS) $(peripheral_btsensor_DEPENDENCIES) $(EXTRA_peripheral_btsensor_DEPENDENCIES) peripheral/$(am__dirstamp) + @rm -f peripheral/btsensor$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(peripheral_btsensor_OBJECTS) $(peripheral_btsensor_LDADD) $(LIBS) +profiles/cups/$(am__dirstamp): + @$(MKDIR_P) profiles/cups + @: > profiles/cups/$(am__dirstamp) +profiles/cups/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/cups/$(DEPDIR) + @: > profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/main.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/sdp.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/spp.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/hcrp.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) + +profiles/cups/bluetooth$(EXEEXT): $(profiles_cups_bluetooth_OBJECTS) $(profiles_cups_bluetooth_DEPENDENCIES) $(EXTRA_profiles_cups_bluetooth_DEPENDENCIES) profiles/cups/$(am__dirstamp) + @rm -f profiles/cups/bluetooth$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(profiles_cups_bluetooth_OBJECTS) $(profiles_cups_bluetooth_LDADD) $(LIBS) +profiles/iap/$(am__dirstamp): + @$(MKDIR_P) profiles/iap + @: > profiles/iap/$(am__dirstamp) +profiles/iap/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/iap/$(DEPDIR) + @: > profiles/iap/$(DEPDIR)/$(am__dirstamp) +profiles/iap/main.$(OBJEXT): profiles/iap/$(am__dirstamp) \ + profiles/iap/$(DEPDIR)/$(am__dirstamp) + +profiles/iap/iapd$(EXEEXT): $(profiles_iap_iapd_OBJECTS) $(profiles_iap_iapd_DEPENDENCIES) $(EXTRA_profiles_iap_iapd_DEPENDENCIES) profiles/iap/$(am__dirstamp) + @rm -f profiles/iap/iapd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(profiles_iap_iapd_OBJECTS) $(profiles_iap_iapd_LDADD) $(LIBS) +plugins/bluetoothd-hostname.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-wiimote.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-autopair.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-policy.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-gatt-example.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-neard.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-main.$(OBJEXT): profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-manager.$(OBJEXT): \ + profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-server.$(OBJEXT): \ + profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-sap-dummy.$(OBJEXT): \ + profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/audio/$(am__dirstamp): + @$(MKDIR_P) profiles/audio + @: > profiles/audio/$(am__dirstamp) +profiles/audio/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/audio/$(DEPDIR) + @: > profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-source.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-sink.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-a2dp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-avdtp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-media.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-transport.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-control.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-avctp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-avrcp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-player.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-manager.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-bnep.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-server.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-connection.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-manager.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-server.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-device.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-hog.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-hog-lib.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/deviceinfo/bluetoothd-dis.$(OBJEXT): \ + profiles/deviceinfo/$(am__dirstamp) \ + profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) +profiles/battery/bluetoothd-bas.$(OBJEXT): \ + profiles/battery/$(am__dirstamp) \ + profiles/battery/$(DEPDIR)/$(am__dirstamp) +profiles/scanparam/bluetoothd-scpp.$(OBJEXT): \ + profiles/scanparam/$(am__dirstamp) \ + profiles/scanparam/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-suspend-none.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-mcap.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp_main.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp_manager.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp_util.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/gap/$(am__dirstamp): + @$(MKDIR_P) profiles/gap + @: > profiles/gap/$(am__dirstamp) +profiles/gap/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/gap/$(DEPDIR) + @: > profiles/gap/$(DEPDIR)/$(am__dirstamp) +profiles/gap/bluetoothd-gas.$(OBJEXT): profiles/gap/$(am__dirstamp) \ + profiles/gap/$(DEPDIR)/$(am__dirstamp) +profiles/scanparam/bluetoothd-scan.$(OBJEXT): \ + profiles/scanparam/$(am__dirstamp) \ + profiles/scanparam/$(DEPDIR)/$(am__dirstamp) +profiles/deviceinfo/bluetoothd-deviceinfo.$(OBJEXT): \ + profiles/deviceinfo/$(am__dirstamp) \ + profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-att.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-gatt.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-gattrib.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-gatt-service.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +btio/bluetoothd-btio.$(OBJEXT): btio/$(am__dirstamp) \ + btio/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-main.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-log.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-backtrace.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-systemd.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-rfkill.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-server.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-request.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-service.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-database.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-attrib-server.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-gatt-database.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdp-xml.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdp-client.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-textfile.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-uuid-helper.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-plugin.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-storage.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-advertising.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-agent.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-error.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-adapter.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-profile.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-service.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-gatt-client.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-device.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-dbus-common.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-eir.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +src/bluetoothd$(EXEEXT): $(src_bluetoothd_OBJECTS) $(src_bluetoothd_DEPENDENCIES) $(EXTRA_src_bluetoothd_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/bluetoothd$(EXEEXT) + $(AM_V_CCLD)$(src_bluetoothd_LINK) $(src_bluetoothd_OBJECTS) $(src_bluetoothd_LDADD) $(LIBS) +tools/$(am__dirstamp): + @$(MKDIR_P) tools + @: > tools/$(am__dirstamp) +tools/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) tools/$(DEPDIR) + @: > tools/$(DEPDIR)/$(am__dirstamp) +tools/3dsp.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/3dsp$(EXEEXT): $(tools_3dsp_OBJECTS) $(tools_3dsp_DEPENDENCIES) $(EXTRA_tools_3dsp_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/3dsp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_3dsp_OBJECTS) $(tools_3dsp_LDADD) $(LIBS) +tools/amptest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/amptest$(EXEEXT): $(tools_amptest_OBJECTS) $(tools_amptest_DEPENDENCIES) $(EXTRA_tools_amptest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/amptest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_amptest_OBJECTS) $(tools_amptest_LDADD) $(LIBS) +tools/avinfo.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/avinfo$(EXEEXT): $(tools_avinfo_OBJECTS) $(tools_avinfo_DEPENDENCIES) $(EXTRA_tools_avinfo_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/avinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_avinfo_OBJECTS) $(tools_avinfo_LDADD) $(LIBS) +tools/avtest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/avtest$(EXEEXT): $(tools_avtest_OBJECTS) $(tools_avtest_DEPENDENCIES) $(EXTRA_tools_avtest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/avtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_avtest_OBJECTS) $(tools_avtest_LDADD) $(LIBS) +tools/bccmd.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_hci.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_usb.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_h4.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_3wire.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_bcsp.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/ubcsp.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/bccmd$(EXEEXT): $(tools_bccmd_OBJECTS) $(tools_bccmd_DEPENDENCIES) $(EXTRA_tools_bccmd_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bccmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bccmd_OBJECTS) $(tools_bccmd_LDADD) $(LIBS) +tools/bdaddr.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +src/oui.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +tools/bdaddr$(EXEEXT): $(tools_bdaddr_OBJECTS) $(tools_bdaddr_DEPENDENCIES) $(EXTRA_tools_bdaddr_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bdaddr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bdaddr_OBJECTS) $(tools_bdaddr_LDADD) $(LIBS) +tools/bluemoon.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/bluemoon$(EXEEXT): $(tools_bluemoon_OBJECTS) $(tools_bluemoon_DEPENDENCIES) $(EXTRA_tools_bluemoon_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bluemoon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bluemoon_OBJECTS) $(tools_bluemoon_LDADD) $(LIBS) +tools/bluetooth-player.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/bluetooth-player$(EXEEXT): $(tools_bluetooth_player_OBJECTS) $(tools_bluetooth_player_DEPENDENCIES) $(EXTRA_tools_bluetooth_player_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bluetooth-player$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bluetooth_player_OBJECTS) $(tools_bluetooth_player_LDADD) $(LIBS) +tools/bnep-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +emulator/hciemu.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) + +tools/bnep-tester$(EXEEXT): $(tools_bnep_tester_OBJECTS) $(tools_bnep_tester_DEPENDENCIES) $(EXTRA_tools_bnep_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bnep-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bnep_tester_OBJECTS) $(tools_bnep_tester_LDADD) $(LIBS) +tools/bneptest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/bneptest$(EXEEXT): $(tools_bneptest_OBJECTS) $(tools_bneptest_DEPENDENCIES) $(EXTRA_tools_bneptest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bneptest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bneptest_OBJECTS) $(tools_bneptest_LDADD) $(LIBS) +tools/btattach.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btattach$(EXEEXT): $(tools_btattach_OBJECTS) $(tools_btattach_DEPENDENCIES) $(EXTRA_tools_btattach_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btattach$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btattach_OBJECTS) $(tools_btattach_LDADD) $(LIBS) +tools/btgatt-client.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btgatt-client$(EXEEXT): $(tools_btgatt_client_OBJECTS) $(tools_btgatt_client_DEPENDENCIES) $(EXTRA_tools_btgatt_client_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btgatt-client$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btgatt_client_OBJECTS) $(tools_btgatt_client_LDADD) $(LIBS) +tools/btgatt-server.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btgatt-server$(EXEEXT): $(tools_btgatt_server_OBJECTS) $(tools_btgatt_server_DEPENDENCIES) $(EXTRA_tools_btgatt_server_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btgatt-server$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btgatt_server_OBJECTS) $(tools_btgatt_server_LDADD) $(LIBS) +tools/btinfo.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btinfo$(EXEEXT): $(tools_btinfo_OBJECTS) $(tools_btinfo_DEPENDENCIES) $(EXTRA_tools_btinfo_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btinfo_OBJECTS) $(tools_btinfo_LDADD) $(LIBS) +tools/btiotest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btiotest$(EXEEXT): $(tools_btiotest_OBJECTS) $(tools_btiotest_DEPENDENCIES) $(EXTRA_tools_btiotest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btiotest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btiotest_OBJECTS) $(tools_btiotest_LDADD) $(LIBS) +tools/btmgmt.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btmgmt$(EXEEXT): $(tools_btmgmt_OBJECTS) $(tools_btmgmt_DEPENDENCIES) $(EXTRA_tools_btmgmt_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btmgmt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btmgmt_OBJECTS) $(tools_btmgmt_LDADD) $(LIBS) +tools/btproxy.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btproxy$(EXEEXT): $(tools_btproxy_OBJECTS) $(tools_btproxy_DEPENDENCIES) $(EXTRA_tools_btproxy_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btproxy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btproxy_OBJECTS) $(tools_btproxy_LDADD) $(LIBS) +tools/btsnoop.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btsnoop$(EXEEXT): $(tools_btsnoop_OBJECTS) $(tools_btsnoop_DEPENDENCIES) $(EXTRA_tools_btsnoop_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btsnoop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btsnoop_OBJECTS) $(tools_btsnoop_LDADD) $(LIBS) +tools/check-selftest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/check-selftest$(EXEEXT): $(tools_check_selftest_OBJECTS) $(tools_check_selftest_DEPENDENCIES) $(EXTRA_tools_check_selftest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/check-selftest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_check_selftest_OBJECTS) $(tools_check_selftest_LDADD) $(LIBS) +tools/ciptool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/ciptool$(EXEEXT): $(tools_ciptool_OBJECTS) $(tools_ciptool_DEPENDENCIES) $(EXTRA_tools_ciptool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/ciptool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_ciptool_OBJECTS) $(tools_ciptool_LDADD) $(LIBS) +tools/cltest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/cltest$(EXEEXT): $(tools_cltest_OBJECTS) $(tools_cltest_DEPENDENCIES) $(EXTRA_tools_cltest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/cltest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_cltest_OBJECTS) $(tools_cltest_LDADD) $(LIBS) +tools/create-image.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/create-image$(EXEEXT): $(tools_create_image_OBJECTS) $(tools_create_image_DEPENDENCIES) $(EXTRA_tools_create_image_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/create-image$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_create_image_OBJECTS) $(tools_create_image_LDADD) $(LIBS) +tools/eddystone.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/eddystone$(EXEEXT): $(tools_eddystone_OBJECTS) $(tools_eddystone_DEPENDENCIES) $(EXTRA_tools_eddystone_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/eddystone$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_eddystone_OBJECTS) $(tools_eddystone_LDADD) $(LIBS) +tools/gap-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/gap-tester$(EXEEXT): $(tools_gap_tester_OBJECTS) $(tools_gap_tester_DEPENDENCIES) $(EXTRA_tools_gap_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/gap-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_gap_tester_OBJECTS) $(tools_gap_tester_LDADD) $(LIBS) +tools/gatt-service.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/gatt-service$(EXEEXT): $(tools_gatt_service_OBJECTS) $(tools_gatt_service_DEPENDENCIES) $(EXTRA_tools_gatt_service_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/gatt-service$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_gatt_service_OBJECTS) $(tools_gatt_service_LDADD) $(LIBS) +tools/hci-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hci-tester$(EXEEXT): $(tools_hci_tester_OBJECTS) $(tools_hci_tester_DEPENDENCIES) $(EXTRA_tools_hci_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hci-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hci_tester_OBJECTS) $(tools_hci_tester_LDADD) $(LIBS) +tools/hciattach.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_st.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_ti.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_tialt.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_ath3k.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_qualcomm.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_intel.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_bcm43xx.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hciattach$(EXEEXT): $(tools_hciattach_OBJECTS) $(tools_hciattach_DEPENDENCIES) $(EXTRA_tools_hciattach_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hciattach$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hciattach_OBJECTS) $(tools_hciattach_LDADD) $(LIBS) +tools/hciconfig.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hciconfig$(EXEEXT): $(tools_hciconfig_OBJECTS) $(tools_hciconfig_DEPENDENCIES) $(EXTRA_tools_hciconfig_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hciconfig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hciconfig_OBJECTS) $(tools_hciconfig_LDADD) $(LIBS) +tools/hcidump.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/parser/$(am__dirstamp): + @$(MKDIR_P) tools/parser + @: > tools/parser/$(am__dirstamp) +tools/parser/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) tools/parser/$(DEPDIR) + @: > tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/parser.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/lmp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/hci.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/l2cap.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/amp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/smp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/att.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/sdp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/rfcomm.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/bnep.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/cmtp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/hidp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/hcrp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/avdtp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/avctp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/avrcp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/sap.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/obex.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/capi.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/ppp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/tcpip.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/ericsson.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/csr.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/bpa.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) + +tools/hcidump$(EXEEXT): $(tools_hcidump_OBJECTS) $(tools_hcidump_DEPENDENCIES) $(EXTRA_tools_hcidump_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcidump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcidump_OBJECTS) $(tools_hcidump_LDADD) $(LIBS) +tools/hcieventmask.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hcieventmask$(EXEEXT): $(tools_hcieventmask_OBJECTS) $(tools_hcieventmask_DEPENDENCIES) $(EXTRA_tools_hcieventmask_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcieventmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcieventmask_OBJECTS) $(tools_hcieventmask_LDADD) $(LIBS) +tools/hcisecfilter.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hcisecfilter$(EXEEXT): $(tools_hcisecfilter_OBJECTS) $(tools_hcisecfilter_DEPENDENCIES) $(EXTRA_tools_hcisecfilter_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcisecfilter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcisecfilter_OBJECTS) $(tools_hcisecfilter_LDADD) $(LIBS) +tools/hcitool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hcitool$(EXEEXT): $(tools_hcitool_OBJECTS) $(tools_hcitool_DEPENDENCIES) $(EXTRA_tools_hcitool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcitool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcitool_OBJECTS) $(tools_hcitool_LDADD) $(LIBS) +tools/hex2hcd.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hex2hcd$(EXEEXT): $(tools_hex2hcd_OBJECTS) $(tools_hex2hcd_DEPENDENCIES) $(EXTRA_tools_hex2hcd_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hex2hcd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hex2hcd_OBJECTS) $(tools_hex2hcd_LDADD) $(LIBS) +tools/hid2hci.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hid2hci$(EXEEXT): $(tools_hid2hci_OBJECTS) $(tools_hid2hci_DEPENDENCIES) $(EXTRA_tools_hid2hci_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hid2hci$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hid2hci_OBJECTS) $(tools_hid2hci_LDADD) $(LIBS) +tools/hwdb.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hwdb$(EXEEXT): $(tools_hwdb_OBJECTS) $(tools_hwdb_DEPENDENCIES) $(EXTRA_tools_hwdb_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hwdb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hwdb_OBJECTS) $(tools_hwdb_LDADD) $(LIBS) +tools/ibeacon.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/ibeacon$(EXEEXT): $(tools_ibeacon_OBJECTS) $(tools_ibeacon_DEPENDENCIES) $(EXTRA_tools_ibeacon_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/ibeacon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_ibeacon_OBJECTS) $(tools_ibeacon_LDADD) $(LIBS) +tools/l2cap-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/l2cap-tester$(EXEEXT): $(tools_l2cap_tester_OBJECTS) $(tools_l2cap_tester_DEPENDENCIES) $(EXTRA_tools_l2cap_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/l2cap-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_l2cap_tester_OBJECTS) $(tools_l2cap_tester_LDADD) $(LIBS) +tools/l2ping.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/l2ping$(EXEEXT): $(tools_l2ping_OBJECTS) $(tools_l2ping_DEPENDENCIES) $(EXTRA_tools_l2ping_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/l2ping$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_l2ping_OBJECTS) $(tools_l2ping_LDADD) $(LIBS) +tools/l2test.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/l2test$(EXEEXT): $(tools_l2test_OBJECTS) $(tools_l2test_DEPENDENCIES) $(EXTRA_tools_l2test_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/l2test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_l2test_OBJECTS) $(tools_l2test_LDADD) $(LIBS) +tools/mcaptest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/mcaptest$(EXEEXT): $(tools_mcaptest_OBJECTS) $(tools_mcaptest_DEPENDENCIES) $(EXTRA_tools_mcaptest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/mcaptest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_mcaptest_OBJECTS) $(tools_mcaptest_LDADD) $(LIBS) +tools/mgmt-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/mgmt-tester$(EXEEXT): $(tools_mgmt_tester_OBJECTS) $(tools_mgmt_tester_DEPENDENCIES) $(EXTRA_tools_mgmt_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/mgmt-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_mgmt_tester_OBJECTS) $(tools_mgmt_tester_LDADD) $(LIBS) +tools/mpris-proxy.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/mpris-proxy$(EXEEXT): $(tools_mpris_proxy_OBJECTS) $(tools_mpris_proxy_DEPENDENCIES) $(EXTRA_tools_mpris_proxy_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/mpris-proxy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_mpris_proxy_OBJECTS) $(tools_mpris_proxy_LDADD) $(LIBS) +tools/nokfw.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/nokfw$(EXEEXT): $(tools_nokfw_OBJECTS) $(tools_nokfw_DEPENDENCIES) $(EXTRA_tools_nokfw_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/nokfw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_nokfw_OBJECTS) $(tools_nokfw_LDADD) $(LIBS) +gobex/gobex.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-defs.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-packet.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-header.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-transfer.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-apparam.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +tools/obex-client-tool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/obex-client-tool$(EXEEXT): $(tools_obex_client_tool_OBJECTS) $(tools_obex_client_tool_DEPENDENCIES) $(EXTRA_tools_obex_client_tool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/obex-client-tool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_obex_client_tool_OBJECTS) $(tools_obex_client_tool_LDADD) $(LIBS) +tools/obex-server-tool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/obex-server-tool$(EXEEXT): $(tools_obex_server_tool_OBJECTS) $(tools_obex_server_tool_DEPENDENCIES) $(EXTRA_tools_obex_server_tool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/obex-server-tool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_obex_server_tool_OBJECTS) $(tools_obex_server_tool_LDADD) $(LIBS) +tools/obexctl.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/obexctl$(EXEEXT): $(tools_obexctl_OBJECTS) $(tools_obexctl_DEPENDENCIES) $(EXTRA_tools_obexctl_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/obexctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_obexctl_OBJECTS) $(tools_obexctl_LDADD) $(LIBS) +tools/oobtest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/oobtest$(EXEEXT): $(tools_oobtest_OBJECTS) $(tools_oobtest_DEPENDENCIES) $(EXTRA_tools_oobtest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/oobtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_oobtest_OBJECTS) $(tools_oobtest_LDADD) $(LIBS) +tools/rctest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/rctest$(EXEEXT): $(tools_rctest_OBJECTS) $(tools_rctest_DEPENDENCIES) $(EXTRA_tools_rctest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/rctest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_rctest_OBJECTS) $(tools_rctest_LDADD) $(LIBS) +tools/rfcomm.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/rfcomm$(EXEEXT): $(tools_rfcomm_OBJECTS) $(tools_rfcomm_DEPENDENCIES) $(EXTRA_tools_rfcomm_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/rfcomm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_rfcomm_OBJECTS) $(tools_rfcomm_LDADD) $(LIBS) +tools/rfcomm-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/rfcomm-tester$(EXEEXT): $(tools_rfcomm_tester_OBJECTS) $(tools_rfcomm_tester_DEPENDENCIES) $(EXTRA_tools_rfcomm_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/rfcomm-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_rfcomm_tester_OBJECTS) $(tools_rfcomm_tester_LDADD) $(LIBS) +tools/sco-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/sco-tester$(EXEEXT): $(tools_sco_tester_OBJECTS) $(tools_sco_tester_DEPENDENCIES) $(EXTRA_tools_sco_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/sco-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_sco_tester_OBJECTS) $(tools_sco_tester_LDADD) $(LIBS) +tools/scotest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/scotest$(EXEEXT): $(tools_scotest_OBJECTS) $(tools_scotest_DEPENDENCIES) $(EXTRA_tools_scotest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/scotest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_scotest_OBJECTS) $(tools_scotest_LDADD) $(LIBS) +tools/sdptool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +src/sdp-xml.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +tools/sdptool$(EXEEXT): $(tools_sdptool_OBJECTS) $(tools_sdptool_DEPENDENCIES) $(EXTRA_tools_sdptool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/sdptool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_sdptool_OBJECTS) $(tools_sdptool_LDADD) $(LIBS) +tools/seq2bseq.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/seq2bseq$(EXEEXT): $(tools_seq2bseq_OBJECTS) $(tools_seq2bseq_DEPENDENCIES) $(EXTRA_tools_seq2bseq_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/seq2bseq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_seq2bseq_OBJECTS) $(tools_seq2bseq_LDADD) $(LIBS) +tools/smp-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/smp-tester$(EXEEXT): $(tools_smp_tester_OBJECTS) $(tools_smp_tester_DEPENDENCIES) $(EXTRA_tools_smp_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/smp-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_smp_tester_OBJECTS) $(tools_smp_tester_LDADD) $(LIBS) +tools/test-runner.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/test-runner$(EXEEXT): $(tools_test_runner_OBJECTS) $(tools_test_runner_DEPENDENCIES) $(EXTRA_tools_test_runner_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/test-runner$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_test_runner_OBJECTS) $(tools_test_runner_LDADD) $(LIBS) +tools/userchan-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/userchan-tester$(EXEEXT): $(tools_userchan_tester_OBJECTS) $(tools_userchan_tester_DEPENDENCIES) $(EXTRA_tools_userchan_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/userchan-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_userchan_tester_OBJECTS) $(tools_userchan_tester_LDADD) $(LIBS) +unit/$(am__dirstamp): + @$(MKDIR_P) unit + @: > unit/$(am__dirstamp) +unit/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) unit/$(DEPDIR) + @: > unit/$(DEPDIR)/$(am__dirstamp) +unit/test-avctp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-avctp$(EXEEXT): $(unit_test_avctp_OBJECTS) $(unit_test_avctp_DEPENDENCIES) $(EXTRA_unit_test_avctp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-avctp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_avctp_OBJECTS) $(unit_test_avctp_LDADD) $(LIBS) +unit/test-avdtp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-avdtp$(EXEEXT): $(unit_test_avdtp_OBJECTS) $(unit_test_avdtp_DEPENDENCIES) $(EXTRA_unit_test_avdtp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-avdtp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_avdtp_OBJECTS) $(unit_test_avdtp_LDADD) $(LIBS) +unit/test-avrcp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-avrcp$(EXEEXT): $(unit_test_avrcp_OBJECTS) $(unit_test_avrcp_DEPENDENCIES) $(EXTRA_unit_test_avrcp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-avrcp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_avrcp_OBJECTS) $(unit_test_avrcp_LDADD) $(LIBS) +unit/test-crc.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-crc$(EXEEXT): $(unit_test_crc_OBJECTS) $(unit_test_crc_DEPENDENCIES) $(EXTRA_unit_test_crc_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-crc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_crc_OBJECTS) $(unit_test_crc_LDADD) $(LIBS) +unit/test-crypto.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-crypto$(EXEEXT): $(unit_test_crypto_OBJECTS) $(unit_test_crypto_DEPENDENCIES) $(EXTRA_unit_test_crypto_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-crypto$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_crypto_OBJECTS) $(unit_test_crypto_LDADD) $(LIBS) +unit/test-ecc.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-ecc$(EXEEXT): $(unit_test_ecc_OBJECTS) $(unit_test_ecc_DEPENDENCIES) $(EXTRA_unit_test_ecc_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-ecc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_ecc_OBJECTS) $(unit_test_ecc_LDADD) $(LIBS) +unit/test-eir.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-eir$(EXEEXT): $(unit_test_eir_OBJECTS) $(unit_test_eir_DEPENDENCIES) $(EXTRA_unit_test_eir_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-eir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_eir_OBJECTS) $(unit_test_eir_LDADD) $(LIBS) +unit/test-gatt.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gatt$(EXEEXT): $(unit_test_gatt_OBJECTS) $(unit_test_gatt_DEPENDENCIES) $(EXTRA_unit_test_gatt_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gatt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gatt_OBJECTS) $(unit_test_gatt_LDADD) $(LIBS) +unit/test-gattrib.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gattrib$(EXEEXT): $(unit_test_gattrib_OBJECTS) $(unit_test_gattrib_DEPENDENCIES) $(EXTRA_unit_test_gattrib_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gattrib$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gattrib_OBJECTS) $(unit_test_gattrib_LDADD) $(LIBS) +unit/test-gdbus-client.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gdbus-client$(EXEEXT): $(unit_test_gdbus_client_OBJECTS) $(unit_test_gdbus_client_DEPENDENCIES) $(EXTRA_unit_test_gdbus_client_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gdbus-client$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gdbus_client_OBJECTS) $(unit_test_gdbus_client_LDADD) $(LIBS) +unit/util.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) +unit/test-gobex.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex$(EXEEXT): $(unit_test_gobex_OBJECTS) $(unit_test_gobex_DEPENDENCIES) $(EXTRA_unit_test_gobex_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_OBJECTS) $(unit_test_gobex_LDADD) $(LIBS) +unit/test-gobex-apparam.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-apparam$(EXEEXT): $(unit_test_gobex_apparam_OBJECTS) $(unit_test_gobex_apparam_DEPENDENCIES) $(EXTRA_unit_test_gobex_apparam_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-apparam$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_apparam_OBJECTS) $(unit_test_gobex_apparam_LDADD) $(LIBS) +unit/test-gobex-header.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-header$(EXEEXT): $(unit_test_gobex_header_OBJECTS) $(unit_test_gobex_header_DEPENDENCIES) $(EXTRA_unit_test_gobex_header_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-header$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_header_OBJECTS) $(unit_test_gobex_header_LDADD) $(LIBS) +unit/test-gobex-packet.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-packet$(EXEEXT): $(unit_test_gobex_packet_OBJECTS) $(unit_test_gobex_packet_DEPENDENCIES) $(EXTRA_unit_test_gobex_packet_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-packet$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_packet_OBJECTS) $(unit_test_gobex_packet_LDADD) $(LIBS) +unit/test-gobex-transfer.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-transfer$(EXEEXT): $(unit_test_gobex_transfer_OBJECTS) $(unit_test_gobex_transfer_DEPENDENCIES) $(EXTRA_unit_test_gobex_transfer_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-transfer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_transfer_OBJECTS) $(unit_test_gobex_transfer_LDADD) $(LIBS) +unit/test-hfp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-hfp$(EXEEXT): $(unit_test_hfp_OBJECTS) $(unit_test_hfp_DEPENDENCIES) $(EXTRA_unit_test_hfp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-hfp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_hfp_OBJECTS) $(unit_test_hfp_LDADD) $(LIBS) +unit/test-hog.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-hog$(EXEEXT): $(unit_test_hog_OBJECTS) $(unit_test_hog_DEPENDENCIES) $(EXTRA_unit_test_hog_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-hog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_hog_OBJECTS) $(unit_test_hog_LDADD) $(LIBS) +unit/test-lib.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-lib$(EXEEXT): $(unit_test_lib_OBJECTS) $(unit_test_lib_DEPENDENCIES) $(EXTRA_unit_test_lib_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-lib$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_lib_OBJECTS) $(unit_test_lib_LDADD) $(LIBS) +unit/test-mgmt.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-mgmt$(EXEEXT): $(unit_test_mgmt_OBJECTS) $(unit_test_mgmt_DEPENDENCIES) $(EXTRA_unit_test_mgmt_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-mgmt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_mgmt_OBJECTS) $(unit_test_mgmt_LDADD) $(LIBS) +unit/test-queue.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-queue$(EXEEXT): $(unit_test_queue_OBJECTS) $(unit_test_queue_DEPENDENCIES) $(EXTRA_unit_test_queue_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-queue$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_queue_OBJECTS) $(unit_test_queue_LDADD) $(LIBS) +unit/test-ringbuf.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-ringbuf$(EXEEXT): $(unit_test_ringbuf_OBJECTS) $(unit_test_ringbuf_DEPENDENCIES) $(EXTRA_unit_test_ringbuf_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-ringbuf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_ringbuf_OBJECTS) $(unit_test_ringbuf_LDADD) $(LIBS) +unit/test-sdp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-sdp$(EXEEXT): $(unit_test_sdp_OBJECTS) $(unit_test_sdp_DEPENDENCIES) $(EXTRA_unit_test_sdp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-sdp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_sdp_OBJECTS) $(unit_test_sdp_LDADD) $(LIBS) +unit/test-textfile.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) +src/textfile.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +unit/test-textfile$(EXEEXT): $(unit_test_textfile_OBJECTS) $(unit_test_textfile_DEPENDENCIES) $(EXTRA_unit_test_textfile_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-textfile$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_textfile_OBJECTS) $(unit_test_textfile_LDADD) $(LIBS) +unit/test-uhid.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-uhid$(EXEEXT): $(unit_test_uhid_OBJECTS) $(unit_test_uhid_DEPENDENCIES) $(EXTRA_unit_test_uhid_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-uhid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_uhid_OBJECTS) $(unit_test_uhid_LDADD) $(LIBS) +unit/test-uuid.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-uuid$(EXEEXT): $(unit_test_uuid_OBJECTS) $(unit_test_uuid_DEPENDENCIES) $(EXTRA_unit_test_uuid_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-uuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_uuid_OBJECTS) $(unit_test_uuid_LDADD) $(LIBS) +install-testSCRIPTS: $(test_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(test_SCRIPTS)'; test -n "$(testdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(testdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(testdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(testdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(testdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-testSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(test_SCRIPTS)'; test -n "$(testdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(testdir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f android/*.$(OBJEXT) + -rm -f android/*.lo + -rm -f android/audio_utils/*.$(OBJEXT) + -rm -f android/audio_utils/*.lo + -rm -f android/client/*.$(OBJEXT) + -rm -f android/hardware/*.$(OBJEXT) + -rm -f attrib/*.$(OBJEXT) + -rm -f btio/*.$(OBJEXT) + -rm -f client/*.$(OBJEXT) + -rm -f emulator/*.$(OBJEXT) + -rm -f gdbus/*.$(OBJEXT) + -rm -f gdbus/*.lo + -rm -f gobex/*.$(OBJEXT) + -rm -f lib/*.$(OBJEXT) + -rm -f lib/*.lo + -rm -f monitor/*.$(OBJEXT) + -rm -f obexd/client/*.$(OBJEXT) + -rm -f obexd/plugins/*.$(OBJEXT) + -rm -f obexd/src/*.$(OBJEXT) + -rm -f peripheral/*.$(OBJEXT) + -rm -f plugins/*.$(OBJEXT) + -rm -f plugins/*.lo + -rm -f profiles/audio/*.$(OBJEXT) + -rm -f profiles/battery/*.$(OBJEXT) + -rm -f profiles/cups/*.$(OBJEXT) + -rm -f profiles/deviceinfo/*.$(OBJEXT) + -rm -f profiles/gap/*.$(OBJEXT) + -rm -f profiles/health/*.$(OBJEXT) + -rm -f profiles/iap/*.$(OBJEXT) + -rm -f profiles/input/*.$(OBJEXT) + -rm -f profiles/network/*.$(OBJEXT) + -rm -f profiles/sap/*.$(OBJEXT) + -rm -f profiles/scanparam/*.$(OBJEXT) + -rm -f src/*.$(OBJEXT) + -rm -f src/shared/*.$(OBJEXT) + -rm -f src/shared/*.lo + -rm -f tools/*.$(OBJEXT) + -rm -f tools/parser/*.$(OBJEXT) + -rm -f unit/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/a2dp-sink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/a2dp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-a2dp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-bluetooth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-hdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-hidhost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-map-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-pan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-tester-socket.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-aptx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-sbc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_audio_sco_default_la-hal-sco.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_avdtptest-avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_avdtptest-avdtptest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp-sink.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp-ctrl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree-client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-map-client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_haltest-hal-utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_ipc_tester-hal-utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_ipc_tester-ipc-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avrcp-lib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/bluetooth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/bluetoothd-snoop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/handsfree-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/handsfree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/health.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/hidhost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/map-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/pan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/sco.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/socket.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/system-emulator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/test-ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/audio_utils/$(DEPDIR)/android_audio_sco_default_la-resampler.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-haltest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-history.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-audio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-av-sink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-av.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-bt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-hf-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-hf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-hh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-hl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-mce.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-pan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-rc-ctrl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-rc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-sco.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-sock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-pollhandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-tabcompletion.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-terminal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/hardware/$(DEPDIR)/android_android_tester-hardware.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/hardware/$(DEPDIR)/android_haltest-hardware.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/att.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-att.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-gatt-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-gattrib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/gattrib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/gatttool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/interactive.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@btio/$(DEPDIR)/android_avdtptest-btio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@btio/$(DEPDIR)/bluetoothd-btio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@btio/$(DEPDIR)/btio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@btio/$(DEPDIR)/obexd-btio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/advertising.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/agent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/display.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/amp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_android_tester-btdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_android_tester-bthost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_android_tester-hciemu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_android_tester-smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_ipc_tester-btdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_ipc_tester-bthost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_ipc_tester-hciemu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_ipc_tester-smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/b1ee.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/btdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/bthost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/hciemu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/hfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/le.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/phy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/serial.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/vhci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/mainloop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/object.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/polkit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/watch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-apparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-defs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-header.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-apparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-defs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-header.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bluetooth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hci.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sdp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/uuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/a2dp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/analyze.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/bnep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/broadcom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/crc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/display.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/ellisys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/hcidump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/hwdb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/intel.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/keys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/l2cap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/ll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/lmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/rfcomm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/uuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/vendor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-bluetooth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-dbus.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-driver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-ftp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-map-event.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-map.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-mns.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-opp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-pbap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-session.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-sync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-transport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-filesystem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-ftp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-irmc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-mas.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-opp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-pbap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-vcard.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-mimetype.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-obex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-plugin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-transport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@peripheral/$(DEPDIR)/attach.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@peripheral/$(DEPDIR)/efivars.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@peripheral/$(DEPDIR)/gap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@peripheral/$(DEPDIR)/gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@peripheral/$(DEPDIR)/log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@peripheral/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-autopair.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-gatt-example.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-hostname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-neard.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-policy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-wiimote.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-media.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-player.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-sink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-source.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-transport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/battery/$(DEPDIR)/bas.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/battery/$(DEPDIR)/bluetoothd-bas.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/hcrp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/spp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/deviceinfo/$(DEPDIR)/bluetoothd-dis.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/deviceinfo/$(DEPDIR)/dis.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/gap/$(DEPDIR)/bluetoothd-gas.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-mcap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/mcap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/iap/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-hog-lib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-hog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-suspend-none.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/hog-lib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-bnep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-connection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bnep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/sap-u8500.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/scanparam/$(DEPDIR)/bluetoothd-scpp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/scanparam/$(DEPDIR)/scpp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/android_avdtptest-log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-adapter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-advertising.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-agent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-attrib-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-backtrace.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-dbus-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-eir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-gatt-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-gatt-database.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-plugin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-profile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-rfkill.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdp-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdp-xml.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-database.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-request.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-storage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-systemd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-textfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-uuid-helper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/eir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/oui.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdp-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdp-xml.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-database.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-request.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/textfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/uuid-helper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/ad.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_avdtptest-queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_avdtptest-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/att.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/btsnoop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/crypto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/ecc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/gap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/gatt-client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/gatt-db.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/gatt-helpers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/gatt-server.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hci-crypto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hci.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hfp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/io-glib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/io-mainloop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/mainloop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/mgmt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/pcap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/queue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/ringbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/tester.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/timeout-glib.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/timeout-mainloop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/uhid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/3dsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/amptest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/avinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/avtest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bccmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bdaddr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bluemoon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bluetooth-player.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bnep-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bneptest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btattach.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btgatt-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btgatt-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btiotest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btmgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btproxy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btsnoop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/check-selftest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/ciptool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/cltest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/create-image.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_3wire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_bcsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_h4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_usb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/eddystone.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/gap-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/gatt-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hci-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_ath3k.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_bcm43xx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_intel.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_qualcomm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_st.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_ti.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_tialt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciconfig.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcidump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcieventmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcisecfilter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcitool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hex2hcd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hid2hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hwdb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/ibeacon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/l2cap-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/l2ping.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/l2test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/mcaptest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/mgmt-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/mpris-proxy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/nokfw.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/obex-client-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/obex-server-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/obexctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/oobtest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rctest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rfcomm-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rfcomm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/sco-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/scotest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/sdptool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/seq2bseq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/smp-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/test-runner.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/ubcsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/userchan-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/amp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/att.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/bnep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/bpa.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/capi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/cmtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/csr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/ericsson.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/hcrp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/hidp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/l2cap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/lmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/obex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/ppp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/rfcomm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/sap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/tcpip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-crc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-crypto.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-ecc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-eir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gattrib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gdbus-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-apparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-header.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-hfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-hog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-lib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-mgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-ringbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-textfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-uhid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-uuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/util.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +android/android_audio_a2dp_default_la-hal-audio.lo: android/hal-audio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -MT android/android_audio_a2dp_default_la-hal-audio.lo -MD -MP -MF android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Tpo -c -o android/android_audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Tpo android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-audio.c' object='android/android_audio_a2dp_default_la-hal-audio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -c -o android/android_audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c + +android/android_audio_a2dp_default_la-hal-audio-sbc.lo: android/hal-audio-sbc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -MT android/android_audio_a2dp_default_la-hal-audio-sbc.lo -MD -MP -MF android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-sbc.Tpo -c -o android/android_audio_a2dp_default_la-hal-audio-sbc.lo `test -f 'android/hal-audio-sbc.c' || echo '$(srcdir)/'`android/hal-audio-sbc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-sbc.Tpo android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-sbc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-audio-sbc.c' object='android/android_audio_a2dp_default_la-hal-audio-sbc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -c -o android/android_audio_a2dp_default_la-hal-audio-sbc.lo `test -f 'android/hal-audio-sbc.c' || echo '$(srcdir)/'`android/hal-audio-sbc.c + +android/android_audio_a2dp_default_la-hal-audio-aptx.lo: android/hal-audio-aptx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -MT android/android_audio_a2dp_default_la-hal-audio-aptx.lo -MD -MP -MF android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-aptx.Tpo -c -o android/android_audio_a2dp_default_la-hal-audio-aptx.lo `test -f 'android/hal-audio-aptx.c' || echo '$(srcdir)/'`android/hal-audio-aptx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-aptx.Tpo android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio-aptx.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-audio-aptx.c' object='android/android_audio_a2dp_default_la-hal-audio-aptx.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -c -o android/android_audio_a2dp_default_la-hal-audio-aptx.lo `test -f 'android/hal-audio-aptx.c' || echo '$(srcdir)/'`android/hal-audio-aptx.c + +android/android_audio_sco_default_la-hal-sco.lo: android/hal-sco.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -MT android/android_audio_sco_default_la-hal-sco.lo -MD -MP -MF android/$(DEPDIR)/android_audio_sco_default_la-hal-sco.Tpo -c -o android/android_audio_sco_default_la-hal-sco.lo `test -f 'android/hal-sco.c' || echo '$(srcdir)/'`android/hal-sco.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_audio_sco_default_la-hal-sco.Tpo android/$(DEPDIR)/android_audio_sco_default_la-hal-sco.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-sco.c' object='android/android_audio_sco_default_la-hal-sco.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -c -o android/android_audio_sco_default_la-hal-sco.lo `test -f 'android/hal-sco.c' || echo '$(srcdir)/'`android/hal-sco.c + +android/audio_utils/android_audio_sco_default_la-resampler.lo: android/audio_utils/resampler.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -MT android/audio_utils/android_audio_sco_default_la-resampler.lo -MD -MP -MF android/audio_utils/$(DEPDIR)/android_audio_sco_default_la-resampler.Tpo -c -o android/audio_utils/android_audio_sco_default_la-resampler.lo `test -f 'android/audio_utils/resampler.c' || echo '$(srcdir)/'`android/audio_utils/resampler.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/audio_utils/$(DEPDIR)/android_audio_sco_default_la-resampler.Tpo android/audio_utils/$(DEPDIR)/android_audio_sco_default_la-resampler.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/audio_utils/resampler.c' object='android/audio_utils/android_audio_sco_default_la-resampler.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -c -o android/audio_utils/android_audio_sco_default_la-resampler.lo `test -f 'android/audio_utils/resampler.c' || echo '$(srcdir)/'`android/audio_utils/resampler.c + +android/android_bluetooth_default_la-hal-bluetooth.lo: android/hal-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-bluetooth.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Tpo -c -o android/android_bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-bluetooth.c' object='android/android_bluetooth_default_la-hal-bluetooth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c + +android/android_bluetooth_default_la-hal-socket.lo: android/hal-socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-socket.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Tpo -c -o android/android_bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-socket.c' object='android/android_bluetooth_default_la-hal-socket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c + +android/android_bluetooth_default_la-hal-hidhost.lo: android/hal-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-hidhost.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Tpo -c -o android/android_bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-hidhost.c' object='android/android_bluetooth_default_la-hal-hidhost.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c + +android/android_bluetooth_default_la-hal-health.lo: android/hal-health.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-health.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Tpo -c -o android/android_bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-health.c' object='android/android_bluetooth_default_la-hal-health.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c + +android/android_bluetooth_default_la-hal-pan.lo: android/hal-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-pan.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Tpo -c -o android/android_bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-pan.c' object='android/android_bluetooth_default_la-hal-pan.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c + +android/android_bluetooth_default_la-hal-a2dp.lo: android/hal-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-a2dp.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Tpo -c -o android/android_bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-a2dp.c' object='android/android_bluetooth_default_la-hal-a2dp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c + +android/android_bluetooth_default_la-hal-a2dp-sink.lo: android/hal-a2dp-sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-a2dp-sink.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp-sink.Tpo -c -o android/android_bluetooth_default_la-hal-a2dp-sink.lo `test -f 'android/hal-a2dp-sink.c' || echo '$(srcdir)/'`android/hal-a2dp-sink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp-sink.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp-sink.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-a2dp-sink.c' object='android/android_bluetooth_default_la-hal-a2dp-sink.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-a2dp-sink.lo `test -f 'android/hal-a2dp-sink.c' || echo '$(srcdir)/'`android/hal-a2dp-sink.c + +android/android_bluetooth_default_la-hal-avrcp.lo: android/hal-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-avrcp.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Tpo -c -o android/android_bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-avrcp.c' object='android/android_bluetooth_default_la-hal-avrcp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c + +android/android_bluetooth_default_la-hal-avrcp-ctrl.lo: android/hal-avrcp-ctrl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-avrcp-ctrl.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp-ctrl.Tpo -c -o android/android_bluetooth_default_la-hal-avrcp-ctrl.lo `test -f 'android/hal-avrcp-ctrl.c' || echo '$(srcdir)/'`android/hal-avrcp-ctrl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp-ctrl.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp-ctrl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-avrcp-ctrl.c' object='android/android_bluetooth_default_la-hal-avrcp-ctrl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-avrcp-ctrl.lo `test -f 'android/hal-avrcp-ctrl.c' || echo '$(srcdir)/'`android/hal-avrcp-ctrl.c + +android/android_bluetooth_default_la-hal-handsfree.lo: android/hal-handsfree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-handsfree.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Tpo -c -o android/android_bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-handsfree.c' object='android/android_bluetooth_default_la-hal-handsfree.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c + +android/android_bluetooth_default_la-hal-handsfree-client.lo: android/hal-handsfree-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-handsfree-client.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree-client.Tpo -c -o android/android_bluetooth_default_la-hal-handsfree-client.lo `test -f 'android/hal-handsfree-client.c' || echo '$(srcdir)/'`android/hal-handsfree-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree-client.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree-client.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-handsfree-client.c' object='android/android_bluetooth_default_la-hal-handsfree-client.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-handsfree-client.lo `test -f 'android/hal-handsfree-client.c' || echo '$(srcdir)/'`android/hal-handsfree-client.c + +android/android_bluetooth_default_la-hal-gatt.lo: android/hal-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-gatt.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Tpo -c -o android/android_bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-gatt.c' object='android/android_bluetooth_default_la-hal-gatt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c + +android/android_bluetooth_default_la-hal-map-client.lo: android/hal-map-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-map-client.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-map-client.Tpo -c -o android/android_bluetooth_default_la-hal-map-client.lo `test -f 'android/hal-map-client.c' || echo '$(srcdir)/'`android/hal-map-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-map-client.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-map-client.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-map-client.c' object='android/android_bluetooth_default_la-hal-map-client.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-map-client.lo `test -f 'android/hal-map-client.c' || echo '$(srcdir)/'`android/hal-map-client.c + +android/android_bluetooth_default_la-hal-ipc.lo: android/hal-ipc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-ipc.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Tpo -c -o android/android_bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-ipc.c' object='android/android_bluetooth_default_la-hal-ipc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c + +android/android_bluetooth_default_la-hal-utils.lo: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-utils.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Tpo -c -o android/android_bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_bluetooth_default_la-hal-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c + +plugins/plugins_external_dummy_la-external-dummy.lo: plugins/external-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) -MT plugins/plugins_external_dummy_la-external-dummy.lo -MD -MP -MF plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Tpo -c -o plugins/plugins_external_dummy_la-external-dummy.lo `test -f 'plugins/external-dummy.c' || echo '$(srcdir)/'`plugins/external-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Tpo plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/external-dummy.c' object='plugins/plugins_external_dummy_la-external-dummy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) -c -o plugins/plugins_external_dummy_la-external-dummy.lo `test -f 'plugins/external-dummy.c' || echo '$(srcdir)/'`plugins/external-dummy.c + +plugins/plugins_sixaxis_la-sixaxis.lo: plugins/sixaxis.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) -MT plugins/plugins_sixaxis_la-sixaxis.lo -MD -MP -MF plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Tpo -c -o plugins/plugins_sixaxis_la-sixaxis.lo `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Tpo plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/sixaxis.c' object='plugins/plugins_sixaxis_la-sixaxis.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) -c -o plugins/plugins_sixaxis_la-sixaxis.lo `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c + +emulator/android_android_tester-hciemu.o: emulator/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-hciemu.o -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-hciemu.Tpo -c -o emulator/android_android_tester-hciemu.o `test -f 'emulator/hciemu.c' || echo '$(srcdir)/'`emulator/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-hciemu.Tpo emulator/$(DEPDIR)/android_android_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/hciemu.c' object='emulator/android_android_tester-hciemu.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-hciemu.o `test -f 'emulator/hciemu.c' || echo '$(srcdir)/'`emulator/hciemu.c + +emulator/android_android_tester-hciemu.obj: emulator/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-hciemu.obj -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-hciemu.Tpo -c -o emulator/android_android_tester-hciemu.obj `if test -f 'emulator/hciemu.c'; then $(CYGPATH_W) 'emulator/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/emulator/hciemu.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-hciemu.Tpo emulator/$(DEPDIR)/android_android_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/hciemu.c' object='emulator/android_android_tester-hciemu.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-hciemu.obj `if test -f 'emulator/hciemu.c'; then $(CYGPATH_W) 'emulator/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/emulator/hciemu.c'; fi` + +emulator/android_android_tester-btdev.o: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-btdev.o -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-btdev.Tpo -c -o emulator/android_android_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-btdev.Tpo emulator/$(DEPDIR)/android_android_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_android_tester-btdev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c + +emulator/android_android_tester-btdev.obj: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-btdev.obj -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-btdev.Tpo -c -o emulator/android_android_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-btdev.Tpo emulator/$(DEPDIR)/android_android_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_android_tester-btdev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` + +emulator/android_android_tester-bthost.o: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-bthost.o -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-bthost.Tpo -c -o emulator/android_android_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-bthost.Tpo emulator/$(DEPDIR)/android_android_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_android_tester-bthost.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c + +emulator/android_android_tester-bthost.obj: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-bthost.obj -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-bthost.Tpo -c -o emulator/android_android_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-bthost.Tpo emulator/$(DEPDIR)/android_android_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_android_tester-bthost.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` + +emulator/android_android_tester-smp.o: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-smp.o -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-smp.Tpo -c -o emulator/android_android_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-smp.Tpo emulator/$(DEPDIR)/android_android_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_android_tester-smp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c + +emulator/android_android_tester-smp.obj: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-smp.obj -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-smp.Tpo -c -o emulator/android_android_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-smp.Tpo emulator/$(DEPDIR)/android_android_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_android_tester-smp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` + +android/hardware/android_android_tester-hardware.o: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/hardware/android_android_tester-hardware.o -MD -MP -MF android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo -c -o android/hardware/android_android_tester-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo android/hardware/$(DEPDIR)/android_android_tester-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_android_tester-hardware.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/hardware/android_android_tester-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c + +android/hardware/android_android_tester-hardware.obj: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/hardware/android_android_tester-hardware.obj -MD -MP -MF android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo -c -o android/hardware/android_android_tester-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo android/hardware/$(DEPDIR)/android_android_tester-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_android_tester-hardware.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/hardware/android_android_tester-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` + +android/android_android_tester-tester-bluetooth.o: android/tester-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-bluetooth.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-bluetooth.Tpo -c -o android/android_android_tester-tester-bluetooth.o `test -f 'android/tester-bluetooth.c' || echo '$(srcdir)/'`android/tester-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-bluetooth.Tpo android/$(DEPDIR)/android_android_tester-tester-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-bluetooth.c' object='android/android_android_tester-tester-bluetooth.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-bluetooth.o `test -f 'android/tester-bluetooth.c' || echo '$(srcdir)/'`android/tester-bluetooth.c + +android/android_android_tester-tester-bluetooth.obj: android/tester-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-bluetooth.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-bluetooth.Tpo -c -o android/android_android_tester-tester-bluetooth.obj `if test -f 'android/tester-bluetooth.c'; then $(CYGPATH_W) 'android/tester-bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-bluetooth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-bluetooth.Tpo android/$(DEPDIR)/android_android_tester-tester-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-bluetooth.c' object='android/android_android_tester-tester-bluetooth.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-bluetooth.obj `if test -f 'android/tester-bluetooth.c'; then $(CYGPATH_W) 'android/tester-bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-bluetooth.c'; fi` + +android/android_android_tester-tester-socket.o: android/tester-socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-socket.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-socket.Tpo -c -o android/android_android_tester-tester-socket.o `test -f 'android/tester-socket.c' || echo '$(srcdir)/'`android/tester-socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-socket.Tpo android/$(DEPDIR)/android_android_tester-tester-socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-socket.c' object='android/android_android_tester-tester-socket.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-socket.o `test -f 'android/tester-socket.c' || echo '$(srcdir)/'`android/tester-socket.c + +android/android_android_tester-tester-socket.obj: android/tester-socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-socket.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-socket.Tpo -c -o android/android_android_tester-tester-socket.obj `if test -f 'android/tester-socket.c'; then $(CYGPATH_W) 'android/tester-socket.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-socket.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-socket.Tpo android/$(DEPDIR)/android_android_tester-tester-socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-socket.c' object='android/android_android_tester-tester-socket.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-socket.obj `if test -f 'android/tester-socket.c'; then $(CYGPATH_W) 'android/tester-socket.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-socket.c'; fi` + +android/android_android_tester-tester-hidhost.o: android/tester-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-hidhost.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-hidhost.Tpo -c -o android/android_android_tester-tester-hidhost.o `test -f 'android/tester-hidhost.c' || echo '$(srcdir)/'`android/tester-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-hidhost.Tpo android/$(DEPDIR)/android_android_tester-tester-hidhost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-hidhost.c' object='android/android_android_tester-tester-hidhost.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-hidhost.o `test -f 'android/tester-hidhost.c' || echo '$(srcdir)/'`android/tester-hidhost.c + +android/android_android_tester-tester-hidhost.obj: android/tester-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-hidhost.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-hidhost.Tpo -c -o android/android_android_tester-tester-hidhost.obj `if test -f 'android/tester-hidhost.c'; then $(CYGPATH_W) 'android/tester-hidhost.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-hidhost.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-hidhost.Tpo android/$(DEPDIR)/android_android_tester-tester-hidhost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-hidhost.c' object='android/android_android_tester-tester-hidhost.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-hidhost.obj `if test -f 'android/tester-hidhost.c'; then $(CYGPATH_W) 'android/tester-hidhost.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-hidhost.c'; fi` + +android/android_android_tester-tester-pan.o: android/tester-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-pan.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-pan.Tpo -c -o android/android_android_tester-tester-pan.o `test -f 'android/tester-pan.c' || echo '$(srcdir)/'`android/tester-pan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-pan.Tpo android/$(DEPDIR)/android_android_tester-tester-pan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-pan.c' object='android/android_android_tester-tester-pan.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-pan.o `test -f 'android/tester-pan.c' || echo '$(srcdir)/'`android/tester-pan.c + +android/android_android_tester-tester-pan.obj: android/tester-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-pan.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-pan.Tpo -c -o android/android_android_tester-tester-pan.obj `if test -f 'android/tester-pan.c'; then $(CYGPATH_W) 'android/tester-pan.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-pan.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-pan.Tpo android/$(DEPDIR)/android_android_tester-tester-pan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-pan.c' object='android/android_android_tester-tester-pan.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-pan.obj `if test -f 'android/tester-pan.c'; then $(CYGPATH_W) 'android/tester-pan.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-pan.c'; fi` + +android/android_android_tester-tester-hdp.o: android/tester-hdp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-hdp.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-hdp.Tpo -c -o android/android_android_tester-tester-hdp.o `test -f 'android/tester-hdp.c' || echo '$(srcdir)/'`android/tester-hdp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-hdp.Tpo android/$(DEPDIR)/android_android_tester-tester-hdp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-hdp.c' object='android/android_android_tester-tester-hdp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-hdp.o `test -f 'android/tester-hdp.c' || echo '$(srcdir)/'`android/tester-hdp.c + +android/android_android_tester-tester-hdp.obj: android/tester-hdp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-hdp.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-hdp.Tpo -c -o android/android_android_tester-tester-hdp.obj `if test -f 'android/tester-hdp.c'; then $(CYGPATH_W) 'android/tester-hdp.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-hdp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-hdp.Tpo android/$(DEPDIR)/android_android_tester-tester-hdp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-hdp.c' object='android/android_android_tester-tester-hdp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-hdp.obj `if test -f 'android/tester-hdp.c'; then $(CYGPATH_W) 'android/tester-hdp.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-hdp.c'; fi` + +android/android_android_tester-tester-a2dp.o: android/tester-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-a2dp.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-a2dp.Tpo -c -o android/android_android_tester-tester-a2dp.o `test -f 'android/tester-a2dp.c' || echo '$(srcdir)/'`android/tester-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-a2dp.Tpo android/$(DEPDIR)/android_android_tester-tester-a2dp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-a2dp.c' object='android/android_android_tester-tester-a2dp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-a2dp.o `test -f 'android/tester-a2dp.c' || echo '$(srcdir)/'`android/tester-a2dp.c + +android/android_android_tester-tester-a2dp.obj: android/tester-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-a2dp.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-a2dp.Tpo -c -o android/android_android_tester-tester-a2dp.obj `if test -f 'android/tester-a2dp.c'; then $(CYGPATH_W) 'android/tester-a2dp.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-a2dp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-a2dp.Tpo android/$(DEPDIR)/android_android_tester-tester-a2dp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-a2dp.c' object='android/android_android_tester-tester-a2dp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-a2dp.obj `if test -f 'android/tester-a2dp.c'; then $(CYGPATH_W) 'android/tester-a2dp.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-a2dp.c'; fi` + +android/android_android_tester-tester-avrcp.o: android/tester-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-avrcp.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-avrcp.Tpo -c -o android/android_android_tester-tester-avrcp.o `test -f 'android/tester-avrcp.c' || echo '$(srcdir)/'`android/tester-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-avrcp.Tpo android/$(DEPDIR)/android_android_tester-tester-avrcp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-avrcp.c' object='android/android_android_tester-tester-avrcp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-avrcp.o `test -f 'android/tester-avrcp.c' || echo '$(srcdir)/'`android/tester-avrcp.c + +android/android_android_tester-tester-avrcp.obj: android/tester-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-avrcp.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-avrcp.Tpo -c -o android/android_android_tester-tester-avrcp.obj `if test -f 'android/tester-avrcp.c'; then $(CYGPATH_W) 'android/tester-avrcp.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-avrcp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-avrcp.Tpo android/$(DEPDIR)/android_android_tester-tester-avrcp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-avrcp.c' object='android/android_android_tester-tester-avrcp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-avrcp.obj `if test -f 'android/tester-avrcp.c'; then $(CYGPATH_W) 'android/tester-avrcp.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-avrcp.c'; fi` + +android/android_android_tester-tester-gatt.o: android/tester-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-gatt.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-gatt.Tpo -c -o android/android_android_tester-tester-gatt.o `test -f 'android/tester-gatt.c' || echo '$(srcdir)/'`android/tester-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-gatt.Tpo android/$(DEPDIR)/android_android_tester-tester-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-gatt.c' object='android/android_android_tester-tester-gatt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-gatt.o `test -f 'android/tester-gatt.c' || echo '$(srcdir)/'`android/tester-gatt.c + +android/android_android_tester-tester-gatt.obj: android/tester-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-gatt.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-gatt.Tpo -c -o android/android_android_tester-tester-gatt.obj `if test -f 'android/tester-gatt.c'; then $(CYGPATH_W) 'android/tester-gatt.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-gatt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-gatt.Tpo android/$(DEPDIR)/android_android_tester-tester-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-gatt.c' object='android/android_android_tester-tester-gatt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-gatt.obj `if test -f 'android/tester-gatt.c'; then $(CYGPATH_W) 'android/tester-gatt.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-gatt.c'; fi` + +android/android_android_tester-tester-map-client.o: android/tester-map-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-map-client.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-map-client.Tpo -c -o android/android_android_tester-tester-map-client.o `test -f 'android/tester-map-client.c' || echo '$(srcdir)/'`android/tester-map-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-map-client.Tpo android/$(DEPDIR)/android_android_tester-tester-map-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-map-client.c' object='android/android_android_tester-tester-map-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-map-client.o `test -f 'android/tester-map-client.c' || echo '$(srcdir)/'`android/tester-map-client.c + +android/android_android_tester-tester-map-client.obj: android/tester-map-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-map-client.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-map-client.Tpo -c -o android/android_android_tester-tester-map-client.obj `if test -f 'android/tester-map-client.c'; then $(CYGPATH_W) 'android/tester-map-client.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-map-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-map-client.Tpo android/$(DEPDIR)/android_android_tester-tester-map-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-map-client.c' object='android/android_android_tester-tester-map-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-map-client.obj `if test -f 'android/tester-map-client.c'; then $(CYGPATH_W) 'android/tester-map-client.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-map-client.c'; fi` + +android/android_android_tester-tester-main.o: android/tester-main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-main.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-main.Tpo -c -o android/android_android_tester-tester-main.o `test -f 'android/tester-main.c' || echo '$(srcdir)/'`android/tester-main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-main.Tpo android/$(DEPDIR)/android_android_tester-tester-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-main.c' object='android/android_android_tester-tester-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-main.o `test -f 'android/tester-main.c' || echo '$(srcdir)/'`android/tester-main.c + +android/android_android_tester-tester-main.obj: android/tester-main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-tester-main.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-tester-main.Tpo -c -o android/android_android_tester-tester-main.obj `if test -f 'android/tester-main.c'; then $(CYGPATH_W) 'android/tester-main.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-tester-main.Tpo android/$(DEPDIR)/android_android_tester-tester-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/tester-main.c' object='android/android_android_tester-tester-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-tester-main.obj `if test -f 'android/tester-main.c'; then $(CYGPATH_W) 'android/tester-main.c'; else $(CYGPATH_W) '$(srcdir)/android/tester-main.c'; fi` + +android/android_avdtptest-avdtptest.o: android/avdtptest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT android/android_avdtptest-avdtptest.o -MD -MP -MF android/$(DEPDIR)/android_avdtptest-avdtptest.Tpo -c -o android/android_avdtptest-avdtptest.o `test -f 'android/avdtptest.c' || echo '$(srcdir)/'`android/avdtptest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_avdtptest-avdtptest.Tpo android/$(DEPDIR)/android_avdtptest-avdtptest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/avdtptest.c' object='android/android_avdtptest-avdtptest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o android/android_avdtptest-avdtptest.o `test -f 'android/avdtptest.c' || echo '$(srcdir)/'`android/avdtptest.c + +android/android_avdtptest-avdtptest.obj: android/avdtptest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT android/android_avdtptest-avdtptest.obj -MD -MP -MF android/$(DEPDIR)/android_avdtptest-avdtptest.Tpo -c -o android/android_avdtptest-avdtptest.obj `if test -f 'android/avdtptest.c'; then $(CYGPATH_W) 'android/avdtptest.c'; else $(CYGPATH_W) '$(srcdir)/android/avdtptest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_avdtptest-avdtptest.Tpo android/$(DEPDIR)/android_avdtptest-avdtptest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/avdtptest.c' object='android/android_avdtptest-avdtptest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o android/android_avdtptest-avdtptest.obj `if test -f 'android/avdtptest.c'; then $(CYGPATH_W) 'android/avdtptest.c'; else $(CYGPATH_W) '$(srcdir)/android/avdtptest.c'; fi` + +src/android_avdtptest-log.o: src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT src/android_avdtptest-log.o -MD -MP -MF src/$(DEPDIR)/android_avdtptest-log.Tpo -c -o src/android_avdtptest-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/android_avdtptest-log.Tpo src/$(DEPDIR)/android_avdtptest-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/android_avdtptest-log.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o src/android_avdtptest-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c + +src/android_avdtptest-log.obj: src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT src/android_avdtptest-log.obj -MD -MP -MF src/$(DEPDIR)/android_avdtptest-log.Tpo -c -o src/android_avdtptest-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/android_avdtptest-log.Tpo src/$(DEPDIR)/android_avdtptest-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/android_avdtptest-log.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o src/android_avdtptest-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` + +btio/android_avdtptest-btio.o: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT btio/android_avdtptest-btio.o -MD -MP -MF btio/$(DEPDIR)/android_avdtptest-btio.Tpo -c -o btio/android_avdtptest-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/android_avdtptest-btio.Tpo btio/$(DEPDIR)/android_avdtptest-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/android_avdtptest-btio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o btio/android_avdtptest-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c + +btio/android_avdtptest-btio.obj: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT btio/android_avdtptest-btio.obj -MD -MP -MF btio/$(DEPDIR)/android_avdtptest-btio.Tpo -c -o btio/android_avdtptest-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/android_avdtptest-btio.Tpo btio/$(DEPDIR)/android_avdtptest-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/android_avdtptest-btio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o btio/android_avdtptest-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` + +src/shared/android_avdtptest-util.o: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT src/shared/android_avdtptest-util.o -MD -MP -MF src/shared/$(DEPDIR)/android_avdtptest-util.Tpo -c -o src/shared/android_avdtptest-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_avdtptest-util.Tpo src/shared/$(DEPDIR)/android_avdtptest-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/android_avdtptest-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o src/shared/android_avdtptest-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c + +src/shared/android_avdtptest-util.obj: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT src/shared/android_avdtptest-util.obj -MD -MP -MF src/shared/$(DEPDIR)/android_avdtptest-util.Tpo -c -o src/shared/android_avdtptest-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_avdtptest-util.Tpo src/shared/$(DEPDIR)/android_avdtptest-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/android_avdtptest-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o src/shared/android_avdtptest-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` + +src/shared/android_avdtptest-queue.o: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT src/shared/android_avdtptest-queue.o -MD -MP -MF src/shared/$(DEPDIR)/android_avdtptest-queue.Tpo -c -o src/shared/android_avdtptest-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_avdtptest-queue.Tpo src/shared/$(DEPDIR)/android_avdtptest-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/android_avdtptest-queue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o src/shared/android_avdtptest-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c + +src/shared/android_avdtptest-queue.obj: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT src/shared/android_avdtptest-queue.obj -MD -MP -MF src/shared/$(DEPDIR)/android_avdtptest-queue.Tpo -c -o src/shared/android_avdtptest-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_avdtptest-queue.Tpo src/shared/$(DEPDIR)/android_avdtptest-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/android_avdtptest-queue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o src/shared/android_avdtptest-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` + +android/android_avdtptest-avdtp.o: android/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT android/android_avdtptest-avdtp.o -MD -MP -MF android/$(DEPDIR)/android_avdtptest-avdtp.Tpo -c -o android/android_avdtptest-avdtp.o `test -f 'android/avdtp.c' || echo '$(srcdir)/'`android/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_avdtptest-avdtp.Tpo android/$(DEPDIR)/android_avdtptest-avdtp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/avdtp.c' object='android/android_avdtptest-avdtp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o android/android_avdtptest-avdtp.o `test -f 'android/avdtp.c' || echo '$(srcdir)/'`android/avdtp.c + +android/android_avdtptest-avdtp.obj: android/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -MT android/android_avdtptest-avdtp.obj -MD -MP -MF android/$(DEPDIR)/android_avdtptest-avdtp.Tpo -c -o android/android_avdtptest-avdtp.obj `if test -f 'android/avdtp.c'; then $(CYGPATH_W) 'android/avdtp.c'; else $(CYGPATH_W) '$(srcdir)/android/avdtp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_avdtptest-avdtp.Tpo android/$(DEPDIR)/android_avdtptest-avdtp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/avdtp.c' object='android/android_avdtptest-avdtp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_avdtptest_CFLAGS) $(CFLAGS) -c -o android/android_avdtptest-avdtp.obj `if test -f 'android/avdtp.c'; then $(CYGPATH_W) 'android/avdtp.c'; else $(CYGPATH_W) '$(srcdir)/android/avdtp.c'; fi` + +android/client/android_haltest-haltest.o: android/client/haltest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-haltest.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-haltest.Tpo -c -o android/client/android_haltest-haltest.o `test -f 'android/client/haltest.c' || echo '$(srcdir)/'`android/client/haltest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-haltest.Tpo android/client/$(DEPDIR)/android_haltest-haltest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/haltest.c' object='android/client/android_haltest-haltest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-haltest.o `test -f 'android/client/haltest.c' || echo '$(srcdir)/'`android/client/haltest.c + +android/client/android_haltest-haltest.obj: android/client/haltest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-haltest.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-haltest.Tpo -c -o android/client/android_haltest-haltest.obj `if test -f 'android/client/haltest.c'; then $(CYGPATH_W) 'android/client/haltest.c'; else $(CYGPATH_W) '$(srcdir)/android/client/haltest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-haltest.Tpo android/client/$(DEPDIR)/android_haltest-haltest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/haltest.c' object='android/client/android_haltest-haltest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-haltest.obj `if test -f 'android/client/haltest.c'; then $(CYGPATH_W) 'android/client/haltest.c'; else $(CYGPATH_W) '$(srcdir)/android/client/haltest.c'; fi` + +android/client/android_haltest-pollhandler.o: android/client/pollhandler.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-pollhandler.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo -c -o android/client/android_haltest-pollhandler.o `test -f 'android/client/pollhandler.c' || echo '$(srcdir)/'`android/client/pollhandler.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo android/client/$(DEPDIR)/android_haltest-pollhandler.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/pollhandler.c' object='android/client/android_haltest-pollhandler.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-pollhandler.o `test -f 'android/client/pollhandler.c' || echo '$(srcdir)/'`android/client/pollhandler.c + +android/client/android_haltest-pollhandler.obj: android/client/pollhandler.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-pollhandler.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo -c -o android/client/android_haltest-pollhandler.obj `if test -f 'android/client/pollhandler.c'; then $(CYGPATH_W) 'android/client/pollhandler.c'; else $(CYGPATH_W) '$(srcdir)/android/client/pollhandler.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo android/client/$(DEPDIR)/android_haltest-pollhandler.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/pollhandler.c' object='android/client/android_haltest-pollhandler.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-pollhandler.obj `if test -f 'android/client/pollhandler.c'; then $(CYGPATH_W) 'android/client/pollhandler.c'; else $(CYGPATH_W) '$(srcdir)/android/client/pollhandler.c'; fi` + +android/client/android_haltest-terminal.o: android/client/terminal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-terminal.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-terminal.Tpo -c -o android/client/android_haltest-terminal.o `test -f 'android/client/terminal.c' || echo '$(srcdir)/'`android/client/terminal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-terminal.Tpo android/client/$(DEPDIR)/android_haltest-terminal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/terminal.c' object='android/client/android_haltest-terminal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-terminal.o `test -f 'android/client/terminal.c' || echo '$(srcdir)/'`android/client/terminal.c + +android/client/android_haltest-terminal.obj: android/client/terminal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-terminal.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-terminal.Tpo -c -o android/client/android_haltest-terminal.obj `if test -f 'android/client/terminal.c'; then $(CYGPATH_W) 'android/client/terminal.c'; else $(CYGPATH_W) '$(srcdir)/android/client/terminal.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-terminal.Tpo android/client/$(DEPDIR)/android_haltest-terminal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/terminal.c' object='android/client/android_haltest-terminal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-terminal.obj `if test -f 'android/client/terminal.c'; then $(CYGPATH_W) 'android/client/terminal.c'; else $(CYGPATH_W) '$(srcdir)/android/client/terminal.c'; fi` + +android/client/android_haltest-history.o: android/client/history.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-history.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-history.Tpo -c -o android/client/android_haltest-history.o `test -f 'android/client/history.c' || echo '$(srcdir)/'`android/client/history.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-history.Tpo android/client/$(DEPDIR)/android_haltest-history.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/history.c' object='android/client/android_haltest-history.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-history.o `test -f 'android/client/history.c' || echo '$(srcdir)/'`android/client/history.c + +android/client/android_haltest-history.obj: android/client/history.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-history.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-history.Tpo -c -o android/client/android_haltest-history.obj `if test -f 'android/client/history.c'; then $(CYGPATH_W) 'android/client/history.c'; else $(CYGPATH_W) '$(srcdir)/android/client/history.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-history.Tpo android/client/$(DEPDIR)/android_haltest-history.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/history.c' object='android/client/android_haltest-history.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-history.obj `if test -f 'android/client/history.c'; then $(CYGPATH_W) 'android/client/history.c'; else $(CYGPATH_W) '$(srcdir)/android/client/history.c'; fi` + +android/client/android_haltest-tabcompletion.o: android/client/tabcompletion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-tabcompletion.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo -c -o android/client/android_haltest-tabcompletion.o `test -f 'android/client/tabcompletion.c' || echo '$(srcdir)/'`android/client/tabcompletion.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo android/client/$(DEPDIR)/android_haltest-tabcompletion.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/tabcompletion.c' object='android/client/android_haltest-tabcompletion.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-tabcompletion.o `test -f 'android/client/tabcompletion.c' || echo '$(srcdir)/'`android/client/tabcompletion.c + +android/client/android_haltest-tabcompletion.obj: android/client/tabcompletion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-tabcompletion.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo -c -o android/client/android_haltest-tabcompletion.obj `if test -f 'android/client/tabcompletion.c'; then $(CYGPATH_W) 'android/client/tabcompletion.c'; else $(CYGPATH_W) '$(srcdir)/android/client/tabcompletion.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo android/client/$(DEPDIR)/android_haltest-tabcompletion.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/tabcompletion.c' object='android/client/android_haltest-tabcompletion.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-tabcompletion.obj `if test -f 'android/client/tabcompletion.c'; then $(CYGPATH_W) 'android/client/tabcompletion.c'; else $(CYGPATH_W) '$(srcdir)/android/client/tabcompletion.c'; fi` + +android/client/android_haltest-if-av.o: android/client/if-av.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-av.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-av.Tpo -c -o android/client/android_haltest-if-av.o `test -f 'android/client/if-av.c' || echo '$(srcdir)/'`android/client/if-av.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-av.Tpo android/client/$(DEPDIR)/android_haltest-if-av.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-av.c' object='android/client/android_haltest-if-av.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-av.o `test -f 'android/client/if-av.c' || echo '$(srcdir)/'`android/client/if-av.c + +android/client/android_haltest-if-av.obj: android/client/if-av.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-av.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-av.Tpo -c -o android/client/android_haltest-if-av.obj `if test -f 'android/client/if-av.c'; then $(CYGPATH_W) 'android/client/if-av.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-av.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-av.Tpo android/client/$(DEPDIR)/android_haltest-if-av.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-av.c' object='android/client/android_haltest-if-av.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-av.obj `if test -f 'android/client/if-av.c'; then $(CYGPATH_W) 'android/client/if-av.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-av.c'; fi` + +android/client/android_haltest-if-av-sink.o: android/client/if-av-sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-av-sink.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-av-sink.Tpo -c -o android/client/android_haltest-if-av-sink.o `test -f 'android/client/if-av-sink.c' || echo '$(srcdir)/'`android/client/if-av-sink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-av-sink.Tpo android/client/$(DEPDIR)/android_haltest-if-av-sink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-av-sink.c' object='android/client/android_haltest-if-av-sink.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-av-sink.o `test -f 'android/client/if-av-sink.c' || echo '$(srcdir)/'`android/client/if-av-sink.c + +android/client/android_haltest-if-av-sink.obj: android/client/if-av-sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-av-sink.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-av-sink.Tpo -c -o android/client/android_haltest-if-av-sink.obj `if test -f 'android/client/if-av-sink.c'; then $(CYGPATH_W) 'android/client/if-av-sink.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-av-sink.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-av-sink.Tpo android/client/$(DEPDIR)/android_haltest-if-av-sink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-av-sink.c' object='android/client/android_haltest-if-av-sink.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-av-sink.obj `if test -f 'android/client/if-av-sink.c'; then $(CYGPATH_W) 'android/client/if-av-sink.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-av-sink.c'; fi` + +android/client/android_haltest-if-rc.o: android/client/if-rc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-rc.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-rc.Tpo -c -o android/client/android_haltest-if-rc.o `test -f 'android/client/if-rc.c' || echo '$(srcdir)/'`android/client/if-rc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-rc.Tpo android/client/$(DEPDIR)/android_haltest-if-rc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-rc.c' object='android/client/android_haltest-if-rc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-rc.o `test -f 'android/client/if-rc.c' || echo '$(srcdir)/'`android/client/if-rc.c + +android/client/android_haltest-if-rc.obj: android/client/if-rc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-rc.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-rc.Tpo -c -o android/client/android_haltest-if-rc.obj `if test -f 'android/client/if-rc.c'; then $(CYGPATH_W) 'android/client/if-rc.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-rc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-rc.Tpo android/client/$(DEPDIR)/android_haltest-if-rc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-rc.c' object='android/client/android_haltest-if-rc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-rc.obj `if test -f 'android/client/if-rc.c'; then $(CYGPATH_W) 'android/client/if-rc.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-rc.c'; fi` + +android/client/android_haltest-if-rc-ctrl.o: android/client/if-rc-ctrl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-rc-ctrl.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-rc-ctrl.Tpo -c -o android/client/android_haltest-if-rc-ctrl.o `test -f 'android/client/if-rc-ctrl.c' || echo '$(srcdir)/'`android/client/if-rc-ctrl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-rc-ctrl.Tpo android/client/$(DEPDIR)/android_haltest-if-rc-ctrl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-rc-ctrl.c' object='android/client/android_haltest-if-rc-ctrl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-rc-ctrl.o `test -f 'android/client/if-rc-ctrl.c' || echo '$(srcdir)/'`android/client/if-rc-ctrl.c + +android/client/android_haltest-if-rc-ctrl.obj: android/client/if-rc-ctrl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-rc-ctrl.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-rc-ctrl.Tpo -c -o android/client/android_haltest-if-rc-ctrl.obj `if test -f 'android/client/if-rc-ctrl.c'; then $(CYGPATH_W) 'android/client/if-rc-ctrl.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-rc-ctrl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-rc-ctrl.Tpo android/client/$(DEPDIR)/android_haltest-if-rc-ctrl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-rc-ctrl.c' object='android/client/android_haltest-if-rc-ctrl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-rc-ctrl.obj `if test -f 'android/client/if-rc-ctrl.c'; then $(CYGPATH_W) 'android/client/if-rc-ctrl.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-rc-ctrl.c'; fi` + +android/client/android_haltest-if-bt.o: android/client/if-bt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-bt.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-bt.Tpo -c -o android/client/android_haltest-if-bt.o `test -f 'android/client/if-bt.c' || echo '$(srcdir)/'`android/client/if-bt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-bt.Tpo android/client/$(DEPDIR)/android_haltest-if-bt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-bt.c' object='android/client/android_haltest-if-bt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-bt.o `test -f 'android/client/if-bt.c' || echo '$(srcdir)/'`android/client/if-bt.c + +android/client/android_haltest-if-bt.obj: android/client/if-bt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-bt.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-bt.Tpo -c -o android/client/android_haltest-if-bt.obj `if test -f 'android/client/if-bt.c'; then $(CYGPATH_W) 'android/client/if-bt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-bt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-bt.Tpo android/client/$(DEPDIR)/android_haltest-if-bt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-bt.c' object='android/client/android_haltest-if-bt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-bt.obj `if test -f 'android/client/if-bt.c'; then $(CYGPATH_W) 'android/client/if-bt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-bt.c'; fi` + +android/client/android_haltest-if-gatt.o: android/client/if-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-gatt.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo -c -o android/client/android_haltest-if-gatt.o `test -f 'android/client/if-gatt.c' || echo '$(srcdir)/'`android/client/if-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo android/client/$(DEPDIR)/android_haltest-if-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-gatt.c' object='android/client/android_haltest-if-gatt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-gatt.o `test -f 'android/client/if-gatt.c' || echo '$(srcdir)/'`android/client/if-gatt.c + +android/client/android_haltest-if-gatt.obj: android/client/if-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-gatt.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo -c -o android/client/android_haltest-if-gatt.obj `if test -f 'android/client/if-gatt.c'; then $(CYGPATH_W) 'android/client/if-gatt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-gatt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo android/client/$(DEPDIR)/android_haltest-if-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-gatt.c' object='android/client/android_haltest-if-gatt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-gatt.obj `if test -f 'android/client/if-gatt.c'; then $(CYGPATH_W) 'android/client/if-gatt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-gatt.c'; fi` + +android/client/android_haltest-if-hf.o: android/client/if-hf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hf.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hf.Tpo -c -o android/client/android_haltest-if-hf.o `test -f 'android/client/if-hf.c' || echo '$(srcdir)/'`android/client/if-hf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hf.Tpo android/client/$(DEPDIR)/android_haltest-if-hf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hf.c' object='android/client/android_haltest-if-hf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hf.o `test -f 'android/client/if-hf.c' || echo '$(srcdir)/'`android/client/if-hf.c + +android/client/android_haltest-if-hf.obj: android/client/if-hf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hf.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hf.Tpo -c -o android/client/android_haltest-if-hf.obj `if test -f 'android/client/if-hf.c'; then $(CYGPATH_W) 'android/client/if-hf.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hf.Tpo android/client/$(DEPDIR)/android_haltest-if-hf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hf.c' object='android/client/android_haltest-if-hf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hf.obj `if test -f 'android/client/if-hf.c'; then $(CYGPATH_W) 'android/client/if-hf.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hf.c'; fi` + +android/client/android_haltest-if-hf-client.o: android/client/if-hf-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hf-client.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hf-client.Tpo -c -o android/client/android_haltest-if-hf-client.o `test -f 'android/client/if-hf-client.c' || echo '$(srcdir)/'`android/client/if-hf-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hf-client.Tpo android/client/$(DEPDIR)/android_haltest-if-hf-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hf-client.c' object='android/client/android_haltest-if-hf-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hf-client.o `test -f 'android/client/if-hf-client.c' || echo '$(srcdir)/'`android/client/if-hf-client.c + +android/client/android_haltest-if-hf-client.obj: android/client/if-hf-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hf-client.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hf-client.Tpo -c -o android/client/android_haltest-if-hf-client.obj `if test -f 'android/client/if-hf-client.c'; then $(CYGPATH_W) 'android/client/if-hf-client.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hf-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hf-client.Tpo android/client/$(DEPDIR)/android_haltest-if-hf-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hf-client.c' object='android/client/android_haltest-if-hf-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hf-client.obj `if test -f 'android/client/if-hf-client.c'; then $(CYGPATH_W) 'android/client/if-hf-client.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hf-client.c'; fi` + +android/client/android_haltest-if-hh.o: android/client/if-hh.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hh.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hh.Tpo -c -o android/client/android_haltest-if-hh.o `test -f 'android/client/if-hh.c' || echo '$(srcdir)/'`android/client/if-hh.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hh.Tpo android/client/$(DEPDIR)/android_haltest-if-hh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hh.c' object='android/client/android_haltest-if-hh.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hh.o `test -f 'android/client/if-hh.c' || echo '$(srcdir)/'`android/client/if-hh.c + +android/client/android_haltest-if-hh.obj: android/client/if-hh.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hh.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hh.Tpo -c -o android/client/android_haltest-if-hh.obj `if test -f 'android/client/if-hh.c'; then $(CYGPATH_W) 'android/client/if-hh.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hh.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hh.Tpo android/client/$(DEPDIR)/android_haltest-if-hh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hh.c' object='android/client/android_haltest-if-hh.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hh.obj `if test -f 'android/client/if-hh.c'; then $(CYGPATH_W) 'android/client/if-hh.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hh.c'; fi` + +android/client/android_haltest-if-pan.o: android/client/if-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-pan.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-pan.Tpo -c -o android/client/android_haltest-if-pan.o `test -f 'android/client/if-pan.c' || echo '$(srcdir)/'`android/client/if-pan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-pan.Tpo android/client/$(DEPDIR)/android_haltest-if-pan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-pan.c' object='android/client/android_haltest-if-pan.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-pan.o `test -f 'android/client/if-pan.c' || echo '$(srcdir)/'`android/client/if-pan.c + +android/client/android_haltest-if-pan.obj: android/client/if-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-pan.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-pan.Tpo -c -o android/client/android_haltest-if-pan.obj `if test -f 'android/client/if-pan.c'; then $(CYGPATH_W) 'android/client/if-pan.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-pan.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-pan.Tpo android/client/$(DEPDIR)/android_haltest-if-pan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-pan.c' object='android/client/android_haltest-if-pan.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-pan.obj `if test -f 'android/client/if-pan.c'; then $(CYGPATH_W) 'android/client/if-pan.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-pan.c'; fi` + +android/client/android_haltest-if-hl.o: android/client/if-hl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hl.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hl.Tpo -c -o android/client/android_haltest-if-hl.o `test -f 'android/client/if-hl.c' || echo '$(srcdir)/'`android/client/if-hl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hl.Tpo android/client/$(DEPDIR)/android_haltest-if-hl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hl.c' object='android/client/android_haltest-if-hl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hl.o `test -f 'android/client/if-hl.c' || echo '$(srcdir)/'`android/client/if-hl.c + +android/client/android_haltest-if-hl.obj: android/client/if-hl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hl.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hl.Tpo -c -o android/client/android_haltest-if-hl.obj `if test -f 'android/client/if-hl.c'; then $(CYGPATH_W) 'android/client/if-hl.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hl.Tpo android/client/$(DEPDIR)/android_haltest-if-hl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hl.c' object='android/client/android_haltest-if-hl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hl.obj `if test -f 'android/client/if-hl.c'; then $(CYGPATH_W) 'android/client/if-hl.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hl.c'; fi` + +android/client/android_haltest-if-sock.o: android/client/if-sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-sock.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-sock.Tpo -c -o android/client/android_haltest-if-sock.o `test -f 'android/client/if-sock.c' || echo '$(srcdir)/'`android/client/if-sock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-sock.Tpo android/client/$(DEPDIR)/android_haltest-if-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-sock.c' object='android/client/android_haltest-if-sock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-sock.o `test -f 'android/client/if-sock.c' || echo '$(srcdir)/'`android/client/if-sock.c + +android/client/android_haltest-if-sock.obj: android/client/if-sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-sock.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-sock.Tpo -c -o android/client/android_haltest-if-sock.obj `if test -f 'android/client/if-sock.c'; then $(CYGPATH_W) 'android/client/if-sock.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-sock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-sock.Tpo android/client/$(DEPDIR)/android_haltest-if-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-sock.c' object='android/client/android_haltest-if-sock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-sock.obj `if test -f 'android/client/if-sock.c'; then $(CYGPATH_W) 'android/client/if-sock.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-sock.c'; fi` + +android/client/android_haltest-if-audio.o: android/client/if-audio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-audio.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-audio.Tpo -c -o android/client/android_haltest-if-audio.o `test -f 'android/client/if-audio.c' || echo '$(srcdir)/'`android/client/if-audio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-audio.Tpo android/client/$(DEPDIR)/android_haltest-if-audio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-audio.c' object='android/client/android_haltest-if-audio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-audio.o `test -f 'android/client/if-audio.c' || echo '$(srcdir)/'`android/client/if-audio.c + +android/client/android_haltest-if-audio.obj: android/client/if-audio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-audio.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-audio.Tpo -c -o android/client/android_haltest-if-audio.obj `if test -f 'android/client/if-audio.c'; then $(CYGPATH_W) 'android/client/if-audio.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-audio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-audio.Tpo android/client/$(DEPDIR)/android_haltest-if-audio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-audio.c' object='android/client/android_haltest-if-audio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-audio.obj `if test -f 'android/client/if-audio.c'; then $(CYGPATH_W) 'android/client/if-audio.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-audio.c'; fi` + +android/client/android_haltest-if-sco.o: android/client/if-sco.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-sco.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-sco.Tpo -c -o android/client/android_haltest-if-sco.o `test -f 'android/client/if-sco.c' || echo '$(srcdir)/'`android/client/if-sco.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-sco.Tpo android/client/$(DEPDIR)/android_haltest-if-sco.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-sco.c' object='android/client/android_haltest-if-sco.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-sco.o `test -f 'android/client/if-sco.c' || echo '$(srcdir)/'`android/client/if-sco.c + +android/client/android_haltest-if-sco.obj: android/client/if-sco.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-sco.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-sco.Tpo -c -o android/client/android_haltest-if-sco.obj `if test -f 'android/client/if-sco.c'; then $(CYGPATH_W) 'android/client/if-sco.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-sco.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-sco.Tpo android/client/$(DEPDIR)/android_haltest-if-sco.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-sco.c' object='android/client/android_haltest-if-sco.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-sco.obj `if test -f 'android/client/if-sco.c'; then $(CYGPATH_W) 'android/client/if-sco.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-sco.c'; fi` + +android/client/android_haltest-if-mce.o: android/client/if-mce.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-mce.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-mce.Tpo -c -o android/client/android_haltest-if-mce.o `test -f 'android/client/if-mce.c' || echo '$(srcdir)/'`android/client/if-mce.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-mce.Tpo android/client/$(DEPDIR)/android_haltest-if-mce.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-mce.c' object='android/client/android_haltest-if-mce.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-mce.o `test -f 'android/client/if-mce.c' || echo '$(srcdir)/'`android/client/if-mce.c + +android/client/android_haltest-if-mce.obj: android/client/if-mce.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-mce.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-mce.Tpo -c -o android/client/android_haltest-if-mce.obj `if test -f 'android/client/if-mce.c'; then $(CYGPATH_W) 'android/client/if-mce.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-mce.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-mce.Tpo android/client/$(DEPDIR)/android_haltest-if-mce.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-mce.c' object='android/client/android_haltest-if-mce.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-mce.obj `if test -f 'android/client/if-mce.c'; then $(CYGPATH_W) 'android/client/if-mce.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-mce.c'; fi` + +android/hardware/android_haltest-hardware.o: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/hardware/android_haltest-hardware.o -MD -MP -MF android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo -c -o android/hardware/android_haltest-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo android/hardware/$(DEPDIR)/android_haltest-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_haltest-hardware.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/hardware/android_haltest-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c + +android/hardware/android_haltest-hardware.obj: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/hardware/android_haltest-hardware.obj -MD -MP -MF android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo -c -o android/hardware/android_haltest-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo android/hardware/$(DEPDIR)/android_haltest-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_haltest-hardware.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/hardware/android_haltest-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` + +android/android_haltest-hal-utils.o: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/android_haltest-hal-utils.o -MD -MP -MF android/$(DEPDIR)/android_haltest-hal-utils.Tpo -c -o android/android_haltest-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_haltest-hal-utils.Tpo android/$(DEPDIR)/android_haltest-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_haltest-hal-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/android_haltest-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c + +android/android_haltest-hal-utils.obj: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/android_haltest-hal-utils.obj -MD -MP -MF android/$(DEPDIR)/android_haltest-hal-utils.Tpo -c -o android/android_haltest-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_haltest-hal-utils.Tpo android/$(DEPDIR)/android_haltest-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_haltest-hal-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/android_haltest-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` + +emulator/android_ipc_tester-hciemu.o: emulator/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-hciemu.o -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-hciemu.Tpo -c -o emulator/android_ipc_tester-hciemu.o `test -f 'emulator/hciemu.c' || echo '$(srcdir)/'`emulator/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-hciemu.Tpo emulator/$(DEPDIR)/android_ipc_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/hciemu.c' object='emulator/android_ipc_tester-hciemu.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-hciemu.o `test -f 'emulator/hciemu.c' || echo '$(srcdir)/'`emulator/hciemu.c + +emulator/android_ipc_tester-hciemu.obj: emulator/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-hciemu.obj -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-hciemu.Tpo -c -o emulator/android_ipc_tester-hciemu.obj `if test -f 'emulator/hciemu.c'; then $(CYGPATH_W) 'emulator/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/emulator/hciemu.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-hciemu.Tpo emulator/$(DEPDIR)/android_ipc_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/hciemu.c' object='emulator/android_ipc_tester-hciemu.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-hciemu.obj `if test -f 'emulator/hciemu.c'; then $(CYGPATH_W) 'emulator/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/emulator/hciemu.c'; fi` + +emulator/android_ipc_tester-btdev.o: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-btdev.o -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo -c -o emulator/android_ipc_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo emulator/$(DEPDIR)/android_ipc_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_ipc_tester-btdev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c + +emulator/android_ipc_tester-btdev.obj: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-btdev.obj -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo -c -o emulator/android_ipc_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo emulator/$(DEPDIR)/android_ipc_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_ipc_tester-btdev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` + +emulator/android_ipc_tester-bthost.o: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-bthost.o -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo -c -o emulator/android_ipc_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo emulator/$(DEPDIR)/android_ipc_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_ipc_tester-bthost.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c + +emulator/android_ipc_tester-bthost.obj: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-bthost.obj -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo -c -o emulator/android_ipc_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo emulator/$(DEPDIR)/android_ipc_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_ipc_tester-bthost.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` + +emulator/android_ipc_tester-smp.o: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-smp.o -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo -c -o emulator/android_ipc_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo emulator/$(DEPDIR)/android_ipc_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_ipc_tester-smp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c + +emulator/android_ipc_tester-smp.obj: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-smp.obj -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo -c -o emulator/android_ipc_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo emulator/$(DEPDIR)/android_ipc_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_ipc_tester-smp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` + +android/android_ipc_tester-hal-utils.o: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-hal-utils.o -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo -c -o android/android_ipc_tester-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo android/$(DEPDIR)/android_ipc_tester-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_ipc_tester-hal-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c + +android/android_ipc_tester-hal-utils.obj: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-hal-utils.obj -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo -c -o android/android_ipc_tester-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo android/$(DEPDIR)/android_ipc_tester-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_ipc_tester-hal-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` + +android/android_ipc_tester-ipc-tester.o: android/ipc-tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-ipc-tester.o -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo -c -o android/android_ipc_tester-ipc-tester.o `test -f 'android/ipc-tester.c' || echo '$(srcdir)/'`android/ipc-tester.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo android/$(DEPDIR)/android_ipc_tester-ipc-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/ipc-tester.c' object='android/android_ipc_tester-ipc-tester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-ipc-tester.o `test -f 'android/ipc-tester.c' || echo '$(srcdir)/'`android/ipc-tester.c + +android/android_ipc_tester-ipc-tester.obj: android/ipc-tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-ipc-tester.obj -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo -c -o android/android_ipc_tester-ipc-tester.obj `if test -f 'android/ipc-tester.c'; then $(CYGPATH_W) 'android/ipc-tester.c'; else $(CYGPATH_W) '$(srcdir)/android/ipc-tester.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo android/$(DEPDIR)/android_ipc_tester-ipc-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/ipc-tester.c' object='android/android_ipc_tester-ipc-tester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-ipc-tester.obj `if test -f 'android/ipc-tester.c'; then $(CYGPATH_W) 'android/ipc-tester.c'; else $(CYGPATH_W) '$(srcdir)/android/ipc-tester.c'; fi` + +btio/obexd-btio.o: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.o -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/obexd-btio.Tpo btio/$(DEPDIR)/obexd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/obexd-btio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c + +btio/obexd-btio.obj: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.obj -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/obexd-btio.Tpo btio/$(DEPDIR)/obexd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/obexd-btio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` + +gobex/obexd-gobex.o: gobex/gobex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex.Tpo gobex/$(DEPDIR)/obexd-gobex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex.c' object='gobex/obexd-gobex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c + +gobex/obexd-gobex.obj: gobex/gobex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex.Tpo gobex/$(DEPDIR)/obexd-gobex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex.c' object='gobex/obexd-gobex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` + +gobex/obexd-gobex-defs.o: gobex/gobex-defs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-defs.Tpo gobex/$(DEPDIR)/obexd-gobex-defs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-defs.c' object='gobex/obexd-gobex-defs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c + +gobex/obexd-gobex-defs.obj: gobex/gobex-defs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-defs.Tpo gobex/$(DEPDIR)/obexd-gobex-defs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-defs.c' object='gobex/obexd-gobex-defs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` + +gobex/obexd-gobex-packet.o: gobex/gobex-packet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-packet.Tpo gobex/$(DEPDIR)/obexd-gobex-packet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-packet.c' object='gobex/obexd-gobex-packet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c + +gobex/obexd-gobex-packet.obj: gobex/gobex-packet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-packet.Tpo gobex/$(DEPDIR)/obexd-gobex-packet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-packet.c' object='gobex/obexd-gobex-packet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` + +gobex/obexd-gobex-header.o: gobex/gobex-header.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-header.Tpo gobex/$(DEPDIR)/obexd-gobex-header.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-header.c' object='gobex/obexd-gobex-header.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c + +gobex/obexd-gobex-header.obj: gobex/gobex-header.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-header.Tpo gobex/$(DEPDIR)/obexd-gobex-header.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-header.c' object='gobex/obexd-gobex-header.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` + +gobex/obexd-gobex-transfer.o: gobex/gobex-transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo gobex/$(DEPDIR)/obexd-gobex-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-transfer.c' object='gobex/obexd-gobex-transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c + +gobex/obexd-gobex-transfer.obj: gobex/gobex-transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo gobex/$(DEPDIR)/obexd-gobex-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-transfer.c' object='gobex/obexd-gobex-transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` + +gobex/obexd-gobex-apparam.o: gobex/gobex-apparam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo gobex/$(DEPDIR)/obexd-gobex-apparam.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-apparam.c' object='gobex/obexd-gobex-apparam.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c + +gobex/obexd-gobex-apparam.obj: gobex/gobex-apparam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo gobex/$(DEPDIR)/obexd-gobex-apparam.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-apparam.c' object='gobex/obexd-gobex-apparam.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` + +obexd/plugins/obexd-filesystem.o: obexd/plugins/filesystem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo obexd/plugins/$(DEPDIR)/obexd-filesystem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/filesystem.c' object='obexd/plugins/obexd-filesystem.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c + +obexd/plugins/obexd-filesystem.obj: obexd/plugins/filesystem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo obexd/plugins/$(DEPDIR)/obexd-filesystem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/filesystem.c' object='obexd/plugins/obexd-filesystem.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` + +obexd/plugins/obexd-bluetooth.o: obexd/plugins/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/bluetooth.c' object='obexd/plugins/obexd-bluetooth.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c + +obexd/plugins/obexd-bluetooth.obj: obexd/plugins/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/bluetooth.c' object='obexd/plugins/obexd-bluetooth.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` + +obexd/plugins/obexd-pcsuite.o: obexd/plugins/pcsuite.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pcsuite.c' object='obexd/plugins/obexd-pcsuite.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c + +obexd/plugins/obexd-pcsuite.obj: obexd/plugins/pcsuite.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pcsuite.c' object='obexd/plugins/obexd-pcsuite.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` + +obexd/plugins/obexd-opp.o: obexd/plugins/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-opp.Tpo obexd/plugins/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/opp.c' object='obexd/plugins/obexd-opp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c + +obexd/plugins/obexd-opp.obj: obexd/plugins/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-opp.Tpo obexd/plugins/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/opp.c' object='obexd/plugins/obexd-opp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` + +obexd/plugins/obexd-ftp.o: obexd/plugins/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo obexd/plugins/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/ftp.c' object='obexd/plugins/obexd-ftp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c + +obexd/plugins/obexd-ftp.obj: obexd/plugins/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo obexd/plugins/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/ftp.c' object='obexd/plugins/obexd-ftp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` + +obexd/plugins/obexd-irmc.o: obexd/plugins/irmc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo obexd/plugins/$(DEPDIR)/obexd-irmc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/irmc.c' object='obexd/plugins/obexd-irmc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c + +obexd/plugins/obexd-irmc.obj: obexd/plugins/irmc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo obexd/plugins/$(DEPDIR)/obexd-irmc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/irmc.c' object='obexd/plugins/obexd-irmc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` + +obexd/plugins/obexd-pbap.o: obexd/plugins/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo obexd/plugins/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pbap.c' object='obexd/plugins/obexd-pbap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c + +obexd/plugins/obexd-pbap.obj: obexd/plugins/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo obexd/plugins/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pbap.c' object='obexd/plugins/obexd-pbap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` + +obexd/plugins/obexd-vcard.o: obexd/plugins/vcard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo obexd/plugins/$(DEPDIR)/obexd-vcard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/vcard.c' object='obexd/plugins/obexd-vcard.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c + +obexd/plugins/obexd-vcard.obj: obexd/plugins/vcard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo obexd/plugins/$(DEPDIR)/obexd-vcard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/vcard.c' object='obexd/plugins/obexd-vcard.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` + +obexd/plugins/obexd-phonebook-dummy.o: obexd/plugins/phonebook-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-dummy.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo -c -o obexd/plugins/obexd-phonebook-dummy.o `test -f 'obexd/plugins/phonebook-dummy.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/phonebook-dummy.c' object='obexd/plugins/obexd-phonebook-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-dummy.o `test -f 'obexd/plugins/phonebook-dummy.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-dummy.c + +obexd/plugins/obexd-phonebook-dummy.obj: obexd/plugins/phonebook-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-dummy.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo -c -o obexd/plugins/obexd-phonebook-dummy.obj `if test -f 'obexd/plugins/phonebook-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/phonebook-dummy.c' object='obexd/plugins/obexd-phonebook-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-dummy.obj `if test -f 'obexd/plugins/phonebook-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-dummy.c'; fi` + +obexd/plugins/obexd-mas.o: obexd/plugins/mas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-mas.Tpo obexd/plugins/$(DEPDIR)/obexd-mas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/mas.c' object='obexd/plugins/obexd-mas.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c + +obexd/plugins/obexd-mas.obj: obexd/plugins/mas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-mas.Tpo obexd/plugins/$(DEPDIR)/obexd-mas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/mas.c' object='obexd/plugins/obexd-mas.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` + +obexd/plugins/obexd-messages-dummy.o: obexd/plugins/messages-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/messages-dummy.c' object='obexd/plugins/obexd-messages-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c + +obexd/plugins/obexd-messages-dummy.obj: obexd/plugins/messages-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/messages-dummy.c' object='obexd/plugins/obexd-messages-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` + +obexd/client/obexd-mns.o: obexd/client/mns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-mns.Tpo obexd/client/$(DEPDIR)/obexd-mns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/mns.c' object='obexd/client/obexd-mns.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c + +obexd/client/obexd-mns.obj: obexd/client/mns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-mns.Tpo obexd/client/$(DEPDIR)/obexd-mns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/mns.c' object='obexd/client/obexd-mns.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` + +obexd/src/obexd-main.o: obexd/src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-main.Tpo obexd/src/$(DEPDIR)/obexd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/main.c' object='obexd/src/obexd-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c + +obexd/src/obexd-main.obj: obexd/src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-main.Tpo obexd/src/$(DEPDIR)/obexd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/main.c' object='obexd/src/obexd-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` + +obexd/src/obexd-plugin.o: obexd/src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-plugin.Tpo obexd/src/$(DEPDIR)/obexd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/plugin.c' object='obexd/src/obexd-plugin.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c + +obexd/src/obexd-plugin.obj: obexd/src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-plugin.Tpo obexd/src/$(DEPDIR)/obexd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/plugin.c' object='obexd/src/obexd-plugin.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` + +obexd/src/obexd-log.o: obexd/src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-log.Tpo obexd/src/$(DEPDIR)/obexd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/log.c' object='obexd/src/obexd-log.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c + +obexd/src/obexd-log.obj: obexd/src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-log.Tpo obexd/src/$(DEPDIR)/obexd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/log.c' object='obexd/src/obexd-log.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` + +obexd/src/obexd-manager.o: obexd/src/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-manager.Tpo obexd/src/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/manager.c' object='obexd/src/obexd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c + +obexd/src/obexd-manager.obj: obexd/src/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-manager.Tpo obexd/src/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/manager.c' object='obexd/src/obexd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` + +obexd/src/obexd-obex.o: obexd/src/obex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-obex.Tpo obexd/src/$(DEPDIR)/obexd-obex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/obex.c' object='obexd/src/obexd-obex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c + +obexd/src/obexd-obex.obj: obexd/src/obex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-obex.Tpo obexd/src/$(DEPDIR)/obexd-obex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/obex.c' object='obexd/src/obexd-obex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` + +obexd/src/obexd-mimetype.o: obexd/src/mimetype.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-mimetype.Tpo obexd/src/$(DEPDIR)/obexd-mimetype.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/mimetype.c' object='obexd/src/obexd-mimetype.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c + +obexd/src/obexd-mimetype.obj: obexd/src/mimetype.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-mimetype.Tpo obexd/src/$(DEPDIR)/obexd-mimetype.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/mimetype.c' object='obexd/src/obexd-mimetype.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` + +obexd/src/obexd-service.o: obexd/src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-service.Tpo obexd/src/$(DEPDIR)/obexd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/service.c' object='obexd/src/obexd-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c + +obexd/src/obexd-service.obj: obexd/src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-service.Tpo obexd/src/$(DEPDIR)/obexd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/service.c' object='obexd/src/obexd-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` + +obexd/src/obexd-transport.o: obexd/src/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-transport.Tpo obexd/src/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/transport.c' object='obexd/src/obexd-transport.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c + +obexd/src/obexd-transport.obj: obexd/src/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-transport.Tpo obexd/src/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/transport.c' object='obexd/src/obexd-transport.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` + +obexd/src/obexd-server.o: obexd/src/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-server.Tpo obexd/src/$(DEPDIR)/obexd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/server.c' object='obexd/src/obexd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c + +obexd/src/obexd-server.obj: obexd/src/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-server.Tpo obexd/src/$(DEPDIR)/obexd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/server.c' object='obexd/src/obexd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` + +obexd/client/obexd-manager.o: obexd/client/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-manager.Tpo obexd/client/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/manager.c' object='obexd/client/obexd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c + +obexd/client/obexd-manager.obj: obexd/client/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-manager.Tpo obexd/client/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/manager.c' object='obexd/client/obexd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` + +obexd/client/obexd-session.o: obexd/client/session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-session.Tpo obexd/client/$(DEPDIR)/obexd-session.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/session.c' object='obexd/client/obexd-session.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c + +obexd/client/obexd-session.obj: obexd/client/session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-session.Tpo obexd/client/$(DEPDIR)/obexd-session.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/session.c' object='obexd/client/obexd-session.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` + +obexd/client/obexd-bluetooth.o: obexd/client/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo obexd/client/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/bluetooth.c' object='obexd/client/obexd-bluetooth.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c + +obexd/client/obexd-bluetooth.obj: obexd/client/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo obexd/client/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/bluetooth.c' object='obexd/client/obexd-bluetooth.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` + +obexd/client/obexd-sync.o: obexd/client/sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-sync.Tpo obexd/client/$(DEPDIR)/obexd-sync.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/sync.c' object='obexd/client/obexd-sync.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c + +obexd/client/obexd-sync.obj: obexd/client/sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-sync.Tpo obexd/client/$(DEPDIR)/obexd-sync.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/sync.c' object='obexd/client/obexd-sync.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` + +obexd/client/obexd-pbap.o: obexd/client/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-pbap.Tpo obexd/client/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/pbap.c' object='obexd/client/obexd-pbap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c + +obexd/client/obexd-pbap.obj: obexd/client/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-pbap.Tpo obexd/client/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/pbap.c' object='obexd/client/obexd-pbap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` + +obexd/client/obexd-ftp.o: obexd/client/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-ftp.Tpo obexd/client/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/ftp.c' object='obexd/client/obexd-ftp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c + +obexd/client/obexd-ftp.obj: obexd/client/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-ftp.Tpo obexd/client/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/ftp.c' object='obexd/client/obexd-ftp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` + +obexd/client/obexd-opp.o: obexd/client/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-opp.Tpo obexd/client/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/opp.c' object='obexd/client/obexd-opp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c + +obexd/client/obexd-opp.obj: obexd/client/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-opp.Tpo obexd/client/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/opp.c' object='obexd/client/obexd-opp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` + +obexd/client/obexd-map.o: obexd/client/map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map.Tpo obexd/client/$(DEPDIR)/obexd-map.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map.c' object='obexd/client/obexd-map.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c + +obexd/client/obexd-map.obj: obexd/client/map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map.Tpo obexd/client/$(DEPDIR)/obexd-map.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map.c' object='obexd/client/obexd-map.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` + +obexd/client/obexd-map-event.o: obexd/client/map-event.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map-event.Tpo obexd/client/$(DEPDIR)/obexd-map-event.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map-event.c' object='obexd/client/obexd-map-event.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c + +obexd/client/obexd-map-event.obj: obexd/client/map-event.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map-event.Tpo obexd/client/$(DEPDIR)/obexd-map-event.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map-event.c' object='obexd/client/obexd-map-event.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` + +obexd/client/obexd-transfer.o: obexd/client/transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transfer.Tpo obexd/client/$(DEPDIR)/obexd-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transfer.c' object='obexd/client/obexd-transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c + +obexd/client/obexd-transfer.obj: obexd/client/transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transfer.Tpo obexd/client/$(DEPDIR)/obexd-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transfer.c' object='obexd/client/obexd-transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` + +obexd/client/obexd-transport.o: obexd/client/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transport.Tpo obexd/client/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transport.c' object='obexd/client/obexd-transport.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c + +obexd/client/obexd-transport.obj: obexd/client/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transport.Tpo obexd/client/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transport.c' object='obexd/client/obexd-transport.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` + +obexd/client/obexd-dbus.o: obexd/client/dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-dbus.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-dbus.Tpo -c -o obexd/client/obexd-dbus.o `test -f 'obexd/client/dbus.c' || echo '$(srcdir)/'`obexd/client/dbus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-dbus.Tpo obexd/client/$(DEPDIR)/obexd-dbus.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/dbus.c' object='obexd/client/obexd-dbus.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-dbus.o `test -f 'obexd/client/dbus.c' || echo '$(srcdir)/'`obexd/client/dbus.c + +obexd/client/obexd-dbus.obj: obexd/client/dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-dbus.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-dbus.Tpo -c -o obexd/client/obexd-dbus.obj `if test -f 'obexd/client/dbus.c'; then $(CYGPATH_W) 'obexd/client/dbus.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/dbus.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-dbus.Tpo obexd/client/$(DEPDIR)/obexd-dbus.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/dbus.c' object='obexd/client/obexd-dbus.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-dbus.obj `if test -f 'obexd/client/dbus.c'; then $(CYGPATH_W) 'obexd/client/dbus.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/dbus.c'; fi` + +obexd/client/obexd-driver.o: obexd/client/driver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-driver.Tpo obexd/client/$(DEPDIR)/obexd-driver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/driver.c' object='obexd/client/obexd-driver.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c + +obexd/client/obexd-driver.obj: obexd/client/driver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-driver.Tpo obexd/client/$(DEPDIR)/obexd-driver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/driver.c' object='obexd/client/obexd-driver.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` + +plugins/bluetoothd-hostname.o: plugins/hostname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-hostname.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-hostname.Tpo -c -o plugins/bluetoothd-hostname.o `test -f 'plugins/hostname.c' || echo '$(srcdir)/'`plugins/hostname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-hostname.Tpo plugins/$(DEPDIR)/bluetoothd-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/hostname.c' object='plugins/bluetoothd-hostname.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-hostname.o `test -f 'plugins/hostname.c' || echo '$(srcdir)/'`plugins/hostname.c + +plugins/bluetoothd-hostname.obj: plugins/hostname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-hostname.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-hostname.Tpo -c -o plugins/bluetoothd-hostname.obj `if test -f 'plugins/hostname.c'; then $(CYGPATH_W) 'plugins/hostname.c'; else $(CYGPATH_W) '$(srcdir)/plugins/hostname.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-hostname.Tpo plugins/$(DEPDIR)/bluetoothd-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/hostname.c' object='plugins/bluetoothd-hostname.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-hostname.obj `if test -f 'plugins/hostname.c'; then $(CYGPATH_W) 'plugins/hostname.c'; else $(CYGPATH_W) '$(srcdir)/plugins/hostname.c'; fi` + +plugins/bluetoothd-wiimote.o: plugins/wiimote.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-wiimote.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo -c -o plugins/bluetoothd-wiimote.o `test -f 'plugins/wiimote.c' || echo '$(srcdir)/'`plugins/wiimote.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo plugins/$(DEPDIR)/bluetoothd-wiimote.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/wiimote.c' object='plugins/bluetoothd-wiimote.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-wiimote.o `test -f 'plugins/wiimote.c' || echo '$(srcdir)/'`plugins/wiimote.c + +plugins/bluetoothd-wiimote.obj: plugins/wiimote.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-wiimote.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo -c -o plugins/bluetoothd-wiimote.obj `if test -f 'plugins/wiimote.c'; then $(CYGPATH_W) 'plugins/wiimote.c'; else $(CYGPATH_W) '$(srcdir)/plugins/wiimote.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo plugins/$(DEPDIR)/bluetoothd-wiimote.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/wiimote.c' object='plugins/bluetoothd-wiimote.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-wiimote.obj `if test -f 'plugins/wiimote.c'; then $(CYGPATH_W) 'plugins/wiimote.c'; else $(CYGPATH_W) '$(srcdir)/plugins/wiimote.c'; fi` + +plugins/bluetoothd-autopair.o: plugins/autopair.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-autopair.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-autopair.Tpo -c -o plugins/bluetoothd-autopair.o `test -f 'plugins/autopair.c' || echo '$(srcdir)/'`plugins/autopair.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-autopair.Tpo plugins/$(DEPDIR)/bluetoothd-autopair.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/autopair.c' object='plugins/bluetoothd-autopair.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-autopair.o `test -f 'plugins/autopair.c' || echo '$(srcdir)/'`plugins/autopair.c + +plugins/bluetoothd-autopair.obj: plugins/autopair.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-autopair.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-autopair.Tpo -c -o plugins/bluetoothd-autopair.obj `if test -f 'plugins/autopair.c'; then $(CYGPATH_W) 'plugins/autopair.c'; else $(CYGPATH_W) '$(srcdir)/plugins/autopair.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-autopair.Tpo plugins/$(DEPDIR)/bluetoothd-autopair.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/autopair.c' object='plugins/bluetoothd-autopair.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-autopair.obj `if test -f 'plugins/autopair.c'; then $(CYGPATH_W) 'plugins/autopair.c'; else $(CYGPATH_W) '$(srcdir)/plugins/autopair.c'; fi` + +plugins/bluetoothd-policy.o: plugins/policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-policy.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-policy.Tpo -c -o plugins/bluetoothd-policy.o `test -f 'plugins/policy.c' || echo '$(srcdir)/'`plugins/policy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-policy.Tpo plugins/$(DEPDIR)/bluetoothd-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/policy.c' object='plugins/bluetoothd-policy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-policy.o `test -f 'plugins/policy.c' || echo '$(srcdir)/'`plugins/policy.c + +plugins/bluetoothd-policy.obj: plugins/policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-policy.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-policy.Tpo -c -o plugins/bluetoothd-policy.obj `if test -f 'plugins/policy.c'; then $(CYGPATH_W) 'plugins/policy.c'; else $(CYGPATH_W) '$(srcdir)/plugins/policy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-policy.Tpo plugins/$(DEPDIR)/bluetoothd-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/policy.c' object='plugins/bluetoothd-policy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-policy.obj `if test -f 'plugins/policy.c'; then $(CYGPATH_W) 'plugins/policy.c'; else $(CYGPATH_W) '$(srcdir)/plugins/policy.c'; fi` + +plugins/bluetoothd-gatt-example.o: plugins/gatt-example.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-gatt-example.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo -c -o plugins/bluetoothd-gatt-example.o `test -f 'plugins/gatt-example.c' || echo '$(srcdir)/'`plugins/gatt-example.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo plugins/$(DEPDIR)/bluetoothd-gatt-example.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/gatt-example.c' object='plugins/bluetoothd-gatt-example.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-gatt-example.o `test -f 'plugins/gatt-example.c' || echo '$(srcdir)/'`plugins/gatt-example.c + +plugins/bluetoothd-gatt-example.obj: plugins/gatt-example.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-gatt-example.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo -c -o plugins/bluetoothd-gatt-example.obj `if test -f 'plugins/gatt-example.c'; then $(CYGPATH_W) 'plugins/gatt-example.c'; else $(CYGPATH_W) '$(srcdir)/plugins/gatt-example.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo plugins/$(DEPDIR)/bluetoothd-gatt-example.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/gatt-example.c' object='plugins/bluetoothd-gatt-example.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-gatt-example.obj `if test -f 'plugins/gatt-example.c'; then $(CYGPATH_W) 'plugins/gatt-example.c'; else $(CYGPATH_W) '$(srcdir)/plugins/gatt-example.c'; fi` + +plugins/bluetoothd-neard.o: plugins/neard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-neard.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-neard.Tpo -c -o plugins/bluetoothd-neard.o `test -f 'plugins/neard.c' || echo '$(srcdir)/'`plugins/neard.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-neard.Tpo plugins/$(DEPDIR)/bluetoothd-neard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/neard.c' object='plugins/bluetoothd-neard.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-neard.o `test -f 'plugins/neard.c' || echo '$(srcdir)/'`plugins/neard.c + +plugins/bluetoothd-neard.obj: plugins/neard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-neard.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-neard.Tpo -c -o plugins/bluetoothd-neard.obj `if test -f 'plugins/neard.c'; then $(CYGPATH_W) 'plugins/neard.c'; else $(CYGPATH_W) '$(srcdir)/plugins/neard.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-neard.Tpo plugins/$(DEPDIR)/bluetoothd-neard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/neard.c' object='plugins/bluetoothd-neard.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-neard.obj `if test -f 'plugins/neard.c'; then $(CYGPATH_W) 'plugins/neard.c'; else $(CYGPATH_W) '$(srcdir)/plugins/neard.c'; fi` + +profiles/sap/bluetoothd-main.o: profiles/sap/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-main.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo -c -o profiles/sap/bluetoothd-main.o `test -f 'profiles/sap/main.c' || echo '$(srcdir)/'`profiles/sap/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo profiles/sap/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/main.c' object='profiles/sap/bluetoothd-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-main.o `test -f 'profiles/sap/main.c' || echo '$(srcdir)/'`profiles/sap/main.c + +profiles/sap/bluetoothd-main.obj: profiles/sap/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-main.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo -c -o profiles/sap/bluetoothd-main.obj `if test -f 'profiles/sap/main.c'; then $(CYGPATH_W) 'profiles/sap/main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo profiles/sap/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/main.c' object='profiles/sap/bluetoothd-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-main.obj `if test -f 'profiles/sap/main.c'; then $(CYGPATH_W) 'profiles/sap/main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/main.c'; fi` + +profiles/sap/bluetoothd-manager.o: profiles/sap/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-manager.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/sap/bluetoothd-manager.o `test -f 'profiles/sap/manager.c' || echo '$(srcdir)/'`profiles/sap/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo profiles/sap/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/manager.c' object='profiles/sap/bluetoothd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-manager.o `test -f 'profiles/sap/manager.c' || echo '$(srcdir)/'`profiles/sap/manager.c + +profiles/sap/bluetoothd-manager.obj: profiles/sap/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-manager.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/sap/bluetoothd-manager.obj `if test -f 'profiles/sap/manager.c'; then $(CYGPATH_W) 'profiles/sap/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo profiles/sap/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/manager.c' object='profiles/sap/bluetoothd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-manager.obj `if test -f 'profiles/sap/manager.c'; then $(CYGPATH_W) 'profiles/sap/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/manager.c'; fi` + +profiles/sap/bluetoothd-server.o: profiles/sap/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-server.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/sap/bluetoothd-server.o `test -f 'profiles/sap/server.c' || echo '$(srcdir)/'`profiles/sap/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo profiles/sap/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/server.c' object='profiles/sap/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-server.o `test -f 'profiles/sap/server.c' || echo '$(srcdir)/'`profiles/sap/server.c + +profiles/sap/bluetoothd-server.obj: profiles/sap/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-server.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/sap/bluetoothd-server.obj `if test -f 'profiles/sap/server.c'; then $(CYGPATH_W) 'profiles/sap/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo profiles/sap/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/server.c' object='profiles/sap/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-server.obj `if test -f 'profiles/sap/server.c'; then $(CYGPATH_W) 'profiles/sap/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/server.c'; fi` + +profiles/sap/bluetoothd-sap-dummy.o: profiles/sap/sap-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-sap-dummy.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo -c -o profiles/sap/bluetoothd-sap-dummy.o `test -f 'profiles/sap/sap-dummy.c' || echo '$(srcdir)/'`profiles/sap/sap-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/sap-dummy.c' object='profiles/sap/bluetoothd-sap-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-sap-dummy.o `test -f 'profiles/sap/sap-dummy.c' || echo '$(srcdir)/'`profiles/sap/sap-dummy.c + +profiles/sap/bluetoothd-sap-dummy.obj: profiles/sap/sap-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-sap-dummy.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo -c -o profiles/sap/bluetoothd-sap-dummy.obj `if test -f 'profiles/sap/sap-dummy.c'; then $(CYGPATH_W) 'profiles/sap/sap-dummy.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/sap-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/sap-dummy.c' object='profiles/sap/bluetoothd-sap-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-sap-dummy.obj `if test -f 'profiles/sap/sap-dummy.c'; then $(CYGPATH_W) 'profiles/sap/sap-dummy.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/sap-dummy.c'; fi` + +profiles/audio/bluetoothd-source.o: profiles/audio/source.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-source.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo -c -o profiles/audio/bluetoothd-source.o `test -f 'profiles/audio/source.c' || echo '$(srcdir)/'`profiles/audio/source.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo profiles/audio/$(DEPDIR)/bluetoothd-source.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/source.c' object='profiles/audio/bluetoothd-source.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-source.o `test -f 'profiles/audio/source.c' || echo '$(srcdir)/'`profiles/audio/source.c + +profiles/audio/bluetoothd-source.obj: profiles/audio/source.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-source.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo -c -o profiles/audio/bluetoothd-source.obj `if test -f 'profiles/audio/source.c'; then $(CYGPATH_W) 'profiles/audio/source.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/source.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo profiles/audio/$(DEPDIR)/bluetoothd-source.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/source.c' object='profiles/audio/bluetoothd-source.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-source.obj `if test -f 'profiles/audio/source.c'; then $(CYGPATH_W) 'profiles/audio/source.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/source.c'; fi` + +profiles/audio/bluetoothd-sink.o: profiles/audio/sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-sink.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo -c -o profiles/audio/bluetoothd-sink.o `test -f 'profiles/audio/sink.c' || echo '$(srcdir)/'`profiles/audio/sink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo profiles/audio/$(DEPDIR)/bluetoothd-sink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/sink.c' object='profiles/audio/bluetoothd-sink.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-sink.o `test -f 'profiles/audio/sink.c' || echo '$(srcdir)/'`profiles/audio/sink.c + +profiles/audio/bluetoothd-sink.obj: profiles/audio/sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-sink.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo -c -o profiles/audio/bluetoothd-sink.obj `if test -f 'profiles/audio/sink.c'; then $(CYGPATH_W) 'profiles/audio/sink.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/sink.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo profiles/audio/$(DEPDIR)/bluetoothd-sink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/sink.c' object='profiles/audio/bluetoothd-sink.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-sink.obj `if test -f 'profiles/audio/sink.c'; then $(CYGPATH_W) 'profiles/audio/sink.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/sink.c'; fi` + +profiles/audio/bluetoothd-a2dp.o: profiles/audio/a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-a2dp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo -c -o profiles/audio/bluetoothd-a2dp.o `test -f 'profiles/audio/a2dp.c' || echo '$(srcdir)/'`profiles/audio/a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/a2dp.c' object='profiles/audio/bluetoothd-a2dp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-a2dp.o `test -f 'profiles/audio/a2dp.c' || echo '$(srcdir)/'`profiles/audio/a2dp.c + +profiles/audio/bluetoothd-a2dp.obj: profiles/audio/a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-a2dp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo -c -o profiles/audio/bluetoothd-a2dp.obj `if test -f 'profiles/audio/a2dp.c'; then $(CYGPATH_W) 'profiles/audio/a2dp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/a2dp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/a2dp.c' object='profiles/audio/bluetoothd-a2dp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-a2dp.obj `if test -f 'profiles/audio/a2dp.c'; then $(CYGPATH_W) 'profiles/audio/a2dp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/a2dp.c'; fi` + +profiles/audio/bluetoothd-avdtp.o: profiles/audio/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avdtp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo -c -o profiles/audio/bluetoothd-avdtp.o `test -f 'profiles/audio/avdtp.c' || echo '$(srcdir)/'`profiles/audio/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avdtp.c' object='profiles/audio/bluetoothd-avdtp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avdtp.o `test -f 'profiles/audio/avdtp.c' || echo '$(srcdir)/'`profiles/audio/avdtp.c + +profiles/audio/bluetoothd-avdtp.obj: profiles/audio/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avdtp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo -c -o profiles/audio/bluetoothd-avdtp.obj `if test -f 'profiles/audio/avdtp.c'; then $(CYGPATH_W) 'profiles/audio/avdtp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avdtp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avdtp.c' object='profiles/audio/bluetoothd-avdtp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avdtp.obj `if test -f 'profiles/audio/avdtp.c'; then $(CYGPATH_W) 'profiles/audio/avdtp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avdtp.c'; fi` + +profiles/audio/bluetoothd-media.o: profiles/audio/media.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-media.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo -c -o profiles/audio/bluetoothd-media.o `test -f 'profiles/audio/media.c' || echo '$(srcdir)/'`profiles/audio/media.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo profiles/audio/$(DEPDIR)/bluetoothd-media.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/media.c' object='profiles/audio/bluetoothd-media.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-media.o `test -f 'profiles/audio/media.c' || echo '$(srcdir)/'`profiles/audio/media.c + +profiles/audio/bluetoothd-media.obj: profiles/audio/media.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-media.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo -c -o profiles/audio/bluetoothd-media.obj `if test -f 'profiles/audio/media.c'; then $(CYGPATH_W) 'profiles/audio/media.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/media.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo profiles/audio/$(DEPDIR)/bluetoothd-media.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/media.c' object='profiles/audio/bluetoothd-media.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-media.obj `if test -f 'profiles/audio/media.c'; then $(CYGPATH_W) 'profiles/audio/media.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/media.c'; fi` + +profiles/audio/bluetoothd-transport.o: profiles/audio/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-transport.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo -c -o profiles/audio/bluetoothd-transport.o `test -f 'profiles/audio/transport.c' || echo '$(srcdir)/'`profiles/audio/transport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo profiles/audio/$(DEPDIR)/bluetoothd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/transport.c' object='profiles/audio/bluetoothd-transport.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-transport.o `test -f 'profiles/audio/transport.c' || echo '$(srcdir)/'`profiles/audio/transport.c + +profiles/audio/bluetoothd-transport.obj: profiles/audio/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-transport.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo -c -o profiles/audio/bluetoothd-transport.obj `if test -f 'profiles/audio/transport.c'; then $(CYGPATH_W) 'profiles/audio/transport.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo profiles/audio/$(DEPDIR)/bluetoothd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/transport.c' object='profiles/audio/bluetoothd-transport.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-transport.obj `if test -f 'profiles/audio/transport.c'; then $(CYGPATH_W) 'profiles/audio/transport.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/transport.c'; fi` + +profiles/audio/bluetoothd-control.o: profiles/audio/control.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-control.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo -c -o profiles/audio/bluetoothd-control.o `test -f 'profiles/audio/control.c' || echo '$(srcdir)/'`profiles/audio/control.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo profiles/audio/$(DEPDIR)/bluetoothd-control.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/control.c' object='profiles/audio/bluetoothd-control.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-control.o `test -f 'profiles/audio/control.c' || echo '$(srcdir)/'`profiles/audio/control.c + +profiles/audio/bluetoothd-control.obj: profiles/audio/control.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-control.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo -c -o profiles/audio/bluetoothd-control.obj `if test -f 'profiles/audio/control.c'; then $(CYGPATH_W) 'profiles/audio/control.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/control.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo profiles/audio/$(DEPDIR)/bluetoothd-control.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/control.c' object='profiles/audio/bluetoothd-control.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-control.obj `if test -f 'profiles/audio/control.c'; then $(CYGPATH_W) 'profiles/audio/control.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/control.c'; fi` + +profiles/audio/bluetoothd-avctp.o: profiles/audio/avctp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avctp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo -c -o profiles/audio/bluetoothd-avctp.o `test -f 'profiles/audio/avctp.c' || echo '$(srcdir)/'`profiles/audio/avctp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avctp.c' object='profiles/audio/bluetoothd-avctp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avctp.o `test -f 'profiles/audio/avctp.c' || echo '$(srcdir)/'`profiles/audio/avctp.c + +profiles/audio/bluetoothd-avctp.obj: profiles/audio/avctp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avctp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo -c -o profiles/audio/bluetoothd-avctp.obj `if test -f 'profiles/audio/avctp.c'; then $(CYGPATH_W) 'profiles/audio/avctp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avctp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avctp.c' object='profiles/audio/bluetoothd-avctp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avctp.obj `if test -f 'profiles/audio/avctp.c'; then $(CYGPATH_W) 'profiles/audio/avctp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avctp.c'; fi` + +profiles/audio/bluetoothd-avrcp.o: profiles/audio/avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avrcp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo -c -o profiles/audio/bluetoothd-avrcp.o `test -f 'profiles/audio/avrcp.c' || echo '$(srcdir)/'`profiles/audio/avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avrcp.c' object='profiles/audio/bluetoothd-avrcp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avrcp.o `test -f 'profiles/audio/avrcp.c' || echo '$(srcdir)/'`profiles/audio/avrcp.c + +profiles/audio/bluetoothd-avrcp.obj: profiles/audio/avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avrcp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo -c -o profiles/audio/bluetoothd-avrcp.obj `if test -f 'profiles/audio/avrcp.c'; then $(CYGPATH_W) 'profiles/audio/avrcp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avrcp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avrcp.c' object='profiles/audio/bluetoothd-avrcp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avrcp.obj `if test -f 'profiles/audio/avrcp.c'; then $(CYGPATH_W) 'profiles/audio/avrcp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avrcp.c'; fi` + +profiles/audio/bluetoothd-player.o: profiles/audio/player.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-player.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo -c -o profiles/audio/bluetoothd-player.o `test -f 'profiles/audio/player.c' || echo '$(srcdir)/'`profiles/audio/player.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo profiles/audio/$(DEPDIR)/bluetoothd-player.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/player.c' object='profiles/audio/bluetoothd-player.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-player.o `test -f 'profiles/audio/player.c' || echo '$(srcdir)/'`profiles/audio/player.c + +profiles/audio/bluetoothd-player.obj: profiles/audio/player.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-player.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo -c -o profiles/audio/bluetoothd-player.obj `if test -f 'profiles/audio/player.c'; then $(CYGPATH_W) 'profiles/audio/player.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/player.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo profiles/audio/$(DEPDIR)/bluetoothd-player.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/player.c' object='profiles/audio/bluetoothd-player.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-player.obj `if test -f 'profiles/audio/player.c'; then $(CYGPATH_W) 'profiles/audio/player.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/player.c'; fi` + +profiles/network/bluetoothd-manager.o: profiles/network/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-manager.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/network/bluetoothd-manager.o `test -f 'profiles/network/manager.c' || echo '$(srcdir)/'`profiles/network/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo profiles/network/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/manager.c' object='profiles/network/bluetoothd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-manager.o `test -f 'profiles/network/manager.c' || echo '$(srcdir)/'`profiles/network/manager.c + +profiles/network/bluetoothd-manager.obj: profiles/network/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-manager.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/network/bluetoothd-manager.obj `if test -f 'profiles/network/manager.c'; then $(CYGPATH_W) 'profiles/network/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo profiles/network/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/manager.c' object='profiles/network/bluetoothd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-manager.obj `if test -f 'profiles/network/manager.c'; then $(CYGPATH_W) 'profiles/network/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/manager.c'; fi` + +profiles/network/bluetoothd-bnep.o: profiles/network/bnep.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-bnep.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo -c -o profiles/network/bluetoothd-bnep.o `test -f 'profiles/network/bnep.c' || echo '$(srcdir)/'`profiles/network/bnep.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo profiles/network/$(DEPDIR)/bluetoothd-bnep.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/bnep.c' object='profiles/network/bluetoothd-bnep.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-bnep.o `test -f 'profiles/network/bnep.c' || echo '$(srcdir)/'`profiles/network/bnep.c + +profiles/network/bluetoothd-bnep.obj: profiles/network/bnep.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-bnep.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo -c -o profiles/network/bluetoothd-bnep.obj `if test -f 'profiles/network/bnep.c'; then $(CYGPATH_W) 'profiles/network/bnep.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/bnep.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo profiles/network/$(DEPDIR)/bluetoothd-bnep.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/bnep.c' object='profiles/network/bluetoothd-bnep.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-bnep.obj `if test -f 'profiles/network/bnep.c'; then $(CYGPATH_W) 'profiles/network/bnep.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/bnep.c'; fi` + +profiles/network/bluetoothd-server.o: profiles/network/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-server.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/network/bluetoothd-server.o `test -f 'profiles/network/server.c' || echo '$(srcdir)/'`profiles/network/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-server.Tpo profiles/network/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/server.c' object='profiles/network/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-server.o `test -f 'profiles/network/server.c' || echo '$(srcdir)/'`profiles/network/server.c + +profiles/network/bluetoothd-server.obj: profiles/network/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-server.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/network/bluetoothd-server.obj `if test -f 'profiles/network/server.c'; then $(CYGPATH_W) 'profiles/network/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-server.Tpo profiles/network/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/server.c' object='profiles/network/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-server.obj `if test -f 'profiles/network/server.c'; then $(CYGPATH_W) 'profiles/network/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/server.c'; fi` + +profiles/network/bluetoothd-connection.o: profiles/network/connection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-connection.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo -c -o profiles/network/bluetoothd-connection.o `test -f 'profiles/network/connection.c' || echo '$(srcdir)/'`profiles/network/connection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo profiles/network/$(DEPDIR)/bluetoothd-connection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/connection.c' object='profiles/network/bluetoothd-connection.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-connection.o `test -f 'profiles/network/connection.c' || echo '$(srcdir)/'`profiles/network/connection.c + +profiles/network/bluetoothd-connection.obj: profiles/network/connection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-connection.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo -c -o profiles/network/bluetoothd-connection.obj `if test -f 'profiles/network/connection.c'; then $(CYGPATH_W) 'profiles/network/connection.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/connection.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo profiles/network/$(DEPDIR)/bluetoothd-connection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/connection.c' object='profiles/network/bluetoothd-connection.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-connection.obj `if test -f 'profiles/network/connection.c'; then $(CYGPATH_W) 'profiles/network/connection.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/connection.c'; fi` + +profiles/input/bluetoothd-manager.o: profiles/input/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-manager.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/input/bluetoothd-manager.o `test -f 'profiles/input/manager.c' || echo '$(srcdir)/'`profiles/input/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo profiles/input/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/manager.c' object='profiles/input/bluetoothd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-manager.o `test -f 'profiles/input/manager.c' || echo '$(srcdir)/'`profiles/input/manager.c + +profiles/input/bluetoothd-manager.obj: profiles/input/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-manager.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/input/bluetoothd-manager.obj `if test -f 'profiles/input/manager.c'; then $(CYGPATH_W) 'profiles/input/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo profiles/input/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/manager.c' object='profiles/input/bluetoothd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-manager.obj `if test -f 'profiles/input/manager.c'; then $(CYGPATH_W) 'profiles/input/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/manager.c'; fi` + +profiles/input/bluetoothd-server.o: profiles/input/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-server.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/input/bluetoothd-server.o `test -f 'profiles/input/server.c' || echo '$(srcdir)/'`profiles/input/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-server.Tpo profiles/input/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/server.c' object='profiles/input/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-server.o `test -f 'profiles/input/server.c' || echo '$(srcdir)/'`profiles/input/server.c + +profiles/input/bluetoothd-server.obj: profiles/input/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-server.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/input/bluetoothd-server.obj `if test -f 'profiles/input/server.c'; then $(CYGPATH_W) 'profiles/input/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-server.Tpo profiles/input/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/server.c' object='profiles/input/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-server.obj `if test -f 'profiles/input/server.c'; then $(CYGPATH_W) 'profiles/input/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/server.c'; fi` + +profiles/input/bluetoothd-device.o: profiles/input/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-device.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-device.Tpo -c -o profiles/input/bluetoothd-device.o `test -f 'profiles/input/device.c' || echo '$(srcdir)/'`profiles/input/device.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-device.Tpo profiles/input/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/device.c' object='profiles/input/bluetoothd-device.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-device.o `test -f 'profiles/input/device.c' || echo '$(srcdir)/'`profiles/input/device.c + +profiles/input/bluetoothd-device.obj: profiles/input/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-device.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-device.Tpo -c -o profiles/input/bluetoothd-device.obj `if test -f 'profiles/input/device.c'; then $(CYGPATH_W) 'profiles/input/device.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/device.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-device.Tpo profiles/input/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/device.c' object='profiles/input/bluetoothd-device.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-device.obj `if test -f 'profiles/input/device.c'; then $(CYGPATH_W) 'profiles/input/device.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/device.c'; fi` + +profiles/input/bluetoothd-hog.o: profiles/input/hog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-hog.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo -c -o profiles/input/bluetoothd-hog.o `test -f 'profiles/input/hog.c' || echo '$(srcdir)/'`profiles/input/hog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo profiles/input/$(DEPDIR)/bluetoothd-hog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/hog.c' object='profiles/input/bluetoothd-hog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-hog.o `test -f 'profiles/input/hog.c' || echo '$(srcdir)/'`profiles/input/hog.c + +profiles/input/bluetoothd-hog.obj: profiles/input/hog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-hog.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo -c -o profiles/input/bluetoothd-hog.obj `if test -f 'profiles/input/hog.c'; then $(CYGPATH_W) 'profiles/input/hog.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/hog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo profiles/input/$(DEPDIR)/bluetoothd-hog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/hog.c' object='profiles/input/bluetoothd-hog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-hog.obj `if test -f 'profiles/input/hog.c'; then $(CYGPATH_W) 'profiles/input/hog.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/hog.c'; fi` + +profiles/input/bluetoothd-hog-lib.o: profiles/input/hog-lib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-hog-lib.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-hog-lib.Tpo -c -o profiles/input/bluetoothd-hog-lib.o `test -f 'profiles/input/hog-lib.c' || echo '$(srcdir)/'`profiles/input/hog-lib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-hog-lib.Tpo profiles/input/$(DEPDIR)/bluetoothd-hog-lib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/hog-lib.c' object='profiles/input/bluetoothd-hog-lib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-hog-lib.o `test -f 'profiles/input/hog-lib.c' || echo '$(srcdir)/'`profiles/input/hog-lib.c + +profiles/input/bluetoothd-hog-lib.obj: profiles/input/hog-lib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-hog-lib.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-hog-lib.Tpo -c -o profiles/input/bluetoothd-hog-lib.obj `if test -f 'profiles/input/hog-lib.c'; then $(CYGPATH_W) 'profiles/input/hog-lib.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/hog-lib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-hog-lib.Tpo profiles/input/$(DEPDIR)/bluetoothd-hog-lib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/hog-lib.c' object='profiles/input/bluetoothd-hog-lib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-hog-lib.obj `if test -f 'profiles/input/hog-lib.c'; then $(CYGPATH_W) 'profiles/input/hog-lib.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/hog-lib.c'; fi` + +profiles/deviceinfo/bluetoothd-dis.o: profiles/deviceinfo/dis.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/deviceinfo/bluetoothd-dis.o -MD -MP -MF profiles/deviceinfo/$(DEPDIR)/bluetoothd-dis.Tpo -c -o profiles/deviceinfo/bluetoothd-dis.o `test -f 'profiles/deviceinfo/dis.c' || echo '$(srcdir)/'`profiles/deviceinfo/dis.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/deviceinfo/$(DEPDIR)/bluetoothd-dis.Tpo profiles/deviceinfo/$(DEPDIR)/bluetoothd-dis.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/deviceinfo/dis.c' object='profiles/deviceinfo/bluetoothd-dis.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/deviceinfo/bluetoothd-dis.o `test -f 'profiles/deviceinfo/dis.c' || echo '$(srcdir)/'`profiles/deviceinfo/dis.c + +profiles/deviceinfo/bluetoothd-dis.obj: profiles/deviceinfo/dis.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/deviceinfo/bluetoothd-dis.obj -MD -MP -MF profiles/deviceinfo/$(DEPDIR)/bluetoothd-dis.Tpo -c -o profiles/deviceinfo/bluetoothd-dis.obj `if test -f 'profiles/deviceinfo/dis.c'; then $(CYGPATH_W) 'profiles/deviceinfo/dis.c'; else $(CYGPATH_W) '$(srcdir)/profiles/deviceinfo/dis.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/deviceinfo/$(DEPDIR)/bluetoothd-dis.Tpo profiles/deviceinfo/$(DEPDIR)/bluetoothd-dis.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/deviceinfo/dis.c' object='profiles/deviceinfo/bluetoothd-dis.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/deviceinfo/bluetoothd-dis.obj `if test -f 'profiles/deviceinfo/dis.c'; then $(CYGPATH_W) 'profiles/deviceinfo/dis.c'; else $(CYGPATH_W) '$(srcdir)/profiles/deviceinfo/dis.c'; fi` + +profiles/battery/bluetoothd-bas.o: profiles/battery/bas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/battery/bluetoothd-bas.o -MD -MP -MF profiles/battery/$(DEPDIR)/bluetoothd-bas.Tpo -c -o profiles/battery/bluetoothd-bas.o `test -f 'profiles/battery/bas.c' || echo '$(srcdir)/'`profiles/battery/bas.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/battery/$(DEPDIR)/bluetoothd-bas.Tpo profiles/battery/$(DEPDIR)/bluetoothd-bas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/battery/bas.c' object='profiles/battery/bluetoothd-bas.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/battery/bluetoothd-bas.o `test -f 'profiles/battery/bas.c' || echo '$(srcdir)/'`profiles/battery/bas.c + +profiles/battery/bluetoothd-bas.obj: profiles/battery/bas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/battery/bluetoothd-bas.obj -MD -MP -MF profiles/battery/$(DEPDIR)/bluetoothd-bas.Tpo -c -o profiles/battery/bluetoothd-bas.obj `if test -f 'profiles/battery/bas.c'; then $(CYGPATH_W) 'profiles/battery/bas.c'; else $(CYGPATH_W) '$(srcdir)/profiles/battery/bas.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/battery/$(DEPDIR)/bluetoothd-bas.Tpo profiles/battery/$(DEPDIR)/bluetoothd-bas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/battery/bas.c' object='profiles/battery/bluetoothd-bas.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/battery/bluetoothd-bas.obj `if test -f 'profiles/battery/bas.c'; then $(CYGPATH_W) 'profiles/battery/bas.c'; else $(CYGPATH_W) '$(srcdir)/profiles/battery/bas.c'; fi` + +profiles/scanparam/bluetoothd-scpp.o: profiles/scanparam/scpp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/scanparam/bluetoothd-scpp.o -MD -MP -MF profiles/scanparam/$(DEPDIR)/bluetoothd-scpp.Tpo -c -o profiles/scanparam/bluetoothd-scpp.o `test -f 'profiles/scanparam/scpp.c' || echo '$(srcdir)/'`profiles/scanparam/scpp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/scanparam/$(DEPDIR)/bluetoothd-scpp.Tpo profiles/scanparam/$(DEPDIR)/bluetoothd-scpp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/scanparam/scpp.c' object='profiles/scanparam/bluetoothd-scpp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/scanparam/bluetoothd-scpp.o `test -f 'profiles/scanparam/scpp.c' || echo '$(srcdir)/'`profiles/scanparam/scpp.c + +profiles/scanparam/bluetoothd-scpp.obj: profiles/scanparam/scpp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/scanparam/bluetoothd-scpp.obj -MD -MP -MF profiles/scanparam/$(DEPDIR)/bluetoothd-scpp.Tpo -c -o profiles/scanparam/bluetoothd-scpp.obj `if test -f 'profiles/scanparam/scpp.c'; then $(CYGPATH_W) 'profiles/scanparam/scpp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/scanparam/scpp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/scanparam/$(DEPDIR)/bluetoothd-scpp.Tpo profiles/scanparam/$(DEPDIR)/bluetoothd-scpp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/scanparam/scpp.c' object='profiles/scanparam/bluetoothd-scpp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/scanparam/bluetoothd-scpp.obj `if test -f 'profiles/scanparam/scpp.c'; then $(CYGPATH_W) 'profiles/scanparam/scpp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/scanparam/scpp.c'; fi` + +profiles/input/bluetoothd-suspend-none.o: profiles/input/suspend-none.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-suspend-none.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-suspend-none.Tpo -c -o profiles/input/bluetoothd-suspend-none.o `test -f 'profiles/input/suspend-none.c' || echo '$(srcdir)/'`profiles/input/suspend-none.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-suspend-none.Tpo profiles/input/$(DEPDIR)/bluetoothd-suspend-none.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/suspend-none.c' object='profiles/input/bluetoothd-suspend-none.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-suspend-none.o `test -f 'profiles/input/suspend-none.c' || echo '$(srcdir)/'`profiles/input/suspend-none.c + +profiles/input/bluetoothd-suspend-none.obj: profiles/input/suspend-none.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-suspend-none.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-suspend-none.Tpo -c -o profiles/input/bluetoothd-suspend-none.obj `if test -f 'profiles/input/suspend-none.c'; then $(CYGPATH_W) 'profiles/input/suspend-none.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/suspend-none.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-suspend-none.Tpo profiles/input/$(DEPDIR)/bluetoothd-suspend-none.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/suspend-none.c' object='profiles/input/bluetoothd-suspend-none.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-suspend-none.obj `if test -f 'profiles/input/suspend-none.c'; then $(CYGPATH_W) 'profiles/input/suspend-none.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/suspend-none.c'; fi` + +profiles/health/bluetoothd-mcap.o: profiles/health/mcap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-mcap.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo -c -o profiles/health/bluetoothd-mcap.o `test -f 'profiles/health/mcap.c' || echo '$(srcdir)/'`profiles/health/mcap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo profiles/health/$(DEPDIR)/bluetoothd-mcap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/mcap.c' object='profiles/health/bluetoothd-mcap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-mcap.o `test -f 'profiles/health/mcap.c' || echo '$(srcdir)/'`profiles/health/mcap.c + +profiles/health/bluetoothd-mcap.obj: profiles/health/mcap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-mcap.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo -c -o profiles/health/bluetoothd-mcap.obj `if test -f 'profiles/health/mcap.c'; then $(CYGPATH_W) 'profiles/health/mcap.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/mcap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo profiles/health/$(DEPDIR)/bluetoothd-mcap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/mcap.c' object='profiles/health/bluetoothd-mcap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-mcap.obj `if test -f 'profiles/health/mcap.c'; then $(CYGPATH_W) 'profiles/health/mcap.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/mcap.c'; fi` + +profiles/health/bluetoothd-hdp_main.o: profiles/health/hdp_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_main.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo -c -o profiles/health/bluetoothd-hdp_main.o `test -f 'profiles/health/hdp_main.c' || echo '$(srcdir)/'`profiles/health/hdp_main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_main.c' object='profiles/health/bluetoothd-hdp_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_main.o `test -f 'profiles/health/hdp_main.c' || echo '$(srcdir)/'`profiles/health/hdp_main.c + +profiles/health/bluetoothd-hdp_main.obj: profiles/health/hdp_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_main.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo -c -o profiles/health/bluetoothd-hdp_main.obj `if test -f 'profiles/health/hdp_main.c'; then $(CYGPATH_W) 'profiles/health/hdp_main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_main.c' object='profiles/health/bluetoothd-hdp_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_main.obj `if test -f 'profiles/health/hdp_main.c'; then $(CYGPATH_W) 'profiles/health/hdp_main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_main.c'; fi` + +profiles/health/bluetoothd-hdp_manager.o: profiles/health/hdp_manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_manager.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo -c -o profiles/health/bluetoothd-hdp_manager.o `test -f 'profiles/health/hdp_manager.c' || echo '$(srcdir)/'`profiles/health/hdp_manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_manager.c' object='profiles/health/bluetoothd-hdp_manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_manager.o `test -f 'profiles/health/hdp_manager.c' || echo '$(srcdir)/'`profiles/health/hdp_manager.c + +profiles/health/bluetoothd-hdp_manager.obj: profiles/health/hdp_manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_manager.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo -c -o profiles/health/bluetoothd-hdp_manager.obj `if test -f 'profiles/health/hdp_manager.c'; then $(CYGPATH_W) 'profiles/health/hdp_manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_manager.c' object='profiles/health/bluetoothd-hdp_manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_manager.obj `if test -f 'profiles/health/hdp_manager.c'; then $(CYGPATH_W) 'profiles/health/hdp_manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_manager.c'; fi` + +profiles/health/bluetoothd-hdp.o: profiles/health/hdp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo -c -o profiles/health/bluetoothd-hdp.o `test -f 'profiles/health/hdp.c' || echo '$(srcdir)/'`profiles/health/hdp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp.c' object='profiles/health/bluetoothd-hdp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp.o `test -f 'profiles/health/hdp.c' || echo '$(srcdir)/'`profiles/health/hdp.c + +profiles/health/bluetoothd-hdp.obj: profiles/health/hdp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo -c -o profiles/health/bluetoothd-hdp.obj `if test -f 'profiles/health/hdp.c'; then $(CYGPATH_W) 'profiles/health/hdp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp.c' object='profiles/health/bluetoothd-hdp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp.obj `if test -f 'profiles/health/hdp.c'; then $(CYGPATH_W) 'profiles/health/hdp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp.c'; fi` + +profiles/health/bluetoothd-hdp_util.o: profiles/health/hdp_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_util.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo -c -o profiles/health/bluetoothd-hdp_util.o `test -f 'profiles/health/hdp_util.c' || echo '$(srcdir)/'`profiles/health/hdp_util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_util.c' object='profiles/health/bluetoothd-hdp_util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_util.o `test -f 'profiles/health/hdp_util.c' || echo '$(srcdir)/'`profiles/health/hdp_util.c + +profiles/health/bluetoothd-hdp_util.obj: profiles/health/hdp_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_util.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo -c -o profiles/health/bluetoothd-hdp_util.obj `if test -f 'profiles/health/hdp_util.c'; then $(CYGPATH_W) 'profiles/health/hdp_util.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_util.c' object='profiles/health/bluetoothd-hdp_util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_util.obj `if test -f 'profiles/health/hdp_util.c'; then $(CYGPATH_W) 'profiles/health/hdp_util.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_util.c'; fi` + +profiles/gap/bluetoothd-gas.o: profiles/gap/gas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/gap/bluetoothd-gas.o -MD -MP -MF profiles/gap/$(DEPDIR)/bluetoothd-gas.Tpo -c -o profiles/gap/bluetoothd-gas.o `test -f 'profiles/gap/gas.c' || echo '$(srcdir)/'`profiles/gap/gas.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/gap/$(DEPDIR)/bluetoothd-gas.Tpo profiles/gap/$(DEPDIR)/bluetoothd-gas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/gap/gas.c' object='profiles/gap/bluetoothd-gas.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/gap/bluetoothd-gas.o `test -f 'profiles/gap/gas.c' || echo '$(srcdir)/'`profiles/gap/gas.c + +profiles/gap/bluetoothd-gas.obj: profiles/gap/gas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/gap/bluetoothd-gas.obj -MD -MP -MF profiles/gap/$(DEPDIR)/bluetoothd-gas.Tpo -c -o profiles/gap/bluetoothd-gas.obj `if test -f 'profiles/gap/gas.c'; then $(CYGPATH_W) 'profiles/gap/gas.c'; else $(CYGPATH_W) '$(srcdir)/profiles/gap/gas.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/gap/$(DEPDIR)/bluetoothd-gas.Tpo profiles/gap/$(DEPDIR)/bluetoothd-gas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/gap/gas.c' object='profiles/gap/bluetoothd-gas.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/gap/bluetoothd-gas.obj `if test -f 'profiles/gap/gas.c'; then $(CYGPATH_W) 'profiles/gap/gas.c'; else $(CYGPATH_W) '$(srcdir)/profiles/gap/gas.c'; fi` + +profiles/scanparam/bluetoothd-scan.o: profiles/scanparam/scan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/scanparam/bluetoothd-scan.o -MD -MP -MF profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo -c -o profiles/scanparam/bluetoothd-scan.o `test -f 'profiles/scanparam/scan.c' || echo '$(srcdir)/'`profiles/scanparam/scan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/scanparam/scan.c' object='profiles/scanparam/bluetoothd-scan.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/scanparam/bluetoothd-scan.o `test -f 'profiles/scanparam/scan.c' || echo '$(srcdir)/'`profiles/scanparam/scan.c + +profiles/scanparam/bluetoothd-scan.obj: profiles/scanparam/scan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/scanparam/bluetoothd-scan.obj -MD -MP -MF profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo -c -o profiles/scanparam/bluetoothd-scan.obj `if test -f 'profiles/scanparam/scan.c'; then $(CYGPATH_W) 'profiles/scanparam/scan.c'; else $(CYGPATH_W) '$(srcdir)/profiles/scanparam/scan.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/scanparam/scan.c' object='profiles/scanparam/bluetoothd-scan.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/scanparam/bluetoothd-scan.obj `if test -f 'profiles/scanparam/scan.c'; then $(CYGPATH_W) 'profiles/scanparam/scan.c'; else $(CYGPATH_W) '$(srcdir)/profiles/scanparam/scan.c'; fi` + +profiles/deviceinfo/bluetoothd-deviceinfo.o: profiles/deviceinfo/deviceinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/deviceinfo/bluetoothd-deviceinfo.o -MD -MP -MF profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo -c -o profiles/deviceinfo/bluetoothd-deviceinfo.o `test -f 'profiles/deviceinfo/deviceinfo.c' || echo '$(srcdir)/'`profiles/deviceinfo/deviceinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/deviceinfo/deviceinfo.c' object='profiles/deviceinfo/bluetoothd-deviceinfo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/deviceinfo/bluetoothd-deviceinfo.o `test -f 'profiles/deviceinfo/deviceinfo.c' || echo '$(srcdir)/'`profiles/deviceinfo/deviceinfo.c + +profiles/deviceinfo/bluetoothd-deviceinfo.obj: profiles/deviceinfo/deviceinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/deviceinfo/bluetoothd-deviceinfo.obj -MD -MP -MF profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo -c -o profiles/deviceinfo/bluetoothd-deviceinfo.obj `if test -f 'profiles/deviceinfo/deviceinfo.c'; then $(CYGPATH_W) 'profiles/deviceinfo/deviceinfo.c'; else $(CYGPATH_W) '$(srcdir)/profiles/deviceinfo/deviceinfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/deviceinfo/deviceinfo.c' object='profiles/deviceinfo/bluetoothd-deviceinfo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/deviceinfo/bluetoothd-deviceinfo.obj `if test -f 'profiles/deviceinfo/deviceinfo.c'; then $(CYGPATH_W) 'profiles/deviceinfo/deviceinfo.c'; else $(CYGPATH_W) '$(srcdir)/profiles/deviceinfo/deviceinfo.c'; fi` + +attrib/bluetoothd-att.o: attrib/att.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-att.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-att.Tpo -c -o attrib/bluetoothd-att.o `test -f 'attrib/att.c' || echo '$(srcdir)/'`attrib/att.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-att.Tpo attrib/$(DEPDIR)/bluetoothd-att.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/att.c' object='attrib/bluetoothd-att.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-att.o `test -f 'attrib/att.c' || echo '$(srcdir)/'`attrib/att.c + +attrib/bluetoothd-att.obj: attrib/att.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-att.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-att.Tpo -c -o attrib/bluetoothd-att.obj `if test -f 'attrib/att.c'; then $(CYGPATH_W) 'attrib/att.c'; else $(CYGPATH_W) '$(srcdir)/attrib/att.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-att.Tpo attrib/$(DEPDIR)/bluetoothd-att.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/att.c' object='attrib/bluetoothd-att.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-att.obj `if test -f 'attrib/att.c'; then $(CYGPATH_W) 'attrib/att.c'; else $(CYGPATH_W) '$(srcdir)/attrib/att.c'; fi` + +attrib/bluetoothd-gatt.o: attrib/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt.Tpo -c -o attrib/bluetoothd-gatt.o `test -f 'attrib/gatt.c' || echo '$(srcdir)/'`attrib/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt.Tpo attrib/$(DEPDIR)/bluetoothd-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt.c' object='attrib/bluetoothd-gatt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt.o `test -f 'attrib/gatt.c' || echo '$(srcdir)/'`attrib/gatt.c + +attrib/bluetoothd-gatt.obj: attrib/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt.Tpo -c -o attrib/bluetoothd-gatt.obj `if test -f 'attrib/gatt.c'; then $(CYGPATH_W) 'attrib/gatt.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt.Tpo attrib/$(DEPDIR)/bluetoothd-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt.c' object='attrib/bluetoothd-gatt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt.obj `if test -f 'attrib/gatt.c'; then $(CYGPATH_W) 'attrib/gatt.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt.c'; fi` + +attrib/bluetoothd-gattrib.o: attrib/gattrib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gattrib.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo -c -o attrib/bluetoothd-gattrib.o `test -f 'attrib/gattrib.c' || echo '$(srcdir)/'`attrib/gattrib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo attrib/$(DEPDIR)/bluetoothd-gattrib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gattrib.c' object='attrib/bluetoothd-gattrib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gattrib.o `test -f 'attrib/gattrib.c' || echo '$(srcdir)/'`attrib/gattrib.c + +attrib/bluetoothd-gattrib.obj: attrib/gattrib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gattrib.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo -c -o attrib/bluetoothd-gattrib.obj `if test -f 'attrib/gattrib.c'; then $(CYGPATH_W) 'attrib/gattrib.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gattrib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo attrib/$(DEPDIR)/bluetoothd-gattrib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gattrib.c' object='attrib/bluetoothd-gattrib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gattrib.obj `if test -f 'attrib/gattrib.c'; then $(CYGPATH_W) 'attrib/gattrib.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gattrib.c'; fi` + +attrib/bluetoothd-gatt-service.o: attrib/gatt-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt-service.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo -c -o attrib/bluetoothd-gatt-service.o `test -f 'attrib/gatt-service.c' || echo '$(srcdir)/'`attrib/gatt-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo attrib/$(DEPDIR)/bluetoothd-gatt-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt-service.c' object='attrib/bluetoothd-gatt-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt-service.o `test -f 'attrib/gatt-service.c' || echo '$(srcdir)/'`attrib/gatt-service.c + +attrib/bluetoothd-gatt-service.obj: attrib/gatt-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt-service.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo -c -o attrib/bluetoothd-gatt-service.obj `if test -f 'attrib/gatt-service.c'; then $(CYGPATH_W) 'attrib/gatt-service.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt-service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo attrib/$(DEPDIR)/bluetoothd-gatt-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt-service.c' object='attrib/bluetoothd-gatt-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt-service.obj `if test -f 'attrib/gatt-service.c'; then $(CYGPATH_W) 'attrib/gatt-service.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt-service.c'; fi` + +btio/bluetoothd-btio.o: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT btio/bluetoothd-btio.o -MD -MP -MF btio/$(DEPDIR)/bluetoothd-btio.Tpo -c -o btio/bluetoothd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/bluetoothd-btio.Tpo btio/$(DEPDIR)/bluetoothd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/bluetoothd-btio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o btio/bluetoothd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c + +btio/bluetoothd-btio.obj: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT btio/bluetoothd-btio.obj -MD -MP -MF btio/$(DEPDIR)/bluetoothd-btio.Tpo -c -o btio/bluetoothd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/bluetoothd-btio.Tpo btio/$(DEPDIR)/bluetoothd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/bluetoothd-btio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o btio/bluetoothd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` + +src/bluetoothd-main.o: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-main.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-main.Tpo -c -o src/bluetoothd-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-main.Tpo src/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bluetoothd-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c + +src/bluetoothd-main.obj: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-main.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-main.Tpo -c -o src/bluetoothd-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-main.Tpo src/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bluetoothd-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` + +src/bluetoothd-log.o: src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-log.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-log.Tpo -c -o src/bluetoothd-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-log.Tpo src/$(DEPDIR)/bluetoothd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/bluetoothd-log.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c + +src/bluetoothd-log.obj: src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-log.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-log.Tpo -c -o src/bluetoothd-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-log.Tpo src/$(DEPDIR)/bluetoothd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/bluetoothd-log.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` + +src/bluetoothd-backtrace.o: src/backtrace.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-backtrace.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-backtrace.Tpo -c -o src/bluetoothd-backtrace.o `test -f 'src/backtrace.c' || echo '$(srcdir)/'`src/backtrace.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-backtrace.Tpo src/$(DEPDIR)/bluetoothd-backtrace.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/backtrace.c' object='src/bluetoothd-backtrace.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-backtrace.o `test -f 'src/backtrace.c' || echo '$(srcdir)/'`src/backtrace.c + +src/bluetoothd-backtrace.obj: src/backtrace.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-backtrace.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-backtrace.Tpo -c -o src/bluetoothd-backtrace.obj `if test -f 'src/backtrace.c'; then $(CYGPATH_W) 'src/backtrace.c'; else $(CYGPATH_W) '$(srcdir)/src/backtrace.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-backtrace.Tpo src/$(DEPDIR)/bluetoothd-backtrace.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/backtrace.c' object='src/bluetoothd-backtrace.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-backtrace.obj `if test -f 'src/backtrace.c'; then $(CYGPATH_W) 'src/backtrace.c'; else $(CYGPATH_W) '$(srcdir)/src/backtrace.c'; fi` + +src/bluetoothd-systemd.o: src/systemd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-systemd.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-systemd.Tpo -c -o src/bluetoothd-systemd.o `test -f 'src/systemd.c' || echo '$(srcdir)/'`src/systemd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-systemd.Tpo src/$(DEPDIR)/bluetoothd-systemd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/systemd.c' object='src/bluetoothd-systemd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-systemd.o `test -f 'src/systemd.c' || echo '$(srcdir)/'`src/systemd.c + +src/bluetoothd-systemd.obj: src/systemd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-systemd.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-systemd.Tpo -c -o src/bluetoothd-systemd.obj `if test -f 'src/systemd.c'; then $(CYGPATH_W) 'src/systemd.c'; else $(CYGPATH_W) '$(srcdir)/src/systemd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-systemd.Tpo src/$(DEPDIR)/bluetoothd-systemd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/systemd.c' object='src/bluetoothd-systemd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-systemd.obj `if test -f 'src/systemd.c'; then $(CYGPATH_W) 'src/systemd.c'; else $(CYGPATH_W) '$(srcdir)/src/systemd.c'; fi` + +src/bluetoothd-rfkill.o: src/rfkill.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-rfkill.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-rfkill.Tpo -c -o src/bluetoothd-rfkill.o `test -f 'src/rfkill.c' || echo '$(srcdir)/'`src/rfkill.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-rfkill.Tpo src/$(DEPDIR)/bluetoothd-rfkill.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/rfkill.c' object='src/bluetoothd-rfkill.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-rfkill.o `test -f 'src/rfkill.c' || echo '$(srcdir)/'`src/rfkill.c + +src/bluetoothd-rfkill.obj: src/rfkill.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-rfkill.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-rfkill.Tpo -c -o src/bluetoothd-rfkill.obj `if test -f 'src/rfkill.c'; then $(CYGPATH_W) 'src/rfkill.c'; else $(CYGPATH_W) '$(srcdir)/src/rfkill.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-rfkill.Tpo src/$(DEPDIR)/bluetoothd-rfkill.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/rfkill.c' object='src/bluetoothd-rfkill.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-rfkill.obj `if test -f 'src/rfkill.c'; then $(CYGPATH_W) 'src/rfkill.c'; else $(CYGPATH_W) '$(srcdir)/src/rfkill.c'; fi` + +src/bluetoothd-sdpd-server.o: src/sdpd-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-server.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo -c -o src/bluetoothd-sdpd-server.o `test -f 'src/sdpd-server.c' || echo '$(srcdir)/'`src/sdpd-server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo src/$(DEPDIR)/bluetoothd-sdpd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-server.c' object='src/bluetoothd-sdpd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-server.o `test -f 'src/sdpd-server.c' || echo '$(srcdir)/'`src/sdpd-server.c + +src/bluetoothd-sdpd-server.obj: src/sdpd-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-server.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo -c -o src/bluetoothd-sdpd-server.obj `if test -f 'src/sdpd-server.c'; then $(CYGPATH_W) 'src/sdpd-server.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo src/$(DEPDIR)/bluetoothd-sdpd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-server.c' object='src/bluetoothd-sdpd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-server.obj `if test -f 'src/sdpd-server.c'; then $(CYGPATH_W) 'src/sdpd-server.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-server.c'; fi` + +src/bluetoothd-sdpd-request.o: src/sdpd-request.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-request.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo -c -o src/bluetoothd-sdpd-request.o `test -f 'src/sdpd-request.c' || echo '$(srcdir)/'`src/sdpd-request.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo src/$(DEPDIR)/bluetoothd-sdpd-request.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-request.c' object='src/bluetoothd-sdpd-request.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-request.o `test -f 'src/sdpd-request.c' || echo '$(srcdir)/'`src/sdpd-request.c + +src/bluetoothd-sdpd-request.obj: src/sdpd-request.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-request.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo -c -o src/bluetoothd-sdpd-request.obj `if test -f 'src/sdpd-request.c'; then $(CYGPATH_W) 'src/sdpd-request.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-request.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo src/$(DEPDIR)/bluetoothd-sdpd-request.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-request.c' object='src/bluetoothd-sdpd-request.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-request.obj `if test -f 'src/sdpd-request.c'; then $(CYGPATH_W) 'src/sdpd-request.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-request.c'; fi` + +src/bluetoothd-sdpd-service.o: src/sdpd-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-service.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo -c -o src/bluetoothd-sdpd-service.o `test -f 'src/sdpd-service.c' || echo '$(srcdir)/'`src/sdpd-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo src/$(DEPDIR)/bluetoothd-sdpd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-service.c' object='src/bluetoothd-sdpd-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-service.o `test -f 'src/sdpd-service.c' || echo '$(srcdir)/'`src/sdpd-service.c + +src/bluetoothd-sdpd-service.obj: src/sdpd-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-service.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo -c -o src/bluetoothd-sdpd-service.obj `if test -f 'src/sdpd-service.c'; then $(CYGPATH_W) 'src/sdpd-service.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo src/$(DEPDIR)/bluetoothd-sdpd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-service.c' object='src/bluetoothd-sdpd-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-service.obj `if test -f 'src/sdpd-service.c'; then $(CYGPATH_W) 'src/sdpd-service.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-service.c'; fi` + +src/bluetoothd-sdpd-database.o: src/sdpd-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-database.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo -c -o src/bluetoothd-sdpd-database.o `test -f 'src/sdpd-database.c' || echo '$(srcdir)/'`src/sdpd-database.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo src/$(DEPDIR)/bluetoothd-sdpd-database.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-database.c' object='src/bluetoothd-sdpd-database.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-database.o `test -f 'src/sdpd-database.c' || echo '$(srcdir)/'`src/sdpd-database.c + +src/bluetoothd-sdpd-database.obj: src/sdpd-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-database.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo -c -o src/bluetoothd-sdpd-database.obj `if test -f 'src/sdpd-database.c'; then $(CYGPATH_W) 'src/sdpd-database.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-database.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo src/$(DEPDIR)/bluetoothd-sdpd-database.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-database.c' object='src/bluetoothd-sdpd-database.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-database.obj `if test -f 'src/sdpd-database.c'; then $(CYGPATH_W) 'src/sdpd-database.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-database.c'; fi` + +src/bluetoothd-attrib-server.o: src/attrib-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-attrib-server.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-attrib-server.Tpo -c -o src/bluetoothd-attrib-server.o `test -f 'src/attrib-server.c' || echo '$(srcdir)/'`src/attrib-server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-attrib-server.Tpo src/$(DEPDIR)/bluetoothd-attrib-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/attrib-server.c' object='src/bluetoothd-attrib-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-attrib-server.o `test -f 'src/attrib-server.c' || echo '$(srcdir)/'`src/attrib-server.c + +src/bluetoothd-attrib-server.obj: src/attrib-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-attrib-server.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-attrib-server.Tpo -c -o src/bluetoothd-attrib-server.obj `if test -f 'src/attrib-server.c'; then $(CYGPATH_W) 'src/attrib-server.c'; else $(CYGPATH_W) '$(srcdir)/src/attrib-server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-attrib-server.Tpo src/$(DEPDIR)/bluetoothd-attrib-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/attrib-server.c' object='src/bluetoothd-attrib-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-attrib-server.obj `if test -f 'src/attrib-server.c'; then $(CYGPATH_W) 'src/attrib-server.c'; else $(CYGPATH_W) '$(srcdir)/src/attrib-server.c'; fi` + +src/bluetoothd-gatt-database.o: src/gatt-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt-database.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt-database.Tpo -c -o src/bluetoothd-gatt-database.o `test -f 'src/gatt-database.c' || echo '$(srcdir)/'`src/gatt-database.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt-database.Tpo src/$(DEPDIR)/bluetoothd-gatt-database.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt-database.c' object='src/bluetoothd-gatt-database.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt-database.o `test -f 'src/gatt-database.c' || echo '$(srcdir)/'`src/gatt-database.c + +src/bluetoothd-gatt-database.obj: src/gatt-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt-database.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt-database.Tpo -c -o src/bluetoothd-gatt-database.obj `if test -f 'src/gatt-database.c'; then $(CYGPATH_W) 'src/gatt-database.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt-database.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt-database.Tpo src/$(DEPDIR)/bluetoothd-gatt-database.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt-database.c' object='src/bluetoothd-gatt-database.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt-database.obj `if test -f 'src/gatt-database.c'; then $(CYGPATH_W) 'src/gatt-database.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt-database.c'; fi` + +src/bluetoothd-sdp-xml.o: src/sdp-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-xml.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo -c -o src/bluetoothd-sdp-xml.o `test -f 'src/sdp-xml.c' || echo '$(srcdir)/'`src/sdp-xml.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo src/$(DEPDIR)/bluetoothd-sdp-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-xml.c' object='src/bluetoothd-sdp-xml.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-xml.o `test -f 'src/sdp-xml.c' || echo '$(srcdir)/'`src/sdp-xml.c + +src/bluetoothd-sdp-xml.obj: src/sdp-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-xml.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo -c -o src/bluetoothd-sdp-xml.obj `if test -f 'src/sdp-xml.c'; then $(CYGPATH_W) 'src/sdp-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-xml.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo src/$(DEPDIR)/bluetoothd-sdp-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-xml.c' object='src/bluetoothd-sdp-xml.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-xml.obj `if test -f 'src/sdp-xml.c'; then $(CYGPATH_W) 'src/sdp-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-xml.c'; fi` + +src/bluetoothd-sdp-client.o: src/sdp-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-client.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-client.Tpo -c -o src/bluetoothd-sdp-client.o `test -f 'src/sdp-client.c' || echo '$(srcdir)/'`src/sdp-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-client.Tpo src/$(DEPDIR)/bluetoothd-sdp-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-client.c' object='src/bluetoothd-sdp-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-client.o `test -f 'src/sdp-client.c' || echo '$(srcdir)/'`src/sdp-client.c + +src/bluetoothd-sdp-client.obj: src/sdp-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-client.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-client.Tpo -c -o src/bluetoothd-sdp-client.obj `if test -f 'src/sdp-client.c'; then $(CYGPATH_W) 'src/sdp-client.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-client.Tpo src/$(DEPDIR)/bluetoothd-sdp-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-client.c' object='src/bluetoothd-sdp-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-client.obj `if test -f 'src/sdp-client.c'; then $(CYGPATH_W) 'src/sdp-client.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-client.c'; fi` + +src/bluetoothd-textfile.o: src/textfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-textfile.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-textfile.Tpo -c -o src/bluetoothd-textfile.o `test -f 'src/textfile.c' || echo '$(srcdir)/'`src/textfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-textfile.Tpo src/$(DEPDIR)/bluetoothd-textfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/textfile.c' object='src/bluetoothd-textfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-textfile.o `test -f 'src/textfile.c' || echo '$(srcdir)/'`src/textfile.c + +src/bluetoothd-textfile.obj: src/textfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-textfile.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-textfile.Tpo -c -o src/bluetoothd-textfile.obj `if test -f 'src/textfile.c'; then $(CYGPATH_W) 'src/textfile.c'; else $(CYGPATH_W) '$(srcdir)/src/textfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-textfile.Tpo src/$(DEPDIR)/bluetoothd-textfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/textfile.c' object='src/bluetoothd-textfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-textfile.obj `if test -f 'src/textfile.c'; then $(CYGPATH_W) 'src/textfile.c'; else $(CYGPATH_W) '$(srcdir)/src/textfile.c'; fi` + +src/bluetoothd-uuid-helper.o: src/uuid-helper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-uuid-helper.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo -c -o src/bluetoothd-uuid-helper.o `test -f 'src/uuid-helper.c' || echo '$(srcdir)/'`src/uuid-helper.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo src/$(DEPDIR)/bluetoothd-uuid-helper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uuid-helper.c' object='src/bluetoothd-uuid-helper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-uuid-helper.o `test -f 'src/uuid-helper.c' || echo '$(srcdir)/'`src/uuid-helper.c + +src/bluetoothd-uuid-helper.obj: src/uuid-helper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-uuid-helper.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo -c -o src/bluetoothd-uuid-helper.obj `if test -f 'src/uuid-helper.c'; then $(CYGPATH_W) 'src/uuid-helper.c'; else $(CYGPATH_W) '$(srcdir)/src/uuid-helper.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo src/$(DEPDIR)/bluetoothd-uuid-helper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uuid-helper.c' object='src/bluetoothd-uuid-helper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-uuid-helper.obj `if test -f 'src/uuid-helper.c'; then $(CYGPATH_W) 'src/uuid-helper.c'; else $(CYGPATH_W) '$(srcdir)/src/uuid-helper.c'; fi` + +src/bluetoothd-plugin.o: src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-plugin.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-plugin.Tpo -c -o src/bluetoothd-plugin.o `test -f 'src/plugin.c' || echo '$(srcdir)/'`src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-plugin.Tpo src/$(DEPDIR)/bluetoothd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/plugin.c' object='src/bluetoothd-plugin.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-plugin.o `test -f 'src/plugin.c' || echo '$(srcdir)/'`src/plugin.c + +src/bluetoothd-plugin.obj: src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-plugin.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-plugin.Tpo -c -o src/bluetoothd-plugin.obj `if test -f 'src/plugin.c'; then $(CYGPATH_W) 'src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/src/plugin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-plugin.Tpo src/$(DEPDIR)/bluetoothd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/plugin.c' object='src/bluetoothd-plugin.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-plugin.obj `if test -f 'src/plugin.c'; then $(CYGPATH_W) 'src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/src/plugin.c'; fi` + +src/bluetoothd-storage.o: src/storage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-storage.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-storage.Tpo -c -o src/bluetoothd-storage.o `test -f 'src/storage.c' || echo '$(srcdir)/'`src/storage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-storage.Tpo src/$(DEPDIR)/bluetoothd-storage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/storage.c' object='src/bluetoothd-storage.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-storage.o `test -f 'src/storage.c' || echo '$(srcdir)/'`src/storage.c + +src/bluetoothd-storage.obj: src/storage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-storage.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-storage.Tpo -c -o src/bluetoothd-storage.obj `if test -f 'src/storage.c'; then $(CYGPATH_W) 'src/storage.c'; else $(CYGPATH_W) '$(srcdir)/src/storage.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-storage.Tpo src/$(DEPDIR)/bluetoothd-storage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/storage.c' object='src/bluetoothd-storage.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-storage.obj `if test -f 'src/storage.c'; then $(CYGPATH_W) 'src/storage.c'; else $(CYGPATH_W) '$(srcdir)/src/storage.c'; fi` + +src/bluetoothd-advertising.o: src/advertising.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-advertising.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-advertising.Tpo -c -o src/bluetoothd-advertising.o `test -f 'src/advertising.c' || echo '$(srcdir)/'`src/advertising.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-advertising.Tpo src/$(DEPDIR)/bluetoothd-advertising.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/advertising.c' object='src/bluetoothd-advertising.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-advertising.o `test -f 'src/advertising.c' || echo '$(srcdir)/'`src/advertising.c + +src/bluetoothd-advertising.obj: src/advertising.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-advertising.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-advertising.Tpo -c -o src/bluetoothd-advertising.obj `if test -f 'src/advertising.c'; then $(CYGPATH_W) 'src/advertising.c'; else $(CYGPATH_W) '$(srcdir)/src/advertising.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-advertising.Tpo src/$(DEPDIR)/bluetoothd-advertising.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/advertising.c' object='src/bluetoothd-advertising.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-advertising.obj `if test -f 'src/advertising.c'; then $(CYGPATH_W) 'src/advertising.c'; else $(CYGPATH_W) '$(srcdir)/src/advertising.c'; fi` + +src/bluetoothd-agent.o: src/agent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-agent.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-agent.Tpo -c -o src/bluetoothd-agent.o `test -f 'src/agent.c' || echo '$(srcdir)/'`src/agent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-agent.Tpo src/$(DEPDIR)/bluetoothd-agent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/agent.c' object='src/bluetoothd-agent.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-agent.o `test -f 'src/agent.c' || echo '$(srcdir)/'`src/agent.c + +src/bluetoothd-agent.obj: src/agent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-agent.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-agent.Tpo -c -o src/bluetoothd-agent.obj `if test -f 'src/agent.c'; then $(CYGPATH_W) 'src/agent.c'; else $(CYGPATH_W) '$(srcdir)/src/agent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-agent.Tpo src/$(DEPDIR)/bluetoothd-agent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/agent.c' object='src/bluetoothd-agent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-agent.obj `if test -f 'src/agent.c'; then $(CYGPATH_W) 'src/agent.c'; else $(CYGPATH_W) '$(srcdir)/src/agent.c'; fi` + +src/bluetoothd-error.o: src/error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-error.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-error.Tpo -c -o src/bluetoothd-error.o `test -f 'src/error.c' || echo '$(srcdir)/'`src/error.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-error.Tpo src/$(DEPDIR)/bluetoothd-error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/error.c' object='src/bluetoothd-error.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-error.o `test -f 'src/error.c' || echo '$(srcdir)/'`src/error.c + +src/bluetoothd-error.obj: src/error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-error.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-error.Tpo -c -o src/bluetoothd-error.obj `if test -f 'src/error.c'; then $(CYGPATH_W) 'src/error.c'; else $(CYGPATH_W) '$(srcdir)/src/error.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-error.Tpo src/$(DEPDIR)/bluetoothd-error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/error.c' object='src/bluetoothd-error.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-error.obj `if test -f 'src/error.c'; then $(CYGPATH_W) 'src/error.c'; else $(CYGPATH_W) '$(srcdir)/src/error.c'; fi` + +src/bluetoothd-adapter.o: src/adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-adapter.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-adapter.Tpo -c -o src/bluetoothd-adapter.o `test -f 'src/adapter.c' || echo '$(srcdir)/'`src/adapter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-adapter.Tpo src/$(DEPDIR)/bluetoothd-adapter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/adapter.c' object='src/bluetoothd-adapter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-adapter.o `test -f 'src/adapter.c' || echo '$(srcdir)/'`src/adapter.c + +src/bluetoothd-adapter.obj: src/adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-adapter.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-adapter.Tpo -c -o src/bluetoothd-adapter.obj `if test -f 'src/adapter.c'; then $(CYGPATH_W) 'src/adapter.c'; else $(CYGPATH_W) '$(srcdir)/src/adapter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-adapter.Tpo src/$(DEPDIR)/bluetoothd-adapter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/adapter.c' object='src/bluetoothd-adapter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-adapter.obj `if test -f 'src/adapter.c'; then $(CYGPATH_W) 'src/adapter.c'; else $(CYGPATH_W) '$(srcdir)/src/adapter.c'; fi` + +src/bluetoothd-profile.o: src/profile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-profile.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-profile.Tpo -c -o src/bluetoothd-profile.o `test -f 'src/profile.c' || echo '$(srcdir)/'`src/profile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-profile.Tpo src/$(DEPDIR)/bluetoothd-profile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/profile.c' object='src/bluetoothd-profile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-profile.o `test -f 'src/profile.c' || echo '$(srcdir)/'`src/profile.c + +src/bluetoothd-profile.obj: src/profile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-profile.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-profile.Tpo -c -o src/bluetoothd-profile.obj `if test -f 'src/profile.c'; then $(CYGPATH_W) 'src/profile.c'; else $(CYGPATH_W) '$(srcdir)/src/profile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-profile.Tpo src/$(DEPDIR)/bluetoothd-profile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/profile.c' object='src/bluetoothd-profile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-profile.obj `if test -f 'src/profile.c'; then $(CYGPATH_W) 'src/profile.c'; else $(CYGPATH_W) '$(srcdir)/src/profile.c'; fi` + +src/bluetoothd-service.o: src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-service.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-service.Tpo -c -o src/bluetoothd-service.o `test -f 'src/service.c' || echo '$(srcdir)/'`src/service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-service.Tpo src/$(DEPDIR)/bluetoothd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/service.c' object='src/bluetoothd-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-service.o `test -f 'src/service.c' || echo '$(srcdir)/'`src/service.c + +src/bluetoothd-service.obj: src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-service.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-service.Tpo -c -o src/bluetoothd-service.obj `if test -f 'src/service.c'; then $(CYGPATH_W) 'src/service.c'; else $(CYGPATH_W) '$(srcdir)/src/service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-service.Tpo src/$(DEPDIR)/bluetoothd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/service.c' object='src/bluetoothd-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-service.obj `if test -f 'src/service.c'; then $(CYGPATH_W) 'src/service.c'; else $(CYGPATH_W) '$(srcdir)/src/service.c'; fi` + +src/bluetoothd-gatt-client.o: src/gatt-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt-client.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt-client.Tpo -c -o src/bluetoothd-gatt-client.o `test -f 'src/gatt-client.c' || echo '$(srcdir)/'`src/gatt-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt-client.Tpo src/$(DEPDIR)/bluetoothd-gatt-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt-client.c' object='src/bluetoothd-gatt-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt-client.o `test -f 'src/gatt-client.c' || echo '$(srcdir)/'`src/gatt-client.c + +src/bluetoothd-gatt-client.obj: src/gatt-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt-client.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt-client.Tpo -c -o src/bluetoothd-gatt-client.obj `if test -f 'src/gatt-client.c'; then $(CYGPATH_W) 'src/gatt-client.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt-client.Tpo src/$(DEPDIR)/bluetoothd-gatt-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt-client.c' object='src/bluetoothd-gatt-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt-client.obj `if test -f 'src/gatt-client.c'; then $(CYGPATH_W) 'src/gatt-client.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt-client.c'; fi` + +src/bluetoothd-device.o: src/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-device.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-device.Tpo -c -o src/bluetoothd-device.o `test -f 'src/device.c' || echo '$(srcdir)/'`src/device.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-device.Tpo src/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/device.c' object='src/bluetoothd-device.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-device.o `test -f 'src/device.c' || echo '$(srcdir)/'`src/device.c + +src/bluetoothd-device.obj: src/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-device.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-device.Tpo -c -o src/bluetoothd-device.obj `if test -f 'src/device.c'; then $(CYGPATH_W) 'src/device.c'; else $(CYGPATH_W) '$(srcdir)/src/device.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-device.Tpo src/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/device.c' object='src/bluetoothd-device.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-device.obj `if test -f 'src/device.c'; then $(CYGPATH_W) 'src/device.c'; else $(CYGPATH_W) '$(srcdir)/src/device.c'; fi` + +src/bluetoothd-dbus-common.o: src/dbus-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-dbus-common.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-dbus-common.Tpo -c -o src/bluetoothd-dbus-common.o `test -f 'src/dbus-common.c' || echo '$(srcdir)/'`src/dbus-common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-dbus-common.Tpo src/$(DEPDIR)/bluetoothd-dbus-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/dbus-common.c' object='src/bluetoothd-dbus-common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-dbus-common.o `test -f 'src/dbus-common.c' || echo '$(srcdir)/'`src/dbus-common.c + +src/bluetoothd-dbus-common.obj: src/dbus-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-dbus-common.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-dbus-common.Tpo -c -o src/bluetoothd-dbus-common.obj `if test -f 'src/dbus-common.c'; then $(CYGPATH_W) 'src/dbus-common.c'; else $(CYGPATH_W) '$(srcdir)/src/dbus-common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-dbus-common.Tpo src/$(DEPDIR)/bluetoothd-dbus-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/dbus-common.c' object='src/bluetoothd-dbus-common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-dbus-common.obj `if test -f 'src/dbus-common.c'; then $(CYGPATH_W) 'src/dbus-common.c'; else $(CYGPATH_W) '$(srcdir)/src/dbus-common.c'; fi` + +src/bluetoothd-eir.o: src/eir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-eir.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-eir.Tpo -c -o src/bluetoothd-eir.o `test -f 'src/eir.c' || echo '$(srcdir)/'`src/eir.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-eir.Tpo src/$(DEPDIR)/bluetoothd-eir.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/eir.c' object='src/bluetoothd-eir.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-eir.o `test -f 'src/eir.c' || echo '$(srcdir)/'`src/eir.c + +src/bluetoothd-eir.obj: src/eir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-eir.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-eir.Tpo -c -o src/bluetoothd-eir.obj `if test -f 'src/eir.c'; then $(CYGPATH_W) 'src/eir.c'; else $(CYGPATH_W) '$(srcdir)/src/eir.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-eir.Tpo src/$(DEPDIR)/bluetoothd-eir.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/eir.c' object='src/bluetoothd-eir.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-eir.obj `if test -f 'src/eir.c'; then $(CYGPATH_W) 'src/eir.c'; else $(CYGPATH_W) '$(srcdir)/src/eir.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf android/.libs android/_libs + -rm -rf android/audio_utils/.libs android/audio_utils/_libs + -rm -rf attrib/.libs attrib/_libs + -rm -rf client/.libs client/_libs + -rm -rf emulator/.libs emulator/_libs + -rm -rf gdbus/.libs gdbus/_libs + -rm -rf lib/.libs lib/_libs + -rm -rf monitor/.libs monitor/_libs + -rm -rf obexd/src/.libs obexd/src/_libs + -rm -rf peripheral/.libs peripheral/_libs + -rm -rf plugins/.libs plugins/_libs + -rm -rf profiles/cups/.libs profiles/cups/_libs + -rm -rf profiles/iap/.libs profiles/iap/_libs + -rm -rf src/.libs src/_libs + -rm -rf src/shared/.libs src/shared/_libs + -rm -rf tools/.libs tools/_libs + -rm -rf unit/.libs unit/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(dist_man_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS) $(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-man8: $(dist_man_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS) $(man_MANS)'; \ + test -n "$(man8dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.8[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) +install-confDATA: $(conf_DATA) + @$(NORMAL_INSTALL) + @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(confdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(confdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \ + done + +uninstall-confDATA: + @$(NORMAL_UNINSTALL) + @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(confdir)'; $(am__uninstall_files_from_dir) +install-dbusDATA: $(dbus_DATA) + @$(NORMAL_INSTALL) + @list='$(dbus_DATA)'; test -n "$(dbusdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dbusdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dbusdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusdir)" || exit $$?; \ + done + +uninstall-dbusDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbus_DATA)'; test -n "$(dbusdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbusdir)'; $(am__uninstall_files_from_dir) +install-dbussessionbusDATA: $(dbussessionbus_DATA) + @$(NORMAL_INSTALL) + @list='$(dbussessionbus_DATA)'; test -n "$(dbussessionbusdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dbussessionbusdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dbussessionbusdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbussessionbusdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbussessionbusdir)" || exit $$?; \ + done + +uninstall-dbussessionbusDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbussessionbus_DATA)'; test -n "$(dbussessionbusdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbussessionbusdir)'; $(am__uninstall_files_from_dir) +install-dbussystembusDATA: $(dbussystembus_DATA) + @$(NORMAL_INSTALL) + @list='$(dbussystembus_DATA)'; test -n "$(dbussystembusdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dbussystembusdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dbussystembusdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbussystembusdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbussystembusdir)" || exit $$?; \ + done + +uninstall-dbussystembusDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbussystembus_DATA)'; test -n "$(dbussystembusdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbussystembusdir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-rulesDATA: $(rules_DATA) + @$(NORMAL_INSTALL) + @list='$(rules_DATA)'; test -n "$(rulesdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(rulesdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(rulesdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rulesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(rulesdir)" || exit $$?; \ + done + +uninstall-rulesDATA: + @$(NORMAL_UNINSTALL) + @list='$(rules_DATA)'; test -n "$(rulesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(rulesdir)'; $(am__uninstall_files_from_dir) +install-stateDATA: $(state_DATA) + @$(NORMAL_INSTALL) + @list='$(state_DATA)'; test -n "$(statedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(statedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(statedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(statedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(statedir)" || exit $$?; \ + done + +uninstall-stateDATA: + @$(NORMAL_UNINSTALL) + @list='$(state_DATA)'; test -n "$(statedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(statedir)'; $(am__uninstall_files_from_dir) +install-systemdsystemunitDATA: $(systemdsystemunit_DATA) + @$(NORMAL_INSTALL) + @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \ + done + +uninstall-systemdsystemunitDATA: + @$(NORMAL_UNINSTALL) + @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir) +install-systemduserunitDATA: $(systemduserunit_DATA) + @$(NORMAL_INSTALL) + @list='$(systemduserunit_DATA)'; test -n "$(systemduserunitdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(systemduserunitdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(systemduserunitdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemduserunitdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(systemduserunitdir)" || exit $$?; \ + done + +uninstall-systemduserunitDATA: + @$(NORMAL_UNINSTALL) + @list='$(systemduserunit_DATA)'; test -n "$(systemduserunitdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(systemduserunitdir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +android/test-ipc.log: android/test-ipc$(EXEEXT) + @p='android/test-ipc$(EXEEXT)'; \ + b='android/test-ipc'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-eir.log: unit/test-eir$(EXEEXT) + @p='unit/test-eir$(EXEEXT)'; \ + b='unit/test-eir'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-uuid.log: unit/test-uuid$(EXEEXT) + @p='unit/test-uuid$(EXEEXT)'; \ + b='unit/test-uuid'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-textfile.log: unit/test-textfile$(EXEEXT) + @p='unit/test-textfile$(EXEEXT)'; \ + b='unit/test-textfile'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-crc.log: unit/test-crc$(EXEEXT) + @p='unit/test-crc$(EXEEXT)'; \ + b='unit/test-crc'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-crypto.log: unit/test-crypto$(EXEEXT) + @p='unit/test-crypto$(EXEEXT)'; \ + b='unit/test-crypto'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-ecc.log: unit/test-ecc$(EXEEXT) + @p='unit/test-ecc$(EXEEXT)'; \ + b='unit/test-ecc'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-ringbuf.log: unit/test-ringbuf$(EXEEXT) + @p='unit/test-ringbuf$(EXEEXT)'; \ + b='unit/test-ringbuf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-queue.log: unit/test-queue$(EXEEXT) + @p='unit/test-queue$(EXEEXT)'; \ + b='unit/test-queue'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-mgmt.log: unit/test-mgmt$(EXEEXT) + @p='unit/test-mgmt$(EXEEXT)'; \ + b='unit/test-mgmt'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-uhid.log: unit/test-uhid$(EXEEXT) + @p='unit/test-uhid$(EXEEXT)'; \ + b='unit/test-uhid'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-sdp.log: unit/test-sdp$(EXEEXT) + @p='unit/test-sdp$(EXEEXT)'; \ + b='unit/test-sdp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-avdtp.log: unit/test-avdtp$(EXEEXT) + @p='unit/test-avdtp$(EXEEXT)'; \ + b='unit/test-avdtp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-avctp.log: unit/test-avctp$(EXEEXT) + @p='unit/test-avctp$(EXEEXT)'; \ + b='unit/test-avctp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-avrcp.log: unit/test-avrcp$(EXEEXT) + @p='unit/test-avrcp$(EXEEXT)'; \ + b='unit/test-avrcp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-hfp.log: unit/test-hfp$(EXEEXT) + @p='unit/test-hfp$(EXEEXT)'; \ + b='unit/test-hfp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gdbus-client.log: unit/test-gdbus-client$(EXEEXT) + @p='unit/test-gdbus-client$(EXEEXT)'; \ + b='unit/test-gdbus-client'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-header.log: unit/test-gobex-header$(EXEEXT) + @p='unit/test-gobex-header$(EXEEXT)'; \ + b='unit/test-gobex-header'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-packet.log: unit/test-gobex-packet$(EXEEXT) + @p='unit/test-gobex-packet$(EXEEXT)'; \ + b='unit/test-gobex-packet'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex.log: unit/test-gobex$(EXEEXT) + @p='unit/test-gobex$(EXEEXT)'; \ + b='unit/test-gobex'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-transfer.log: unit/test-gobex-transfer$(EXEEXT) + @p='unit/test-gobex-transfer$(EXEEXT)'; \ + b='unit/test-gobex-transfer'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-apparam.log: unit/test-gobex-apparam$(EXEEXT) + @p='unit/test-gobex-apparam$(EXEEXT)'; \ + b='unit/test-gobex-apparam'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-lib.log: unit/test-lib$(EXEEXT) + @p='unit/test-lib$(EXEEXT)'; \ + b='unit/test-lib'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gatt.log: unit/test-gatt$(EXEEXT) + @p='unit/test-gatt$(EXEEXT)'; \ + b='unit/test-gatt'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-hog.log: unit/test-hog$(EXEEXT) + @p='unit/test-hog$(EXEEXT)'; \ + b='unit/test-hog'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gattrib.log: unit/test-gattrib$(EXEEXT) + @p='unit/test-gattrib$(EXEEXT)'; \ + b='unit/test-gattrib'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \ + $(MANS) $(DATA) $(HEADERS) config.h +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(udevdir)" "$(DESTDIR)$(testdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(dbusdir)" "$(DESTDIR)$(dbussessionbusdir)" "$(DESTDIR)$(dbussystembusdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(rulesdir)" "$(DESTDIR)$(statedir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f android/$(DEPDIR)/$(am__dirstamp) + -rm -f android/$(am__dirstamp) + -rm -f android/audio_utils/$(DEPDIR)/$(am__dirstamp) + -rm -f android/audio_utils/$(am__dirstamp) + -rm -f android/client/$(DEPDIR)/$(am__dirstamp) + -rm -f android/client/$(am__dirstamp) + -rm -f android/hardware/$(DEPDIR)/$(am__dirstamp) + -rm -f android/hardware/$(am__dirstamp) + -rm -f attrib/$(DEPDIR)/$(am__dirstamp) + -rm -f attrib/$(am__dirstamp) + -rm -f btio/$(DEPDIR)/$(am__dirstamp) + -rm -f btio/$(am__dirstamp) + -rm -f client/$(DEPDIR)/$(am__dirstamp) + -rm -f client/$(am__dirstamp) + -rm -f emulator/$(DEPDIR)/$(am__dirstamp) + -rm -f emulator/$(am__dirstamp) + -rm -f gdbus/$(DEPDIR)/$(am__dirstamp) + -rm -f gdbus/$(am__dirstamp) + -rm -f gobex/$(DEPDIR)/$(am__dirstamp) + -rm -f gobex/$(am__dirstamp) + -rm -f lib/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/$(am__dirstamp) + -rm -f monitor/$(DEPDIR)/$(am__dirstamp) + -rm -f monitor/$(am__dirstamp) + -rm -f obexd/client/$(DEPDIR)/$(am__dirstamp) + -rm -f obexd/client/$(am__dirstamp) + -rm -f obexd/plugins/$(DEPDIR)/$(am__dirstamp) + -rm -f obexd/plugins/$(am__dirstamp) + -rm -f obexd/src/$(DEPDIR)/$(am__dirstamp) + -rm -f obexd/src/$(am__dirstamp) + -rm -f peripheral/$(DEPDIR)/$(am__dirstamp) + -rm -f peripheral/$(am__dirstamp) + -rm -f plugins/$(DEPDIR)/$(am__dirstamp) + -rm -f plugins/$(am__dirstamp) + -rm -f profiles/audio/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/audio/$(am__dirstamp) + -rm -f profiles/battery/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/battery/$(am__dirstamp) + -rm -f profiles/cups/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/cups/$(am__dirstamp) + -rm -f profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/deviceinfo/$(am__dirstamp) + -rm -f profiles/gap/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/gap/$(am__dirstamp) + -rm -f profiles/health/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/health/$(am__dirstamp) + -rm -f profiles/iap/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/iap/$(am__dirstamp) + -rm -f profiles/input/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/input/$(am__dirstamp) + -rm -f profiles/network/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/network/$(am__dirstamp) + -rm -f profiles/sap/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/sap/$(am__dirstamp) + -rm -f profiles/scanparam/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/scanparam/$(am__dirstamp) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -rm -f src/shared/$(DEPDIR)/$(am__dirstamp) + -rm -f src/shared/$(am__dirstamp) + -rm -f tools/$(DEPDIR)/$(am__dirstamp) + -rm -f tools/$(am__dirstamp) + -rm -f tools/parser/$(DEPDIR)/$(am__dirstamp) + -rm -f tools/parser/$(am__dirstamp) + -rm -f unit/$(DEPDIR)/$(am__dirstamp) + -rm -f unit/$(am__dirstamp) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-cupsPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libexecPROGRAMS clean-libtool \ + clean-local clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS clean-pluginLTLIBRARIES \ + clean-udevPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf android/$(DEPDIR) android/audio_utils/$(DEPDIR) android/client/$(DEPDIR) android/hardware/$(DEPDIR) attrib/$(DEPDIR) btio/$(DEPDIR) client/$(DEPDIR) emulator/$(DEPDIR) gdbus/$(DEPDIR) gobex/$(DEPDIR) lib/$(DEPDIR) monitor/$(DEPDIR) obexd/client/$(DEPDIR) obexd/plugins/$(DEPDIR) obexd/src/$(DEPDIR) peripheral/$(DEPDIR) plugins/$(DEPDIR) profiles/audio/$(DEPDIR) profiles/battery/$(DEPDIR) profiles/cups/$(DEPDIR) profiles/deviceinfo/$(DEPDIR) profiles/gap/$(DEPDIR) profiles/health/$(DEPDIR) profiles/iap/$(DEPDIR) profiles/input/$(DEPDIR) profiles/network/$(DEPDIR) profiles/sap/$(DEPDIR) profiles/scanparam/$(DEPDIR) src/$(DEPDIR) src/shared/$(DEPDIR) tools/$(DEPDIR) tools/parser/$(DEPDIR) unit/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-confDATA install-cupsPROGRAMS \ + install-dbusDATA install-dbussessionbusDATA \ + install-dbussystembusDATA install-includeHEADERS install-man \ + install-pkgconfigDATA install-pluginLTLIBRARIES \ + install-rulesDATA install-stateDATA \ + install-systemdsystemunitDATA install-systemduserunitDATA \ + install-testSCRIPTS install-udevPROGRAMS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \ + install-libexecPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 install-man8 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf android/$(DEPDIR) android/audio_utils/$(DEPDIR) android/client/$(DEPDIR) android/hardware/$(DEPDIR) attrib/$(DEPDIR) btio/$(DEPDIR) client/$(DEPDIR) emulator/$(DEPDIR) gdbus/$(DEPDIR) gobex/$(DEPDIR) lib/$(DEPDIR) monitor/$(DEPDIR) obexd/client/$(DEPDIR) obexd/plugins/$(DEPDIR) obexd/src/$(DEPDIR) peripheral/$(DEPDIR) plugins/$(DEPDIR) profiles/audio/$(DEPDIR) profiles/battery/$(DEPDIR) profiles/cups/$(DEPDIR) profiles/deviceinfo/$(DEPDIR) profiles/gap/$(DEPDIR) profiles/health/$(DEPDIR) profiles/iap/$(DEPDIR) profiles/input/$(DEPDIR) profiles/network/$(DEPDIR) profiles/sap/$(DEPDIR) profiles/scanparam/$(DEPDIR) src/$(DEPDIR) src/shared/$(DEPDIR) tools/$(DEPDIR) tools/parser/$(DEPDIR) unit/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-confDATA \ + uninstall-cupsPROGRAMS uninstall-dbusDATA \ + uninstall-dbussessionbusDATA uninstall-dbussystembusDATA \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-libexecPROGRAMS uninstall-man \ + uninstall-pkgconfigDATA uninstall-pluginLTLIBRARIES \ + uninstall-rulesDATA uninstall-stateDATA \ + uninstall-systemdsystemunitDATA uninstall-systemduserunitDATA \ + uninstall-testSCRIPTS uninstall-udevPROGRAMS + +uninstall-man: uninstall-man1 uninstall-man8 + +.MAKE: all check check-am install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \ + check-am clean clean-binPROGRAMS clean-cscope \ + clean-cupsPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libexecPROGRAMS clean-libtool clean-local \ + clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS clean-pluginLTLIBRARIES \ + clean-udevPROGRAMS cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-confDATA install-cupsPROGRAMS \ + install-data install-data-am install-dbusDATA \ + install-dbussessionbusDATA install-dbussystembusDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-includeHEADERS \ + install-info install-info-am install-libLTLIBRARIES \ + install-libexecPROGRAMS install-man install-man1 install-man8 \ + install-pdf install-pdf-am install-pkgconfigDATA \ + install-pluginLTLIBRARIES install-ps install-ps-am \ + install-rulesDATA install-stateDATA install-strip \ + install-systemdsystemunitDATA install-systemduserunitDATA \ + install-testSCRIPTS install-udevPROGRAMS installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-confDATA \ + uninstall-cupsPROGRAMS uninstall-dbusDATA \ + uninstall-dbussessionbusDATA uninstall-dbussystembusDATA \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-libexecPROGRAMS uninstall-man uninstall-man1 \ + uninstall-man8 uninstall-pkgconfigDATA \ + uninstall-pluginLTLIBRARIES uninstall-rulesDATA \ + uninstall-stateDATA uninstall-systemdsystemunitDATA \ + uninstall-systemduserunitDATA uninstall-testSCRIPTS \ + uninstall-udevPROGRAMS + + +obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h + +obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources) + $(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@ + +%.service: %.service.in Makefile + $(SED_PROCESS) + +%.1: %.txt + $(AM_V_GEN)a2x --doctype manpage --format manpage $(srcdir)/$< + +src/builtin.h: src/genbuiltin $(builtin_sources) + $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@ + +tools/%.rules: + $(AM_V_GEN)cp $(srcdir)/$(subst 97-,,$@) $@ + +$(lib_libbluetooth_la_OBJECTS): $(local_headers) + +lib/bluetooth/%.h: lib/%.h + $(AM_V_at)$(MKDIR_P) lib/bluetooth + $(AM_V_GEN)$(LN_S) -f "$(abs_top_builddir)"/$< $@ + +@COVERAGE_TRUE@clean-coverage: +@COVERAGE_TRUE@ @lcov --directory $(top_builddir) --zerocounters +@COVERAGE_TRUE@ $(RM) -r coverage $(top_builddir)/coverage.info + +@COVERAGE_TRUE@coverage: check +@COVERAGE_TRUE@ @lcov --compat-libtool --directory $(top_builddir) --capture \ +@COVERAGE_TRUE@ --output-file $(top_builddir)/coverage.info +@COVERAGE_TRUE@ $(AM_V_at)$(MKDIR_P) coverage +@COVERAGE_TRUE@ @genhtml -o coverage/ $(top_builddir)/coverage.info + +@COVERAGE_TRUE@clean-local: clean-coverage +@COVERAGE_TRUE@ -find $(top_builddir) -name "*.gcno" -delete +@COVERAGE_TRUE@ -find $(top_builddir) -name "*.gcda" -delete +@COVERAGE_TRUE@ $(RM) -r lib/bluetooth + +@COVERAGE_FALSE@clean-local: +@COVERAGE_FALSE@ -find $(top_builddir) -name "*.gcno" -delete +@COVERAGE_FALSE@ -find $(top_builddir) -name "*.gcda" -delete +@COVERAGE_FALSE@ $(RM) -r lib/bluetooth + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Makefile.obexd b/Makefile.obexd old mode 100644 new mode 100755 index 05a3b6b..2e33cbc --- a/Makefile.obexd +++ b/Makefile.obexd @@ -40,17 +40,16 @@ obexd_builtin_modules += pbap obexd_builtin_sources += obexd/plugins/pbap.c \ obexd/plugins/vcard.h obexd/plugins/vcard.c \ obexd/plugins/phonebook.h \ - obexd/plugins/phonebook-tizen.c + obexd/plugins/phonebook-dummy.c endif obexd_builtin_modules += mas obexd_builtin_sources += obexd/plugins/mas.c obexd/src/map_ap.h \ obexd/plugins/messages.h \ - obexd/plugins/messages-tizen.c + obexd/plugins/messages-dummy.c obexd_builtin_modules += mns obexd_builtin_sources += obexd/client/mns.c obexd/src/map_ap.h \ - obexd/client/mns-tizen.c \ obexd/client/map-event.h libexec_PROGRAMS += obexd/src/obexd @@ -82,20 +81,16 @@ obexd_src_obexd_SOURCES = $(btio_sources) $(gobex_sources) \ obexd/src/map_ap.h obexd_src_obexd_LDADD = lib/libbluetooth-internal.la \ gdbus/libgdbus-internal.la \ - @ICAL_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ \ - @LIBXML_LIBS@ @INIPARSER_LIBS@ -ldl + @ICAL_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ -ldl obexd_src_obexd_LDFLAGS = -Wl,--export-dynamic obexd_src_obexd_CFLAGS = $(AM_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ \ - @LIBXML_CFLAGS@ @INIPARSER_CFLAGS@ \ @ICAL_CFLAGS@ -DOBEX_PLUGIN_BUILTIN \ -DPLUGINDIR=\""$(obex_plugindir)"\" \ - -fPIC -D_FILE_OFFSET_BITS=64 -pie + -fPIC -D_FILE_OFFSET_BITS=64 -obexd_src_obexd_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/obexd/src \ - -I$(srcdir)/obexd/src -I$(srcdir)/btio \ - -I$(srcdir)/gobex -I$(srcdir)/gdbus +obexd_src_obexd_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/obexd/src obexd_src_obexd_SHORTNAME = obexd diff --git a/Makefile.plugins b/Makefile.plugins old mode 100644 new mode 100755 index 59dd332..ecf6f08 --- a/Makefile.plugins +++ b/Makefile.plugins @@ -2,46 +2,32 @@ builtin_modules += hostname builtin_sources += plugins/hostname.c -if TIZEN_UNUSED_PLUGIN builtin_modules += wiimote builtin_sources += plugins/wiimote.c -endif -if AUTOPAIR builtin_modules += autopair builtin_sources += plugins/autopair.c -endif builtin_modules += policy builtin_sources += plugins/policy.c -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -builtin_modules += dbusoob -builtin_sources += plugins/dbusoob.c \ - src/oob.h src/oob.c -#endif - if MAINTAINER_MODE builtin_modules += gatt_example builtin_sources += plugins/gatt-example.c endif if EXPERIMENTAL -if TIZEN_UNUSED_PLUGIN builtin_modules += neard builtin_sources += plugins/neard.c -endif -if TIZEN_SAP_PLUGIN builtin_modules += sap builtin_sources += profiles/sap/main.c profiles/sap/manager.h \ profiles/sap/manager.c profiles/sap/server.h \ profiles/sap/server.c profiles/sap/sap.h \ - profiles/sap/sap-u8500.c + profiles/sap/sap-dummy.c -#noinst_LIBRARIES += profiles/sap/libsap.a -#profiles_sap_libsap_a_SOURCES = profiles/sap/sap.h profiles/sap/sap-u8500.c -endif +noinst_LIBRARIES += profiles/sap/libsap.a +profiles_sap_libsap_a_SOURCES = profiles/sap/sap.h profiles/sap/sap-u8500.c endif builtin_modules += a2dp @@ -66,18 +52,12 @@ builtin_sources += profiles/network/manager.c \ profiles/network/connection.h \ profiles/network/connection.c -#if WEARABLE -#builtin_modules += -#builtin_sources += -#else -if TIZEN_HID_PLUGIN builtin_modules += input builtin_sources += profiles/input/manager.c \ profiles/input/server.h profiles/input/server.c \ profiles/input/device.h profiles/input/device.c \ profiles/input/hidp_defs.h -if TIZEN_UNUSED_PLUGIN builtin_modules += hog builtin_sources += profiles/input/hog.c profiles/input/uhid_copy.h \ profiles/input/hog-lib.c profiles/input/hog-lib.h \ @@ -87,12 +67,8 @@ builtin_sources += profiles/input/hog.c profiles/input/uhid_copy.h \ profiles/input/suspend.h profiles/input/suspend-none.c EXTRA_DIST += profiles/input/suspend-dummy.c -endif -endif -#endif if EXPERIMENTAL -if TIZEN_HEALTH_PLUGIN builtin_modules += health builtin_sources += profiles/health/mcap.h profiles/health/mcap.c \ profiles/health/hdp_main.c profiles/health/hdp_types.h \ @@ -101,9 +77,7 @@ builtin_sources += profiles/health/mcap.h profiles/health/mcap.c \ profiles/health/hdp.h profiles/health/hdp.c \ profiles/health/hdp_util.h profiles/health/hdp_util.c endif -endif -if TIZEN_HEALTH_PLUGIN builtin_modules += gap builtin_sources += profiles/gap/gas.c @@ -112,51 +86,11 @@ builtin_sources += profiles/scanparam/scan.c builtin_modules += deviceinfo builtin_sources += profiles/deviceinfo/deviceinfo.c -endif - -if EXPERIMENTAL -if TIZEN_PROXIMITY_PLUGIN -builtin_modules += proximity -builtin_sources += profiles/proximity/main.c profiles/proximity/manager.h \ - profiles/proximity/manager.c \ - profiles/proximity/monitor.h \ - profiles/proximity/monitor.c \ - profiles/proximity/reporter.h \ - profiles/proximity/reporter.c \ - profiles/proximity/linkloss.h \ - profiles/proximity/linkloss.c \ - profiles/proximity/immalert.h \ - profiles/proximity/immalert.c -endif - -if TIZEN_TDS_PLUGIN -builtin_modules += tds -builtin_sources += profiles/tds/manager.c profiles/tds/tds.h \ - profiles/tds/tds.c -endif - -if TIZEN_UNUSED_PLUGIN -builtin_modules += alert -builtin_sources += profiles/alert/server.c - -builtin_modules += time -builtin_sources += profiles/time/server.c - -builtin_modules += thermometer -builtin_sources += profiles/thermometer/thermometer.c - -builtin_modules += heartrate -builtin_sources += profiles/heartrate/heartrate.c - -builtin_modules += cyclingspeed -builtin_sources += profiles/cyclingspeed/cyclingspeed.c -endif -endif if SIXAXIS plugin_LTLIBRARIES += plugins/sixaxis.la plugins_sixaxis_la_SOURCES = plugins/sixaxis.c plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ - -no-undefined @UDEV_LIBS@ @LIBXML_LIBS@ @INIPARSER_LIBS@ -plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @UDEV_CFLAGS@ @LIBXML_CFLAGS@ @INIPARSER_CFLAGS@ + -no-undefined @UDEV_LIBS@ +plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @UDEV_CFLAGS@ endif diff --git a/Makefile.tools b/Makefile.tools old mode 100644 new mode 100755 index 4d80fc7..7706dc7 --- a/Makefile.tools +++ b/Makefile.tools @@ -5,6 +5,8 @@ bin_PROGRAMS += client/bluetoothctl client_bluetoothctl_SOURCES = client/main.c \ client/display.h client/display.c \ client/agent.h client/agent.c \ + client/advertising.h \ + client/advertising.c \ client/gatt.h client/gatt.c \ monitor/uuid.h monitor/uuid.c client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ @@ -36,7 +38,8 @@ monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ monitor/keys.h monitor/keys.c \ monitor/analyze.h monitor/analyze.c \ monitor/intel.h monitor/intel.c \ - monitor/broadcom.h monitor/broadcom.c + monitor/broadcom.h monitor/broadcom.c \ + monitor/tty.h monitor_btmon_LDADD = lib/libbluetooth-internal.la \ src/libshared-mainloop.la @UDEV_LIBS@ endif @@ -163,10 +166,8 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \ tools/hciattach_ath3k.c \ tools/hciattach_qualcomm.c \ tools/hciattach_intel.c \ - tools/hciattach_sprd.c \ - tools/pskey_get.c \ tools/hciattach_bcm43xx.c -tools_hciattach_LDADD = lib/libbluetooth-internal.la @LIBXML_LIBS@ @INIPARSER_LIBS@ +tools_hciattach_LDADD = lib/libbluetooth-internal.la tools_hciconfig_SOURCES = tools/hciconfig.c tools/csr.h tools/csr.c tools_hciconfig_LDADD = lib/libbluetooth-internal.la @@ -253,13 +254,12 @@ endif if EXPERIMENTAL bin_PROGRAMS += tools/btattach -bin_PROGRAMS += tools/btsnoop noinst_PROGRAMS += tools/bdaddr tools/avinfo tools/avtest \ tools/scotest tools/amptest tools/hwdb \ tools/hcieventmask tools/hcisecfilter \ tools/btinfo \ - tools/btproxy \ + tools/btsnoop tools/btproxy \ tools/btiotest tools/bneptest tools/mcaptest \ tools/cltest tools/oobtest tools/seq2bseq \ tools/nokfw tools/create-image \ diff --git a/NEWS b/NEWS old mode 100644 new mode 100755 diff --git a/README b/README old mode 100644 new mode 100755 diff --git a/TODO b/TODO old mode 100644 new mode 100755 index 8c710ef..d88349e --- a/TODO +++ b/TODO @@ -136,11 +136,6 @@ ATT/GATT (new shared stack) Priority: Medium Complexity: C1 -- Persist client attribute cache across reboots. - - Priority: Medium - Complexity: C4 - - Move all daemon plugins and profiles that are GATT based to use shared/gatt-client instead of attrib/*. This is a complicated task that potentially needs a new plugin/profile probing interface and a lot of @@ -162,12 +157,6 @@ ATT/GATT (new shared stack) Priority: Low Complexity: C1 -- Implement the server portion of doc/gatt-api.txt using shared/gatt-server once - it exists. - - Priority: Medium - Complexity: C4 - - Send out indications from the "Service Changed" characteristic upon reconnection if a bonded device is not connected when the local database is modified. @@ -195,94 +184,5 @@ ATT/GATT (new shared stack) Priority: Medium Complexity: C1 -- The recently added support for ATT signed writes requires the following kernel - modules to be enabled: - - CONFIG_CRYPTO_USER_API - CONFIG_CRYPTO_USER_API_HASH - CONFIG_CRYPTO_USER_API_SKCIPHER - - Currently, if these are not enabled, bt_att_new silently returns NULL. We - should handle this more gracefully by not supporting signed writes if we can't - initialize bt_crypto while succeeding bt_att initialization regardless. - - This behavior should be documented in the README. - - Priority: High - Complexity: C1 - - -ATT/GATT (old/outdated) -======================= - -- At the moment authentication and authorization is not supported at the - same time, read/write requirements in the attribute server needs to - be extended. According to Bluetooth Specification a server shall check - authentication and authorization requirements before any other check is - performed. - - Priority: Medium - Complexity: C1 - -- Implement ATT PDU validation. Malformed PDUs can cause division by zero - when decoding PDUs. A proper error PDU should be returned for this case. - See decoding function in att.c file. - - Priority: Medium - Complexity: C1 - -- Refactor read_by_group() and read_by_type() in src/attrib-server.c - (they've grown simply too big). First step could be to move out the - long for-loops to new functions called e.g. get_groups() and get_types(). - - Priority: Low - Complexity: C1 - -- Agent for characteristics: Agent interface should be extended to support - authorization per characteristic if the remote is not in the trusted list. - - Priority: Low - Complexity: C1 - -- gatttool should have the ability to wait for req responses before - quitting (some servers require a small sleep even with cmd's). Maybe a - --delay-exit or --timeout command line switch. - - Priority: Low - Complexity: C1 - -- Client needs to export a property in the Device Characteristic hierarchy - to manage characteristic value changes reports in the remote device. - Currently, Client Characteristic Configuration attribute is not exposed - as an object. The user needs to use gatttool to change the value of the - this attribute to receive notification/indications. Export this attribute - as a property is a proposal that needs further discussion. - - Priority: Low - Complexity: C1 - -- Attribute server should process queued GATT/ATT commands if the - client disconnects. The client can simply send a command and quit, - without wait for a response(ex: Write Command). For this scenario - that the client disconnects the link quickly the queued received - command is ignored. - - Priority: Low - Complecity: C1 - -- Implement Server characteristic Configuration support in the attribute - server to manage characteristic value broadcasting. There is a single - instance of the Server Characteristic Configuration for all clients. - See Volume 3, Part G, section 3.3.3.4 for more information. - - Priority: Low - Complexity: C1 - -- Long write is not implemented. Attribute server, client and command line - tool shall be changed to support this feature. - - Priority: Low - Complexity: C2 - Management Interface ==================== diff --git a/acinclude.m4 b/acinclude.m4 old mode 100644 new mode 100755 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100755 index 0000000..349c189 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,10003 @@ +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 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. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# 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 +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +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 + +# 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 + +_LT_CC_BASENAME([$compiler]) + +# 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 + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify 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' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# 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' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [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. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### 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 + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# 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 +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +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* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +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* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [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" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + 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" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_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=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="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}" + _LT_TAGVAR(module_expsym_cmds, $1)="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}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + 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" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + 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" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + 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" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# 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 \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + 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>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + 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" && \ + test undefined != "$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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$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 +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | 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 + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + 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" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/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_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = 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 +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # 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; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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=`func_echo_all "$lib" | $SED '\''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 # correct to gnu/linux during the next big refactor + 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,$cc_basename in + yes,*) + # gcc + 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}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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`' +m4_if([$1], [],[ + 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 # correct to gnu/linux during the next big refactor + 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 + ;; + +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[[23]].*) 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 + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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;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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +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 + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[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]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_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]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | 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 +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +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 + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[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]) +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 "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# 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};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /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 + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # 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 AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#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. */ +LT@&t@_DLSYM_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_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -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 +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | 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 + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + 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*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | 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). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + 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_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-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). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # 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 + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_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. +dnl Note also adjust exclude_expsyms for C++ above. + 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 | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + 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 + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$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... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$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* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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 + _LT_TAGVAR(ld_shlibs, $1)=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 + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=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 + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|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. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${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 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=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 + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-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. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$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 + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${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='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=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 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$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. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [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]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$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);}' + +_LT_TAG_COMPILER +# 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 +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # 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(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + 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 + 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 + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=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'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + 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. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf 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). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# 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 +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # 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}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[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. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.14' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.14.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.14.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [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 10 /bin/sh. + echo '/* dummy */' > 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 + ;; + msvc7 | msvc7msys | 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_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf 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")` + 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"` + # 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'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + 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 +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_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"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +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 +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[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. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# 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 +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +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 --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# 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]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4]) diff --git a/android/audio_utils/resampler.c b/android/audio_utils/resampler.c old mode 100644 new mode 100755 diff --git a/android/audio_utils/resampler.h b/android/audio_utils/resampler.h old mode 100644 new mode 100755 diff --git a/android/bas.c b/android/bas.c deleted file mode 100755 index dcbf9de..0000000 --- a/android/bas.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2014 Intel Corporation. All rights reserved. - * - * - * This library is free software; you can rebastribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is bastributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include - -#include "src/log.h" - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "src/shared/util.h" -#include "src/shared/queue.h" - -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" - -#include "android/bas.h" - -#define ATT_NOTIFICATION_HEADER_SIZE 3 -#define ATT_READ_RESPONSE_HEADER_SIZE 1 - -struct bt_bas { - int ref_count; - GAttrib *attrib; - struct gatt_primary *primary; - uint16_t handle; - uint16_t ccc_handle; - guint id; - struct queue *gatt_op; -}; - -struct gatt_request { - unsigned int id; - struct bt_bas *bas; - void *user_data; -}; - -static void destroy_gatt_req(struct gatt_request *req) -{ - queue_remove(req->bas->gatt_op, req); - bt_bas_unref(req->bas); - free(req); -} - -static void bas_free(struct bt_bas *bas) -{ - bt_bas_detach(bas); - - g_free(bas->primary); - queue_destroy(bas->gatt_op, (void *) destroy_gatt_req); - g_free(bas); -} - -struct bt_bas *bt_bas_new(void *primary) -{ - struct bt_bas *bas; - - bas = g_try_new0(struct bt_bas, 1); - if (!bas) - return NULL; - - bas->gatt_op = queue_new(); - if (!bas->gatt_op) { - bas_free(bas); - return NULL; - } - - if (primary) - bas->primary = g_memdup(primary, sizeof(*bas->primary)); - - return bt_bas_ref(bas); -} - -struct bt_bas *bt_bas_ref(struct bt_bas *bas) -{ - if (!bas) - return NULL; - - __sync_fetch_and_add(&bas->ref_count, 1); - - return bas; -} - -void bt_bas_unref(struct bt_bas *bas) -{ - if (!bas) - return; - - if (__sync_sub_and_fetch(&bas->ref_count, 1)) - return; - - bas_free(bas); -} - -static struct gatt_request *create_request(struct bt_bas *bas, - void *user_data) -{ - struct gatt_request *req; - - req = new0(struct gatt_request, 1); - if (!req) - return NULL; - - req->user_data = user_data; - req->bas = bt_bas_ref(bas); - - return req; -} - -static bool set_and_store_gatt_req(struct bt_bas *bas, - struct gatt_request *req, - unsigned int id) -{ - req->id = id; - return queue_push_head(bas->gatt_op, req); -} - -static void write_char(struct bt_bas *bas, GAttrib *attrib, uint16_t handle, - const uint8_t *value, size_t vlen, - GAttribResultFunc func, - gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(bas, user_data); - if (!req) - return; - - id = gatt_write_char(attrib, handle, value, vlen, func, req); - - if (set_and_store_gatt_req(bas, req, id)) - return; - - error("bas: Could not write characteristic"); - g_attrib_cancel(attrib, id); - free(req); - -} - -static void read_char(struct bt_bas *bas, GAttrib *attrib, uint16_t handle, - GAttribResultFunc func, gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(bas, user_data); - if (!req) - return; - - id = gatt_read_char(attrib, handle, func, req); - - if (set_and_store_gatt_req(bas, req, id)) - return; - - error("bas: Could not read characteristic"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void discover_char(struct bt_bas *bas, GAttrib *attrib, - uint16_t start, uint16_t end, - bt_uuid_t *uuid, gatt_cb_t func, - gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(bas, user_data); - if (!req) - return; - - id = gatt_discover_char(attrib, start, end, uuid, func, req); - - if (set_and_store_gatt_req(bas, req, id)) - return; - - error("bas: Could not discover characteristic"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void discover_desc(struct bt_bas *bas, GAttrib *attrib, - uint16_t start, uint16_t end, bt_uuid_t *uuid, - gatt_cb_t func, gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(bas, user_data); - if (!req) - return; - - id = gatt_discover_desc(attrib, start, end, uuid, func, req); - if (set_and_store_gatt_req(bas, req, id)) - return; - - error("bas: Could not discover descriptor"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void notification_cb(const guint8 *pdu, guint16 len, gpointer user_data) -{ - DBG("Battery Level at %u", pdu[ATT_NOTIFICATION_HEADER_SIZE]); -} - -static void read_value_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - DBG("Battery Level at %u", pdu[ATT_READ_RESPONSE_HEADER_SIZE]); -} - -static void ccc_written_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data) -{ - struct gatt_request *req = user_data; - struct bt_bas *bas = req->user_data; - - destroy_gatt_req(req); - - if (status != 0) { - error("Write Scan Refresh CCC failed: %s", - att_ecode2str(status)); - return; - } - - DBG("Battery Level: notification enabled"); - - bas->id = g_attrib_register(bas->attrib, ATT_OP_HANDLE_NOTIFY, - bas->handle, notification_cb, bas, - NULL); -} - -static void write_ccc(struct bt_bas *bas, GAttrib *attrib, uint16_t handle, - void *user_data) -{ - uint8_t value[2]; - - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value); - - write_char(bas, attrib, handle, value, sizeof(value), ccc_written_cb, - user_data); -} - -static void ccc_read_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct gatt_request *req = user_data; - struct bt_bas *bas = req->user_data; - - destroy_gatt_req(req); - - if (status != 0) { - error("Error reading CCC value: %s", att_ecode2str(status)); - return; - } - - write_ccc(bas, bas->attrib, bas->ccc_handle, bas); -} - -static void discover_descriptor_cb(uint8_t status, GSList *descs, - void *user_data) -{ - struct gatt_request *req = user_data; - struct bt_bas *bas = req->user_data; - struct gatt_desc *desc; - - destroy_gatt_req(req); - - if (status != 0) { - error("Discover descriptors failed: %s", att_ecode2str(status)); - return; - } - - /* There will be only one descriptor on list and it will be CCC */ - desc = descs->data; - bas->ccc_handle = desc->handle; - - read_char(bas, bas->attrib, desc->handle, ccc_read_cb, bas); -} - -static void bas_discovered_cb(uint8_t status, GSList *chars, void *user_data) -{ - struct gatt_request *req = user_data; - struct bt_bas *bas = req->user_data; - struct gatt_char *chr; - uint16_t start, end; - bt_uuid_t uuid; - - destroy_gatt_req(req); - - if (status) { - error("Battery: %s", att_ecode2str(status)); - return; - } - - chr = chars->data; - bas->handle = chr->value_handle; - - DBG("Battery handle: 0x%04x", bas->handle); - - read_char(bas, bas->attrib, bas->handle, read_value_cb, bas); - - start = chr->value_handle + 1; - end = bas->primary->range.end; - - bt_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID); - - discover_desc(bas, bas->attrib, start, end, &uuid, - discover_descriptor_cb, bas); -} - -bool bt_bas_attach(struct bt_bas *bas, void *attrib) -{ - if (!bas || bas->attrib || !bas->primary) - return false; - - bas->attrib = g_attrib_ref(attrib); - - if (bas->handle > 0) - return true; - - discover_char(bas, bas->attrib, bas->primary->range.start, - bas->primary->range.end, NULL, - bas_discovered_cb, bas); - - return true; -} - -static void cancel_gatt_req(struct gatt_request *req) -{ - if (g_attrib_cancel(req->bas->attrib, req->id)) - destroy_gatt_req(req); -} - -void bt_bas_detach(struct bt_bas *bas) -{ - if (!bas || !bas->attrib) - return; - - if (bas->id > 0) { - g_attrib_unregister(bas->attrib, bas->id); - bas->id = 0; - } - - queue_foreach(bas->gatt_op, (void *) cancel_gatt_req, NULL); - g_attrib_unref(bas->attrib); - bas->attrib = NULL; -} diff --git a/android/bas.h b/android/bas.h deleted file mode 100755 index 3e175b5..0000000 --- a/android/bas.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2014 Intel Corporation. All rights reserved. - * - * - * This library is free software; you can rebastribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is bastributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -struct bt_bas; - -struct bt_bas *bt_bas_new(void *primary); - -struct bt_bas *bt_bas_ref(struct bt_bas *bas); -void bt_bas_unref(struct bt_bas *bas); - -bool bt_bas_attach(struct bt_bas *bas, void *gatt); -void bt_bas_detach(struct bt_bas *bas); diff --git a/android/bluetoothd-snoop.c b/android/bluetoothd-snoop.c index 7526782..4b09663 100755 --- a/android/bluetoothd-snoop.c +++ b/android/bluetoothd-snoop.c @@ -139,7 +139,7 @@ static void data_callback(int fd, uint32_t events, void *user_data) flags = get_flags_from_opcode(opcode); if (flags != 0xff) - btsnoop_write(snoop, tv, flags, monitor_buf, pktlen); + btsnoop_write(snoop, tv, flags, 0, monitor_buf, pktlen); } } diff --git a/android/client/haltest.c b/android/client/haltest.c old mode 100644 new mode 100755 diff --git a/android/client/history.c b/android/client/history.c old mode 100644 new mode 100755 diff --git a/android/client/history.h b/android/client/history.h old mode 100644 new mode 100755 diff --git a/android/client/if-audio.c b/android/client/if-audio.c old mode 100644 new mode 100755 diff --git a/android/client/if-av-sink.c b/android/client/if-av-sink.c old mode 100644 new mode 100755 diff --git a/android/client/if-av.c b/android/client/if-av.c old mode 100644 new mode 100755 diff --git a/android/client/if-bt.c b/android/client/if-bt.c old mode 100644 new mode 100755 diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c old mode 100644 new mode 100755 diff --git a/android/client/if-hf-client.c b/android/client/if-hf-client.c old mode 100644 new mode 100755 diff --git a/android/client/if-hf.c b/android/client/if-hf.c old mode 100644 new mode 100755 diff --git a/android/client/if-hh.c b/android/client/if-hh.c old mode 100644 new mode 100755 diff --git a/android/client/if-hl.c b/android/client/if-hl.c old mode 100644 new mode 100755 diff --git a/android/client/if-main.h b/android/client/if-main.h old mode 100644 new mode 100755 diff --git a/android/client/if-mce.c b/android/client/if-mce.c old mode 100644 new mode 100755 diff --git a/android/client/if-pan.c b/android/client/if-pan.c old mode 100644 new mode 100755 diff --git a/android/client/if-rc-ctrl.c b/android/client/if-rc-ctrl.c old mode 100644 new mode 100755 diff --git a/android/client/if-rc.c b/android/client/if-rc.c old mode 100644 new mode 100755 diff --git a/android/client/if-sco.c b/android/client/if-sco.c old mode 100644 new mode 100755 diff --git a/android/client/if-sock.c b/android/client/if-sock.c old mode 100644 new mode 100755 diff --git a/android/client/pollhandler.c b/android/client/pollhandler.c old mode 100644 new mode 100755 diff --git a/android/client/pollhandler.h b/android/client/pollhandler.h old mode 100644 new mode 100755 diff --git a/android/client/tabcompletion.c b/android/client/tabcompletion.c old mode 100644 new mode 100755 diff --git a/android/client/terminal.c b/android/client/terminal.c old mode 100644 new mode 100755 diff --git a/android/client/terminal.h b/android/client/terminal.h old mode 100644 new mode 100755 diff --git a/android/compat/readline/history.h b/android/compat/readline/history.h old mode 100644 new mode 100755 diff --git a/android/compat/readline/readline.h b/android/compat/readline/readline.h old mode 100644 new mode 100755 diff --git a/android/compat/wordexp.h b/android/compat/wordexp.h old mode 100644 new mode 100755 diff --git a/android/cutils/properties.h b/android/cutils/properties.h old mode 100644 new mode 100755 diff --git a/android/dis.c b/android/dis.c deleted file mode 100755 index 75dbe3d..0000000 --- a/android/dis.c +++ /dev/null @@ -1,304 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Texas Instruments, 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 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include - -#include "src/log.h" - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "src/shared/util.h" -#include "src/shared/queue.h" - -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" - -#include "android/dis.h" - -#define PNP_ID_SIZE 7 - -struct bt_dis { - int ref_count; - uint16_t handle; - uint8_t source; - uint16_t vendor; - uint16_t product; - uint16_t version; - GAttrib *attrib; /* GATT connection */ - struct gatt_primary *primary; /* Primary details */ - bt_dis_notify notify; - void *notify_data; - struct queue *gatt_op; -}; - -struct characteristic { - struct gatt_char attr; /* Characteristic */ - struct bt_dis *d; /* deviceinfo where the char belongs */ -}; - -struct gatt_request { - unsigned int id; - struct bt_dis *dis; - void *user_data; -}; - -static void destroy_gatt_req(struct gatt_request *req) -{ - queue_remove(req->dis->gatt_op, req); - bt_dis_unref(req->dis); - free(req); -} - -static void dis_free(struct bt_dis *dis) -{ - bt_dis_detach(dis); - - g_free(dis->primary); - queue_destroy(dis->gatt_op, (void *) destroy_gatt_req); - g_free(dis); -} - -struct bt_dis *bt_dis_new(void *primary) -{ - struct bt_dis *dis; - - dis = g_try_new0(struct bt_dis, 1); - if (!dis) - return NULL; - - dis->gatt_op = queue_new(); - if (!dis->gatt_op) { - dis_free(dis); - return NULL; - } - - if (primary) - dis->primary = g_memdup(primary, sizeof(*dis->primary)); - - return bt_dis_ref(dis); -} - -struct bt_dis *bt_dis_ref(struct bt_dis *dis) -{ - if (!dis) - return NULL; - - __sync_fetch_and_add(&dis->ref_count, 1); - - return dis; -} - -void bt_dis_unref(struct bt_dis *dis) -{ - if (!dis) - return; - - if (__sync_sub_and_fetch(&dis->ref_count, 1)) - return; - - dis_free(dis); -} - -static struct gatt_request *create_request(struct bt_dis *dis, - void *user_data) -{ - struct gatt_request *req; - - req = new0(struct gatt_request, 1); - if (!req) - return NULL; - - req->user_data = user_data; - req->dis = bt_dis_ref(dis); - - return req; -} - -static bool set_and_store_gatt_req(struct bt_dis *dis, - struct gatt_request *req, - unsigned int id) -{ - req->id = id; - return queue_push_head(dis->gatt_op, req); -} - -static void read_pnpid_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct gatt_request *req = user_data; - struct bt_dis *dis = req->user_data; - uint8_t value[PNP_ID_SIZE]; - ssize_t vlen; - - destroy_gatt_req(req); - - if (status != 0) { - error("Error reading PNP_ID value: %s", att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, len, value, sizeof(value)); - if (vlen < 0) { - error("Error reading PNP_ID: Protocol error"); - return; - } - - if (vlen < 7) { - error("Error reading PNP_ID: Invalid pdu length received"); - return; - } - - dis->source = value[0]; - dis->vendor = get_le16(&value[1]); - dis->product = get_le16(&value[3]); - dis->version = get_le16(&value[5]); - - DBG("source: 0x%02X vendor: 0x%04X product: 0x%04X version: 0x%04X", - dis->source, dis->vendor, dis->product, dis->version); - - if (dis->notify) - dis->notify(dis->source, dis->vendor, dis->product, - dis->version, dis->notify_data); -} - -static void read_char(struct bt_dis *dis, GAttrib *attrib, uint16_t handle, - GAttribResultFunc func, gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(dis, user_data); - if (!req) - return; - - id = gatt_read_char(attrib, handle, func, req); - - if (set_and_store_gatt_req(dis, req, id)) - return; - - error("dis: Could not read characteristic"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void discover_char(struct bt_dis *dis, GAttrib *attrib, - uint16_t start, uint16_t end, - bt_uuid_t *uuid, gatt_cb_t func, - gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(dis, user_data); - if (!req) - return; - - id = gatt_discover_char(attrib, start, end, uuid, func, req); - - if (set_and_store_gatt_req(dis, req, id)) - return; - - error("dis: Could not send discover characteristic"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void configure_deviceinfo_cb(uint8_t status, GSList *characteristics, - void *user_data) -{ - struct gatt_request *req = user_data; - struct bt_dis *d = req->user_data; - GSList *l; - - destroy_gatt_req(req); - - if (status != 0) { - error("Discover deviceinfo characteristics: %s", - att_ecode2str(status)); - return; - } - - for (l = characteristics; l; l = l->next) { - struct gatt_char *c = l->data; - - if (strcmp(c->uuid, PNPID_UUID) == 0) { - d->handle = c->value_handle; - read_char(d, d->attrib, d->handle, read_pnpid_cb, d); - break; - } - } -} - -bool bt_dis_attach(struct bt_dis *dis, void *attrib) -{ - struct gatt_primary *primary = dis->primary; - - if (dis->attrib || !primary) - return false; - - dis->attrib = g_attrib_ref(attrib); - - if (!dis->handle) - discover_char(dis, dis->attrib, primary->range.start, - primary->range.end, NULL, - configure_deviceinfo_cb, dis); - - return true; -} - -static void cancel_gatt_req(struct gatt_request *req) -{ - if (g_attrib_cancel(req->dis->attrib, req->id)) - destroy_gatt_req(req); -} - -void bt_dis_detach(struct bt_dis *dis) -{ - if (!dis->attrib) - return; - - queue_foreach(dis->gatt_op, (void *) cancel_gatt_req, NULL); - g_attrib_unref(dis->attrib); - dis->attrib = NULL; -} - -bool bt_dis_set_notification(struct bt_dis *dis, bt_dis_notify func, - void *user_data) -{ - if (!dis) - return false; - - dis->notify = func; - dis->notify_data = user_data; - - return true; -} diff --git a/android/hardware/audio.h b/android/hardware/audio.h old mode 100644 new mode 100755 diff --git a/android/hardware/audio_effect.h b/android/hardware/audio_effect.h old mode 100644 new mode 100755 diff --git a/android/hardware/bluetooth.h b/android/hardware/bluetooth.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_av.h b/android/hardware/bt_av.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_gatt.h b/android/hardware/bt_gatt.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_gatt_client.h b/android/hardware/bt_gatt_client.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_gatt_server.h b/android/hardware/bt_gatt_server.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_gatt_types.h b/android/hardware/bt_gatt_types.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_hf.h b/android/hardware/bt_hf.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_hf_client.h b/android/hardware/bt_hf_client.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_hh.h b/android/hardware/bt_hh.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_hl.h b/android/hardware/bt_hl.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_mce.h b/android/hardware/bt_mce.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_pan.h b/android/hardware/bt_pan.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_rc.h b/android/hardware/bt_rc.h old mode 100644 new mode 100755 diff --git a/android/hardware/bt_sock.h b/android/hardware/bt_sock.h old mode 100644 new mode 100755 diff --git a/android/hardware/hardware.c b/android/hardware/hardware.c old mode 100644 new mode 100755 diff --git a/android/hardware/hardware.h b/android/hardware/hardware.h old mode 100644 new mode 100755 diff --git a/android/hog.c b/android/hog.c deleted file mode 100755 index ff77bb3..0000000 --- a/android/hog.c +++ /dev/null @@ -1,1511 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2014 Intel Corporation. - * Copyright (C) 2012 Marcel Holtmann - * Copyright (C) 2012 Nordic Semiconductor Inc. - * Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "src/shared/util.h" -#include "src/shared/uhid.h" -#include "src/shared/queue.h" -#include "src/log.h" - -#include "attrib/att.h" -#include "attrib/gattrib.h" -#include "attrib/gatt.h" - -#include "btio/btio.h" - -#include "android/scpp.h" -#include "android/dis.h" -#include "android/bas.h" -#include "android/hog.h" - -#define HOG_UUID "00001812-0000-1000-8000-00805f9b34fb" - -#define HOG_INFO_UUID 0x2A4A -#define HOG_REPORT_MAP_UUID 0x2A4B -#define HOG_REPORT_UUID 0x2A4D -#define HOG_PROTO_MODE_UUID 0x2A4E -#define HOG_CONTROL_POINT_UUID 0x2A4C - -#define HOG_REPORT_TYPE_INPUT 1 -#define HOG_REPORT_TYPE_OUTPUT 2 -#define HOG_REPORT_TYPE_FEATURE 3 - -#define HOG_PROTO_MODE_BOOT 0 -#define HOG_PROTO_MODE_REPORT 1 - -#define HOG_REPORT_MAP_MAX_SIZE 512 -#define HID_INFO_SIZE 4 -#define ATT_NOTIFICATION_HEADER_SIZE 3 - -struct bt_hog { - int ref_count; - char *name; - uint16_t vendor; - uint16_t product; - uint16_t version; - struct gatt_primary *primary; - GAttrib *attrib; - GSList *reports; - struct bt_uhid *uhid; - int uhid_fd; - gboolean has_report_id; - uint16_t bcdhid; - uint8_t bcountrycode; - uint16_t proto_mode_handle; - uint16_t ctrlpt_handle; - uint8_t flags; - unsigned int getrep_att; - uint16_t getrep_id; - unsigned int setrep_att; - uint16_t setrep_id; - struct bt_scpp *scpp; - struct bt_dis *dis; - struct queue *bas; - GSList *instances; - struct queue *gatt_op; -}; - -struct report { - struct bt_hog *hog; - uint8_t id; - uint8_t type; - uint16_t ccc_handle; - guint notifyid; - struct gatt_char *decl; - uint16_t len; - uint8_t *value; -}; - -struct gatt_request { - unsigned int id; - struct bt_hog *hog; - void *user_data; -}; - -static struct gatt_request *create_request(struct bt_hog *hog, - void *user_data) -{ - struct gatt_request *req; - - req = new0(struct gatt_request, 1); - if (!req) - return NULL; - - req->user_data = user_data; - req->hog = bt_hog_ref(hog); - - return req; -} - -static bool set_and_store_gatt_req(struct bt_hog *hog, - struct gatt_request *req, - unsigned int id) -{ - req->id = id; - return queue_push_head(hog->gatt_op, req); -} - -static void destroy_gatt_req(struct gatt_request *req) -{ - queue_remove(req->hog->gatt_op, req); - bt_hog_unref(req->hog); - free(req); -} - -static void write_char(struct bt_hog *hog, GAttrib *attrib, uint16_t handle, - const uint8_t *value, size_t vlen, - GAttribResultFunc func, - gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(hog, user_data); - if (!req) - return; - - id = gatt_write_char(attrib, handle, value, vlen, func, req); - - if (set_and_store_gatt_req(hog, req, id)) - return; - - error("hog: Could not read char"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void read_char(struct bt_hog *hog, GAttrib *attrib, uint16_t handle, - GAttribResultFunc func, gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(hog, user_data); - if (!req) - return; - - id = gatt_read_char(attrib, handle, func, req); - - if (set_and_store_gatt_req(hog, req, id)) - return; - - error("hog: Could not read char"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void discover_desc(struct bt_hog *hog, GAttrib *attrib, - uint16_t start, uint16_t end, gatt_cb_t func, - gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(hog, user_data); - if (!req) - return; - - id = gatt_discover_desc(attrib, start, end, NULL, func, req); - if (set_and_store_gatt_req(hog, req, id)) - return; - - error("hog: Could not discover descriptors"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void discover_char(struct bt_hog *hog, GAttrib *attrib, - uint16_t start, uint16_t end, - bt_uuid_t *uuid, gatt_cb_t func, - gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(hog, user_data); - if (!req) - return; - - id = gatt_discover_char(attrib, start, end, uuid, func, req); - - if (set_and_store_gatt_req(hog, req, id)) - return; - - error("hog: Could not discover characteristic"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void discover_primary(struct bt_hog *hog, GAttrib *attrib, - bt_uuid_t *uuid, gatt_cb_t func, - gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(hog, user_data); - if (!req) - return; - - id = gatt_discover_primary(attrib, uuid, func, req); - - if (set_and_store_gatt_req(hog, req, id)) - return; - - error("hog: Could not send discover primary"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void find_included(struct bt_hog *hog, GAttrib *attrib, - uint16_t start, uint16_t end, - gatt_cb_t func, gpointer user_data) -{ - struct gatt_request *req; - unsigned int id; - - req = create_request(hog, user_data); - if (!req) - return; - - id = gatt_find_included(attrib, start, end, func, req); - - if (set_and_store_gatt_req(hog, req, id)) - return; - - error("Could not find included"); - g_attrib_cancel(attrib, id); - free(req); -} - -static void report_value_cb(const guint8 *pdu, guint16 len, gpointer user_data) -{ - struct report *report = user_data; - struct bt_hog *hog = report->hog; - struct uhid_event ev; - uint8_t *buf; - int err; - - if (len < ATT_NOTIFICATION_HEADER_SIZE) { - error("Malformed ATT notification"); - return; - } - - pdu += ATT_NOTIFICATION_HEADER_SIZE; - len -= ATT_NOTIFICATION_HEADER_SIZE; - - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_INPUT; - buf = ev.u.input.data; - - if (hog->has_report_id) { - buf[0] = report->id; - len = MIN(len, sizeof(ev.u.input.data) - 1); - memcpy(buf + 1, pdu, len); - ev.u.input.size = ++len; - } else { - len = MIN(len, sizeof(ev.u.input.data)); - memcpy(buf, pdu, len); - ev.u.input.size = len; - } - - err = bt_uhid_send(hog->uhid, &ev); - if (err < 0) { - error("bt_uhid_send: %s (%d)", strerror(-err), -err); - return; - } - - DBG("HoG report (%u bytes)", ev.u.input.size); -} - -static void report_ccc_written_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data) -{ - struct gatt_request *req = user_data; - struct report *report = req->user_data; - struct bt_hog *hog = report->hog; - - destroy_gatt_req(req); - - if (status != 0) { - error("Write report characteristic descriptor failed: %s", - att_ecode2str(status)); - return; - } - - report->notifyid = g_attrib_register(hog->attrib, - ATT_OP_HANDLE_NOTIFY, - report->decl->value_handle, - report_value_cb, report, NULL); - - DBG("Report characteristic descriptor written: notifications enabled"); -} - -static void write_ccc(struct bt_hog *hog, GAttrib *attrib, uint16_t handle, - void *user_data) -{ - uint8_t value[2]; - - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value); - - write_char(hog, attrib, handle, value, sizeof(value), - report_ccc_written_cb, user_data); -} - -static void ccc_read_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct gatt_request *req = user_data; - struct report *report = req->user_data; - - destroy_gatt_req(req); - - if (status != 0) { - error("Error reading CCC value: %s", att_ecode2str(status)); - return; - } - - write_ccc(report->hog, report->hog->attrib, report->ccc_handle, report); -} - -static void report_reference_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data) -{ - struct gatt_request *req = user_data; - struct report *report = req->user_data; - - destroy_gatt_req(req); - - if (status != 0) { - error("Read Report Reference descriptor failed: %s", - att_ecode2str(status)); - return; - } - - if (plen != 3) { - error("Malformed ATT read response"); - return; - } - - report->id = pdu[1]; - report->type = pdu[2]; - DBG("Report ID: 0x%02x Report type: 0x%02x", pdu[1], pdu[2]); - - /* Enable notifications only for Input Reports */ - if (report->type == HOG_REPORT_TYPE_INPUT) - read_char(report->hog, report->hog->attrib, report->ccc_handle, - ccc_read_cb, report); -} - -static void external_report_reference_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data); - -static void discover_external_cb(uint8_t status, GSList *descs, void *user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - - destroy_gatt_req(req); - - if (status != 0) { - error("Discover external descriptors failed: %s", - att_ecode2str(status)); - return; - } - - for ( ; descs; descs = descs->next) { - struct gatt_desc *desc = descs->data; - - read_char(hog, hog->attrib, desc->handle, - external_report_reference_cb, - hog); - } -} - -static void discover_external(struct bt_hog *hog, GAttrib *attrib, - uint16_t start, uint16_t end, - gpointer user_data) -{ - bt_uuid_t uuid; - - if (start > end) - return; - - bt_uuid16_create(&uuid, GATT_EXTERNAL_REPORT_REFERENCE); - - discover_desc(hog, attrib, start, end, discover_external_cb, - user_data); -} - -static void discover_report_cb(uint8_t status, GSList *descs, void *user_data) -{ - struct gatt_request *req = user_data; - struct report *report = req->user_data; - struct bt_hog *hog = report->hog; - - destroy_gatt_req(req); - - if (status != 0) { - error("Discover report descriptors failed: %s", - att_ecode2str(status)); - return; - } - - for ( ; descs; descs = descs->next) { - struct gatt_desc *desc = descs->data; - - switch (desc->uuid16) { - case GATT_CLIENT_CHARAC_CFG_UUID: - report->ccc_handle = desc->handle; - break; - case GATT_REPORT_REFERENCE: - read_char(hog, hog->attrib, desc->handle, - report_reference_cb, report); - break; - } - } -} - -static void discover_report(struct bt_hog *hog, GAttrib *attrib, - uint16_t start, uint16_t end, - gpointer user_data) -{ - if (start > end) - return; - - discover_desc(hog, attrib, start, end, discover_report_cb, user_data); -} - -static void report_read_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct gatt_request *req = user_data; - struct report *report = req->user_data; - - destroy_gatt_req(req); - - if (status != 0) { - error("Error reading Report value: %s", att_ecode2str(status)); - return; - } - - if (report->value) - g_free(report->value); - - report->value = g_memdup(pdu, len); - report->len = len; -} - -static struct report *report_new(struct bt_hog *hog, struct gatt_char *chr) -{ - struct report *report; - - report = g_new0(struct report, 1); - report->hog = hog; - report->decl = g_memdup(chr, sizeof(*chr)); - hog->reports = g_slist_append(hog->reports, report); - - read_char(hog, hog->attrib, chr->value_handle, report_read_cb, report); - - return report; -} - -static void external_service_char_cb(uint8_t status, GSList *chars, - void *user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - struct gatt_primary *primary = hog->primary; - struct report *report; - GSList *l; - - destroy_gatt_req(req); - - if (status != 0) { - const char *str = att_ecode2str(status); - DBG("Discover external service characteristic failed: %s", str); - return; - } - - for (l = chars; l; l = g_slist_next(l)) { - struct gatt_char *chr, *next; - uint16_t start, end; - - chr = l->data; - next = l->next ? l->next->data : NULL; - - DBG("0x%04x UUID: %s properties: %02x", - chr->handle, chr->uuid, chr->properties); - - report = report_new(hog, chr); - start = chr->value_handle + 1; - end = (next ? next->handle - 1 : primary->range.end); - discover_report(hog, hog->attrib, start, end, report); - } -} - -static void external_report_reference_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - uint16_t uuid16; - bt_uuid_t uuid; - - destroy_gatt_req(req); - - if (status != 0) { - error("Read External Report Reference descriptor failed: %s", - att_ecode2str(status)); - return; - } - - if (plen != 3) { - error("Malformed ATT read response"); - return; - } - - uuid16 = get_le16(&pdu[1]); - DBG("External report reference read, external report characteristic " - "UUID: 0x%04x", uuid16); - - /* Do not discover if is not a Report */ - if (uuid16 != HOG_REPORT_UUID) - return; - - bt_uuid16_create(&uuid, uuid16); - discover_char(hog, hog->attrib, 0x0001, 0xffff, &uuid, - external_service_char_cb, hog); -} - -static int report_cmp(gconstpointer a, gconstpointer b) -{ - const struct report *ra = a, *rb = b; - - /* sort by type first.. */ - if (ra->type != rb->type) - return ra->type - rb->type; - - /* skip id check in case of report id 0 */ - if (!rb->id) - return 0; - - /* ..then by id */ - return ra->id - rb->id; -} - -static struct report *find_report(struct bt_hog *hog, uint8_t type, uint8_t id) -{ - struct report cmp; - GSList *l; - - cmp.type = type; - cmp.id = hog->has_report_id ? id : 0; - - l = g_slist_find_custom(hog->reports, &cmp, report_cmp); - - return l ? l->data : NULL; -} - -static struct report *find_report_by_rtype(struct bt_hog *hog, uint8_t rtype, - uint8_t id) -{ - uint8_t type; - - switch (rtype) { - case UHID_FEATURE_REPORT: - type = HOG_REPORT_TYPE_FEATURE; - break; - case UHID_OUTPUT_REPORT: - type = HOG_REPORT_TYPE_OUTPUT; - break; - case UHID_INPUT_REPORT: - type = HOG_REPORT_TYPE_INPUT; - break; - default: - return NULL; - } - - return find_report(hog, type, id); -} - -static void output_written_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data) -{ - struct gatt_request *req = user_data; - - destroy_gatt_req(req); - - if (status != 0) { - error("Write output report failed: %s", att_ecode2str(status)); - return; - } -} - -static void forward_report(struct uhid_event *ev, void *user_data) -{ - struct bt_hog *hog = user_data; - struct report *report; - void *data; - int size; - - report = find_report_by_rtype(hog, ev->u.output.rtype, - ev->u.output.data[0]); - if (!report) - return; - - data = ev->u.output.data; - size = ev->u.output.size; - if (hog->has_report_id && size > 0) { - data++; - --size; - } - - DBG("Sending report type %d ID %d to handle 0x%X", report->type, - report->id, report->decl->value_handle); - - if (hog->attrib == NULL) - return; - - if (report->decl->properties & GATT_CHR_PROP_WRITE) - write_char(hog, hog->attrib, report->decl->value_handle, - data, size, output_written_cb, hog); - else if (report->decl->properties & GATT_CHR_PROP_WRITE_WITHOUT_RESP) - gatt_write_cmd(hog->attrib, report->decl->value_handle, - data, size, NULL, NULL); -} - -static void get_feature(struct uhid_event *ev, void *user_data) -{ - struct bt_hog *hog = user_data; - struct report *report; - struct uhid_event rsp; - int err; - - memset(&rsp, 0, sizeof(rsp)); - rsp.type = UHID_FEATURE_ANSWER; - rsp.u.feature_answer.id = ev->u.feature.id; - - report = find_report_by_rtype(hog, ev->u.feature.rtype, - ev->u.feature.rnum); - if (!report) { - rsp.u.feature_answer.err = ENOTSUP; - goto done; - } - - if (!report->value) { - rsp.u.feature_answer.err = EIO; - goto done; - } - - rsp.u.feature_answer.size = report->len; - memcpy(rsp.u.feature_answer.data, report->value, report->len); - -done: - err = bt_uhid_send(hog->uhid, &rsp); - if (err < 0) - error("bt_uhid_send: %s", strerror(-err)); -} - -static void set_report_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data) -{ - struct bt_hog *hog = user_data; - struct uhid_event rsp; - int err; - - hog->setrep_att = 0; - - memset(&rsp, 0, sizeof(rsp)); - rsp.type = UHID_SET_REPORT_REPLY; - rsp.u.set_report_reply.id = hog->setrep_id; - rsp.u.set_report_reply.err = status; - - if (status != 0) - error("Error setting Report value: %s", att_ecode2str(status)); - - err = bt_uhid_send(hog->uhid, &rsp); - if (err < 0) - error("bt_uhid_send: %s", strerror(-err)); -} - -static void set_report(struct uhid_event *ev, void *user_data) -{ - struct bt_hog *hog = user_data; - struct report *report; - void *data; - int size; - int err; - - /* uhid never sends reqs in parallel; if there's a req, it timed out */ - if (hog->setrep_att) { - g_attrib_cancel(hog->attrib, hog->setrep_att); - hog->setrep_att = 0; - } - - hog->setrep_id = ev->u.set_report.id; - - report = find_report_by_rtype(hog, ev->u.set_report.rtype, - ev->u.set_report.rnum); - if (!report) { - err = ENOTSUP; - goto fail; - } - - data = ev->u.set_report.data; - size = ev->u.set_report.size; - if (hog->has_report_id && size > 0) { - data++; - --size; - } - - DBG("Sending report type %d ID %d to handle 0x%X", report->type, - report->id, report->decl->value_handle); - - if (hog->attrib == NULL) - return; - - hog->setrep_att = gatt_write_char(hog->attrib, - report->decl->value_handle, - data, size, set_report_cb, - hog); - if (!hog->setrep_att) { - err = ENOMEM; - goto fail; - } - - return; -fail: - /* cancel the request on failure */ - set_report_cb(err, NULL, 0, hog); -} - -static void get_report_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct bt_hog *hog = user_data; - struct uhid_event rsp; - int err; - - hog->getrep_att = 0; - - memset(&rsp, 0, sizeof(rsp)); - rsp.type = UHID_GET_REPORT_REPLY; - rsp.u.get_report_reply.id = hog->getrep_id; - - if (status != 0) { - error("Error reading Report value: %s", att_ecode2str(status)); - goto exit; - } - - if (len == 0) { - error("Error reading Report, length %d", len); - status = EIO; - goto exit; - } - - if (pdu[0] != 0x0b) { - error("Error reading Report, invalid response: %02x", pdu[0]); - status = EPROTO; - goto exit; - } - - --len; - ++pdu; - if (hog->has_report_id && len > 0) { - --len; - ++pdu; - } - - rsp.u.get_report_reply.size = len; - memcpy(rsp.u.get_report_reply.data, pdu, len); - -exit: - rsp.u.get_report_reply.err = status; - err = bt_uhid_send(hog->uhid, &rsp); - if (err < 0) - error("bt_uhid_send: %s", strerror(-err)); -} - -static void get_report(struct uhid_event *ev, void *user_data) -{ - struct bt_hog *hog = user_data; - struct report *report; - guint8 err; - - /* uhid never sends reqs in parallel; if there's a req, it timed out */ - if (hog->getrep_att) { - g_attrib_cancel(hog->attrib, hog->getrep_att); - hog->getrep_att = 0; - } - - hog->getrep_id = ev->u.get_report.id; - - report = find_report_by_rtype(hog, ev->u.get_report.rtype, - ev->u.get_report.rnum); - if (!report) { - err = ENOTSUP; - goto fail; - } - - hog->getrep_att = gatt_read_char(hog->attrib, - report->decl->value_handle, - get_report_cb, hog); - if (!hog->getrep_att) { - err = ENOMEM; - goto fail; - } - - return; - -fail: - /* cancel the request on failure */ - get_report_cb(err, NULL, 0, hog); -} - -static bool get_descriptor_item_info(uint8_t *buf, ssize_t blen, ssize_t *len, - bool *is_long) -{ - if (!blen) - return false; - - *is_long = (buf[0] == 0xfe); - - if (*is_long) { - if (blen < 3) - return false; - - /* - * long item: - * byte 0 -> 0xFE - * byte 1 -> data size - * byte 2 -> tag - * + data - */ - - *len = buf[1] + 3; - } else { - uint8_t b_size; - - /* - * short item: - * byte 0[1..0] -> data size (=0, 1, 2, 4) - * byte 0[3..2] -> type - * byte 0[7..4] -> tag - * + data - */ - - b_size = buf[0] & 0x03; - *len = (b_size ? 1 << (b_size - 1) : 0) + 1; - } - - /* item length should be no more than input buffer length */ - return *len <= blen; -} - -static char *item2string(char *str, uint8_t *buf, uint8_t len) -{ - char *p = str; - int i; - - /* - * Since long item tags are not defined except for vendor ones, we - * just ensure that short items are printed properly (up to 5 bytes). - */ - for (i = 0; i < 6 && i < len; i++) - p += sprintf(p, " %02x", buf[i]); - - /* - * If there are some data left, just add continuation mark to indicate - * this. - */ - if (i < len) - sprintf(p, " ..."); - - return str; -} - -static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen, - gpointer user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - uint8_t value[HOG_REPORT_MAP_MAX_SIZE]; - struct uhid_event ev; - ssize_t vlen; - char itemstr[20]; /* 5x3 (data) + 4 (continuation) + 1 (null) */ - int i, err; - GError *gerr = NULL; - - destroy_gatt_req(req); - - if (status != 0) { - error("Report Map read failed: %s", att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, plen, value, sizeof(value)); - if (vlen < 0) { - error("ATT protocol error"); - return; - } - - DBG("Report MAP:"); - for (i = 0; i < vlen;) { - ssize_t ilen = 0; - bool long_item = false; - - if (get_descriptor_item_info(&value[i], vlen - i, &ilen, - &long_item)) { - /* Report ID is short item with prefix 100001xx */ - if (!long_item && (value[i] & 0xfc) == 0x84) - hog->has_report_id = TRUE; - - DBG("\t%s", item2string(itemstr, &value[i], ilen)); - - i += ilen; - } else { - error("Report Map parsing failed at %d", i); - - /* Just print remaining items at once and break */ - DBG("\t%s", item2string(itemstr, &value[i], vlen - i)); - break; - } - } - - /* create uHID device */ - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_CREATE; - - bt_io_get(g_attrib_get_channel(hog->attrib), &gerr, - BT_IO_OPT_SOURCE, ev.u.create.phys, - BT_IO_OPT_DEST, ev.u.create.uniq, - BT_IO_OPT_INVALID); - if (gerr) { - error("Failed to connection details: %s", gerr->message); - g_error_free(gerr); - return; - } - - strcpy((char *) ev.u.create.name, hog->name); - ev.u.create.vendor = hog->vendor; - ev.u.create.product = hog->product; - ev.u.create.version = hog->version; - ev.u.create.country = hog->bcountrycode; - ev.u.create.bus = BUS_BLUETOOTH; - ev.u.create.rd_data = value; - ev.u.create.rd_size = vlen; - - err = bt_uhid_send(hog->uhid, &ev); - if (err < 0) { - error("bt_uhid_send: %s", strerror(-err)); - return; - } - - bt_uhid_register(hog->uhid, UHID_OUTPUT, forward_report, hog); - bt_uhid_register(hog->uhid, UHID_FEATURE, get_feature, hog); - bt_uhid_register(hog->uhid, UHID_GET_REPORT, get_report, hog); - bt_uhid_register(hog->uhid, UHID_SET_REPORT, set_report, hog); -} - -static void info_read_cb(guint8 status, const guint8 *pdu, guint16 plen, - gpointer user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - uint8_t value[HID_INFO_SIZE]; - ssize_t vlen; - - destroy_gatt_req(req); - - if (status != 0) { - error("HID Information read failed: %s", - att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, plen, value, sizeof(value)); - if (vlen != 4) { - error("ATT protocol error"); - return; - } - - hog->bcdhid = get_le16(&value[0]); - hog->bcountrycode = value[2]; - hog->flags = value[3]; - - DBG("bcdHID: 0x%04X bCountryCode: 0x%02X Flags: 0x%02X", - hog->bcdhid, hog->bcountrycode, hog->flags); -} - -static void proto_mode_read_cb(guint8 status, const guint8 *pdu, guint16 plen, - gpointer user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - uint8_t value; - ssize_t vlen; - - destroy_gatt_req(req); - - if (status != 0) { - error("Protocol Mode characteristic read failed: %s", - att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, plen, &value, sizeof(value)); - if (vlen < 0) { - error("ATT protocol error"); - return; - } - - if (value == HOG_PROTO_MODE_BOOT) { - uint8_t nval = HOG_PROTO_MODE_REPORT; - - DBG("HoG is operating in Boot Procotol Mode"); - - gatt_write_cmd(hog->attrib, hog->proto_mode_handle, &nval, - sizeof(nval), NULL, NULL); - } else if (value == HOG_PROTO_MODE_REPORT) - DBG("HoG is operating in Report Protocol Mode"); -} - -static void char_discovered_cb(uint8_t status, GSList *chars, void *user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - struct gatt_primary *primary = hog->primary; - bt_uuid_t report_uuid, report_map_uuid, info_uuid; - bt_uuid_t proto_mode_uuid, ctrlpt_uuid; - struct report *report; - GSList *l; - uint16_t info_handle = 0, proto_mode_handle = 0; - - destroy_gatt_req(req); - - if (status != 0) { - const char *str = att_ecode2str(status); - DBG("Discover all characteristics failed: %s", str); - return; - } - - bt_uuid16_create(&report_uuid, HOG_REPORT_UUID); - bt_uuid16_create(&report_map_uuid, HOG_REPORT_MAP_UUID); - bt_uuid16_create(&info_uuid, HOG_INFO_UUID); - bt_uuid16_create(&proto_mode_uuid, HOG_PROTO_MODE_UUID); - bt_uuid16_create(&ctrlpt_uuid, HOG_CONTROL_POINT_UUID); - - for (l = chars; l; l = g_slist_next(l)) { - struct gatt_char *chr, *next; - bt_uuid_t uuid; - uint16_t start, end; - - chr = l->data; - next = l->next ? l->next->data : NULL; - - DBG("0x%04x UUID: %s properties: %02x", - chr->handle, chr->uuid, chr->properties); - - bt_string_to_uuid(&uuid, chr->uuid); - - start = chr->value_handle + 1; - end = (next ? next->handle - 1 : primary->range.end); - - if (bt_uuid_cmp(&uuid, &report_uuid) == 0) { - report = report_new(hog, chr); - discover_report(hog, hog->attrib, start, end, report); - } else if (bt_uuid_cmp(&uuid, &report_map_uuid) == 0) { - read_char(hog, hog->attrib, chr->value_handle, - report_map_read_cb, hog); - discover_external(hog, hog->attrib, start, end, hog); - } else if (bt_uuid_cmp(&uuid, &info_uuid) == 0) - info_handle = chr->value_handle; - else if (bt_uuid_cmp(&uuid, &proto_mode_uuid) == 0) - proto_mode_handle = chr->value_handle; - else if (bt_uuid_cmp(&uuid, &ctrlpt_uuid) == 0) - hog->ctrlpt_handle = chr->value_handle; - } - - if (proto_mode_handle) { - hog->proto_mode_handle = proto_mode_handle; - read_char(hog, hog->attrib, proto_mode_handle, - proto_mode_read_cb, hog); - } - - if (info_handle) - read_char(hog, hog->attrib, info_handle, info_read_cb, hog); -} - -static void report_free(void *data) -{ - struct report *report = data; - - g_free(report->value); - g_free(report->decl); - g_free(report); -} - -static void cancel_gatt_req(struct gatt_request *req) -{ - if (g_attrib_cancel(req->hog->attrib, req->id)) - destroy_gatt_req(req); -} - -static void hog_free(void *data) -{ - struct bt_hog *hog = data; - - bt_hog_detach(hog); - - queue_destroy(hog->bas, (void *) bt_bas_unref); - g_slist_free_full(hog->instances, hog_free); - - bt_scpp_unref(hog->scpp); - bt_dis_unref(hog->dis); - bt_uhid_unref(hog->uhid); - g_slist_free_full(hog->reports, report_free); - g_free(hog->name); - g_free(hog->primary); - queue_destroy(hog->gatt_op, (void *) destroy_gatt_req); - g_free(hog); -} - -struct bt_hog *bt_hog_new_default(const char *name, uint16_t vendor, - uint16_t product, uint16_t version, - void *primary) -{ - return bt_hog_new(-1, name, vendor, product, version, primary); -} - -struct bt_hog *bt_hog_new(int fd, const char *name, uint16_t vendor, - uint16_t product, uint16_t version, - void *primary) -{ - struct bt_hog *hog; - - hog = g_try_new0(struct bt_hog, 1); - if (!hog) - return NULL; - - hog->gatt_op = queue_new(); - hog->bas = queue_new(); - - if (fd < 0) - hog->uhid = bt_uhid_new_default(); - else - hog->uhid = bt_uhid_new(fd); - - hog->uhid_fd = fd; - - if (!hog->gatt_op || !hog->bas || !hog->uhid) { - hog_free(hog); - return NULL; - } - - hog->name = g_strdup(name); - hog->vendor = vendor; - hog->product = product; - hog->version = version; - - if (primary) - hog->primary = g_memdup(primary, sizeof(*hog->primary)); - - return bt_hog_ref(hog); -} - -struct bt_hog *bt_hog_ref(struct bt_hog *hog) -{ - if (!hog) - return NULL; - - __sync_fetch_and_add(&hog->ref_count, 1); - - return hog; -} - -void bt_hog_unref(struct bt_hog *hog) -{ - if (!hog) - return; - - if (__sync_sub_and_fetch(&hog->ref_count, 1)) - return; - - hog_free(hog); -} - -static void find_included_cb(uint8_t status, GSList *services, void *user_data) -{ - struct gatt_request *req = user_data; - GSList *l; - - DBG(""); - - destroy_gatt_req(req); - - if (status) { - const char *str = att_ecode2str(status); - DBG("Find included failed: %s", str); - return; - } - - for (l = services; l; l = l->next) { - struct gatt_included *include = l->data; - - DBG("included: handle %x, uuid %s", - include->handle, include->uuid); - } -} - -static void hog_attach_scpp(struct bt_hog *hog, struct gatt_primary *primary) -{ - if (hog->scpp) { - bt_scpp_attach(hog->scpp, hog->attrib); - return; - } - - hog->scpp = bt_scpp_new(primary); - if (hog->scpp) - bt_scpp_attach(hog->scpp, hog->attrib); -} - -static void dis_notify(uint8_t source, uint16_t vendor, uint16_t product, - uint16_t version, void *user_data) -{ - struct bt_hog *hog = user_data; - - hog->vendor = vendor; - hog->product = product; - hog->version = version; -} - -static void hog_attach_dis(struct bt_hog *hog, struct gatt_primary *primary) -{ - if (hog->dis) { - bt_dis_attach(hog->dis, hog->attrib); - return; - } - - hog->dis = bt_dis_new(primary); - if (hog->dis) { - bt_dis_set_notification(hog->dis, dis_notify, hog); - bt_dis_attach(hog->dis, hog->attrib); - } -} - -static void hog_attach_bas(struct bt_hog *hog, struct gatt_primary *primary) -{ - struct bt_bas *instance; - - instance = bt_bas_new(primary); - if (!instance) - return; - - bt_bas_attach(instance, hog->attrib); - queue_push_head(hog->bas, instance); -} - -static void hog_attach_hog(struct bt_hog *hog, struct gatt_primary *primary) -{ - struct bt_hog *instance; - - if (!hog->primary) { - hog->primary = g_memdup(primary, sizeof(*primary)); - discover_char(hog, hog->attrib, primary->range.start, - primary->range.end, NULL, - char_discovered_cb, hog); - find_included(hog, hog->attrib, primary->range.start, - primary->range.end, find_included_cb, hog); - return; - } - - instance = bt_hog_new(hog->uhid_fd, hog->name, hog->vendor, - hog->product, hog->version, primary); - if (!instance) - return; - - find_included(instance, hog->attrib, primary->range.start, - primary->range.end, find_included_cb, instance); - - bt_hog_attach(instance, hog->attrib); - hog->instances = g_slist_append(hog->instances, instance); -} - -static void primary_cb(uint8_t status, GSList *services, void *user_data) -{ - struct gatt_request *req = user_data; - struct bt_hog *hog = req->user_data; - struct gatt_primary *primary; - GSList *l; - - DBG(""); - - destroy_gatt_req(req); - - if (status) { - const char *str = att_ecode2str(status); - DBG("Discover primary failed: %s", str); - return; - } - - if (!services) { - DBG("No primary service found"); - return; - } - - for (l = services; l; l = l->next) { - primary = l->data; - - if (strcmp(primary->uuid, SCAN_PARAMETERS_UUID) == 0) { - hog_attach_scpp(hog, primary); - continue; - } - - if (strcmp(primary->uuid, DEVICE_INFORMATION_UUID) == 0) { - hog_attach_dis(hog, primary); - continue; - } - - if (strcmp(primary->uuid, BATTERY_UUID) == 0) { - hog_attach_bas(hog, primary); - continue; - } - - if (strcmp(primary->uuid, HOG_UUID) == 0) - hog_attach_hog(hog, primary); - } -} - -bool bt_hog_attach(struct bt_hog *hog, void *gatt) -{ - struct gatt_primary *primary = hog->primary; - GSList *l; - - if (hog->attrib) - return false; - - hog->attrib = g_attrib_ref(gatt); - - if (!primary) { - discover_primary(hog, hog->attrib, NULL, primary_cb, hog); - return true; - } - - if (hog->scpp) - bt_scpp_attach(hog->scpp, gatt); - - if (hog->dis) - bt_dis_attach(hog->dis, gatt); - - queue_foreach(hog->bas, (void *) bt_bas_attach, gatt); - - for (l = hog->instances; l; l = l->next) { - struct bt_hog *instance = l->data; - - bt_hog_attach(instance, gatt); - } - - if (hog->reports == NULL) { - discover_char(hog, hog->attrib, primary->range.start, - primary->range.end, NULL, - char_discovered_cb, hog); - return true; - } - - for (l = hog->reports; l; l = l->next) { - struct report *r = l->data; - - r->notifyid = g_attrib_register(hog->attrib, - ATT_OP_HANDLE_NOTIFY, - r->decl->value_handle, - report_value_cb, r, NULL); - } - - return true; -} - -void bt_hog_detach(struct bt_hog *hog) -{ - GSList *l; - - if (!hog->attrib) - return; - - queue_foreach(hog->bas, (void *) bt_bas_detach, NULL); - - for (l = hog->instances; l; l = l->next) { - struct bt_hog *instance = l->data; - - bt_hog_detach(instance); - } - - for (l = hog->reports; l; l = l->next) { - struct report *r = l->data; - - if (r->notifyid > 0) { - g_attrib_unregister(hog->attrib, r->notifyid); - r->notifyid = 0; - } - } - - if (hog->scpp) - bt_scpp_detach(hog->scpp); - - if (hog->dis) - bt_dis_detach(hog->dis); - - queue_foreach(hog->gatt_op, (void *) cancel_gatt_req, NULL); - g_attrib_unref(hog->attrib); - hog->attrib = NULL; -} - -int bt_hog_set_control_point(struct bt_hog *hog, bool suspend) -{ - uint8_t value = suspend ? 0x00 : 0x01; - - if (hog->attrib == NULL) - return -ENOTCONN; - - if (hog->ctrlpt_handle == 0) - return -ENOTSUP; - - gatt_write_cmd(hog->attrib, hog->ctrlpt_handle, &value, - sizeof(value), NULL, NULL); - - return 0; -} - -int bt_hog_send_report(struct bt_hog *hog, void *data, size_t size, int type) -{ - struct report *report; - GSList *l; - - if (!hog) - return -EINVAL; - - if (!hog->attrib) - return -ENOTCONN; - - report = find_report(hog, type, 0); - if (!report) - return -ENOTSUP; - - DBG("hog: Write report, handle 0x%X", report->decl->value_handle); - - if (report->decl->properties & GATT_CHR_PROP_WRITE) - write_char(hog, hog->attrib, report->decl->value_handle, - data, size, output_written_cb, hog); - - if (report->decl->properties & GATT_CHR_PROP_WRITE_WITHOUT_RESP) - gatt_write_cmd(hog->attrib, report->decl->value_handle, - data, size, NULL, NULL); - - for (l = hog->instances; l; l = l->next) { - struct bt_hog *instance = l->data; - - bt_hog_send_report(instance, data, size, type); - } - - return 0; -} diff --git a/android/hog.h b/android/hog.h deleted file mode 100755 index 2a9b899..0000000 --- a/android/hog.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2014 Intel Corporation. All rights reserved. - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -struct bt_hog; - -struct bt_hog *bt_hog_new_default(const char *name, uint16_t vendor, - uint16_t product, uint16_t version, - void *primary); - -struct bt_hog *bt_hog_new(int fd, const char *name, uint16_t vendor, - uint16_t product, uint16_t version, - void *primary); - -struct bt_hog *bt_hog_ref(struct bt_hog *hog); -void bt_hog_unref(struct bt_hog *hog); - -bool bt_hog_attach(struct bt_hog *hog, void *gatt); -void bt_hog_detach(struct bt_hog *hog); - -int bt_hog_set_control_point(struct bt_hog *hog, bool suspend); -int bt_hog_send_report(struct bt_hog *hog, void *data, size_t size, int type); diff --git a/android/sco-ipc-api.txt b/android/sco-ipc-api.txt deleted file mode 100755 index 27d5ef2..0000000 --- a/android/sco-ipc-api.txt +++ /dev/null @@ -1,37 +0,0 @@ -Bluetooth SCO Audio Plugin -========================== - -The SCO Audio Plugin communicate through abstract socket name -"\0bluez_sco_socket". - - .----SCO----. .--Android--. - | Plugin | | Daemon | - | | Command | | - | | --------------------------> | | - | | | | - | | <-------------------------- | | - | | Response | | - | | | | - | | | | - | | | | - '-----------' '-----------' - - - SCO HAL Daemon - ---------------------------------------------------- - - call get_fd() --> Get SCO socket fd - return get_fd() <-- Return SCO socket fd and mtu - -SCO Audio Service (ID 0) -======================== - - Opcode 0x00 - Error response - - Response parameters: Status (1 octet) - - Opcode 0x01 - Get SCO fd command - - Command parameters: Remote address (6 octets) - Response parameters: MTU (2 octets) - File descriptor (inline) diff --git a/android/scpp.c b/android/scpp.c deleted file mode 100755 index f8f81f3..0000000 --- a/android/scpp.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Nordic Semiconductor Inc. - * Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include - -#include "src/log.h" - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "src/shared/util.h" -#include "src/shared/queue.h" - -#include "attrib/att.h" -#include "attrib/gattrib.h" -#include "attrib/gatt.h" - -#include "android/scpp.h" - -#define SCAN_INTERVAL_WIN_UUID 0x2A4F -#define SCAN_REFRESH_UUID 0x2A31 - -#define SCAN_INTERVAL 0x0060 -#define SCAN_WINDOW 0x0030 -#define SERVER_REQUIRES_REFRESH 0x00 - -struct bt_scpp { - int ref_count; - GAttrib *attrib; - struct gatt_primary *primary; - uint16_t interval; - uint16_t window; - uint16_t iwhandle; - uint16_t refresh_handle; - guint refresh_cb_id; - struct queue *gatt_op; -}; - -static void discover_char(struct bt_scpp *scpp, GAttrib *attrib, - uint16_t start, uint16_t end, - bt_uuid_t *uuid, gatt_cb_t func, - gpointer user_data) -{ - unsigned int id; - - id = gatt_discover_char(attrib, start, end, uuid, func, user_data); - - if (queue_push_head(scpp->gatt_op, UINT_TO_PTR(id))) - return; - - error("scpp: Could not discover characteristic"); - g_attrib_cancel(attrib, id); -} - -static void discover_desc(struct bt_scpp *scpp, GAttrib *attrib, - uint16_t start, uint16_t end, bt_uuid_t *uuid, - gatt_cb_t func, gpointer user_data) -{ - unsigned int id; - - id = gatt_discover_desc(attrib, start, end, uuid, func, user_data); - - if (queue_push_head(scpp->gatt_op, UINT_TO_PTR(id))) - return; - - error("scpp: Could not discover descriptor"); - g_attrib_cancel(attrib, id); -} - -static void write_char(struct bt_scpp *scan, GAttrib *attrib, uint16_t handle, - const uint8_t *value, size_t vlen, - GAttribResultFunc func, - gpointer user_data) -{ - unsigned int id; - - id = gatt_write_char(attrib, handle, value, vlen, func, user_data); - - if (queue_push_head(scan->gatt_op, UINT_TO_PTR(id))) - return; - - error("scpp: Could not read char"); - g_attrib_cancel(attrib, id); -} - -static void scpp_free(struct bt_scpp *scan) -{ - bt_scpp_detach(scan); - - g_free(scan->primary); - queue_destroy(scan->gatt_op, NULL); /* cleared in bt_scpp_detach */ - g_free(scan); -} - -struct bt_scpp *bt_scpp_new(void *primary) -{ - struct bt_scpp *scan; - - scan = g_try_new0(struct bt_scpp, 1); - if (!scan) - return NULL; - - scan->interval = SCAN_INTERVAL; - scan->window = SCAN_WINDOW; - - scan->gatt_op = queue_new(); - if (!scan->gatt_op) { - scpp_free(scan); - return NULL; - } - - if (primary) - scan->primary = g_memdup(primary, sizeof(*scan->primary)); - - return bt_scpp_ref(scan); -} - -struct bt_scpp *bt_scpp_ref(struct bt_scpp *scan) -{ - if (!scan) - return NULL; - - __sync_fetch_and_add(&scan->ref_count, 1); - - return scan; -} - -void bt_scpp_unref(struct bt_scpp *scan) -{ - if (!scan) - return; - - if (__sync_sub_and_fetch(&scan->ref_count, 1)) - return; - - scpp_free(scan); -} - -static void write_scan_params(GAttrib *attrib, uint16_t handle, - uint16_t interval, uint16_t window) -{ - uint8_t value[4]; - - put_le16(interval, &value[0]); - put_le16(window, &value[2]); - - gatt_write_cmd(attrib, handle, value, sizeof(value), NULL, NULL); -} - -static void refresh_value_cb(const uint8_t *pdu, uint16_t len, - gpointer user_data) -{ - struct bt_scpp *scan = user_data; - - DBG("Server requires refresh: %d", pdu[3]); - - if (pdu[3] == SERVER_REQUIRES_REFRESH) - write_scan_params(scan->attrib, scan->iwhandle, scan->interval, - scan->window); -} - -static void ccc_written_cb(guint8 status, const guint8 *pdu, - guint16 plen, gpointer user_data) -{ - struct bt_scpp *scan = user_data; - - if (status != 0) { - error("Write Scan Refresh CCC failed: %s", - att_ecode2str(status)); - return; - } - - DBG("Scan Refresh: notification enabled"); - - scan->refresh_cb_id = g_attrib_register(scan->attrib, - ATT_OP_HANDLE_NOTIFY, scan->refresh_handle, - refresh_value_cb, scan, NULL); -} - -static void write_ccc(struct bt_scpp *scan, GAttrib *attrib, uint16_t handle, - void *user_data) -{ - uint8_t value[2]; - - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value); - - write_char(scan, attrib, handle, value, sizeof(value), ccc_written_cb, - user_data); -} - -static void discover_descriptor_cb(uint8_t status, GSList *descs, - void *user_data) -{ - struct bt_scpp *scan = user_data; - struct gatt_desc *desc; - - if (status != 0) { - error("Discover descriptors failed: %s", att_ecode2str(status)); - return; - } - - /* There will be only one descriptor on list and it will be CCC */ - desc = descs->data; - - write_ccc(scan, scan->attrib, desc->handle, scan); -} - -static void refresh_discovered_cb(uint8_t status, GSList *chars, - void *user_data) -{ - struct bt_scpp *scan = user_data; - struct gatt_char *chr; - uint16_t start, end; - bt_uuid_t uuid; - - if (status) { - error("Scan Refresh %s", att_ecode2str(status)); - return; - } - - if (!chars) { - DBG("Scan Refresh not supported"); - return; - } - - chr = chars->data; - - DBG("Scan Refresh handle: 0x%04x", chr->value_handle); - - start = chr->value_handle + 1; - end = scan->primary->range.end; - - if (start > end) - return; - - scan->refresh_handle = chr->value_handle; - - bt_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID); - - discover_desc(scan, scan->attrib, start, end, &uuid, - discover_descriptor_cb, user_data); -} - -static void iwin_discovered_cb(uint8_t status, GSList *chars, void *user_data) -{ - struct bt_scpp *scan = user_data; - struct gatt_char *chr; - - if (status) { - error("Discover Scan Interval Window: %s", - att_ecode2str(status)); - return; - } - - chr = chars->data; - scan->iwhandle = chr->value_handle; - - DBG("Scan Interval Window handle: 0x%04x", scan->iwhandle); - - write_scan_params(scan->attrib, scan->iwhandle, scan->interval, - scan->window); -} - -bool bt_scpp_attach(struct bt_scpp *scan, void *attrib) -{ - bt_uuid_t iwin_uuid, refresh_uuid; - - if (!scan || scan->attrib || !scan->primary) - return false; - - scan->attrib = g_attrib_ref(attrib); - - if (scan->iwhandle) - write_scan_params(scan->attrib, scan->iwhandle, scan->interval, - scan->window); - else { - bt_uuid16_create(&iwin_uuid, SCAN_INTERVAL_WIN_UUID); - discover_char(scan, scan->attrib, scan->primary->range.start, - scan->primary->range.end, &iwin_uuid, - iwin_discovered_cb, scan); - } - - if (scan->refresh_handle) - scan->refresh_cb_id = g_attrib_register(scan->attrib, - ATT_OP_HANDLE_NOTIFY, scan->refresh_handle, - refresh_value_cb, scan, NULL); - else { - bt_uuid16_create(&refresh_uuid, SCAN_REFRESH_UUID); - discover_char(scan, scan->attrib, scan->primary->range.start, - scan->primary->range.end, &refresh_uuid, - refresh_discovered_cb, scan); - } - - return true; -} - -static void cancel_gatt_req(void *data, void *user_data) -{ - unsigned int id = PTR_TO_UINT(data); - struct bt_scpp *scan = user_data; - - g_attrib_cancel(scan->attrib, id); -} - -void bt_scpp_detach(struct bt_scpp *scan) -{ - if (!scan || !scan->attrib) - return; - - if (scan->refresh_cb_id > 0) { - g_attrib_unregister(scan->attrib, scan->refresh_cb_id); - scan->refresh_cb_id = 0; - } - - queue_foreach(scan->gatt_op, cancel_gatt_req, scan); - g_attrib_unref(scan->attrib); - scan->attrib = NULL; -} - -bool bt_scpp_set_interval(struct bt_scpp *scan, uint16_t value) -{ - if (!scan) - return false; - - /* TODO: Check valid range */ - - scan->interval = value; - - return true; -} - -bool bt_scpp_set_window(struct bt_scpp *scan, uint16_t value) -{ - if (!scan) - return false; - - /* TODO: Check valid range */ - - scan->window = value; - - return true; -} diff --git a/android/scpp.h b/android/scpp.h deleted file mode 100755 index 048fb9f..0000000 --- a/android/scpp.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2014 Intel Corporation. All rights reserved. - * - * - * This library is free software; you can rescpptribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is scpptributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -struct bt_scpp; - -struct bt_scpp *bt_scpp_new(void *primary); - -struct bt_scpp *bt_scpp_ref(struct bt_scpp *scan); -void bt_scpp_unref(struct bt_scpp *scan); - -bool bt_scpp_attach(struct bt_scpp *scan, void *gatt); -void bt_scpp_detach(struct bt_scpp *scan); - -bool bt_scpp_set_interval(struct bt_scpp *scan, uint16_t value); -bool bt_scpp_set_window(struct bt_scpp *scan, uint16_t value); diff --git a/android/socket-api.txt b/android/socket-api.txt deleted file mode 100755 index 9f622f9..0000000 --- a/android/socket-api.txt +++ /dev/null @@ -1,61 +0,0 @@ -Android Socket protocol for Bluetooth -===================================== - -Since Android switched from BlueZ (where sockets where nicely implemented) to -Bluedroid user space stack there is a need to emulate bluetooth sockets. - -Android Bluetooth Socket Hardware Abstraction Layer (HAL) bt_sock.h has -only 2 functions: - -static btsock_interface_t sock_if = { - sizeof(sock_if), - sock_listen, - sock_connect -}; - -with following parameters: - -sock_listen(btsock_type_t type, const char *service_name, - const uint8_t *uuid, int chan, int *sock_fd, int flags) -sock_connect(const bt_bdaddr_t *bdaddr, btsock_type_t type, - const uint8_t *uuid, int chan, int *sock_fd, int flags) - -socket type RFCOMM is only supported at the moment. uuid and channel used -to decide where to connect. - -sockfd is used to return socket fd to Android framework. It is used to inform -framework when remote device is connected. - -listen() -======== - -Listens on RFCOMM socket, socket channel is either found based on uuid or -channel parameter used directly. Returns sock_fd to Android framework. - -Through this sock_fd channel number as (int) needs to be written right after -listen() succeeds. - -When remote device is connected to this socket we shall send accept signal -through sock_fd - -connect() -========= - -Connects to remote device specified in bd_addr parameter. Socket channel is -found by SDP search of remote device by supplied uuid. Returns sock_fd to -Android framework. - -Through this sock_fd channel number as (int) needs to be written right after -connects() succeeds. - -When remote device is connected to this socket we shall send connect signal -through sock_fd - -The format of connect/accept signal is shown below: - -struct hal_sock_connect_signal { - short size; - uint8_t bdaddr[6]; - int channel; - int status; -} __attribute__((packed)); diff --git a/android/system/audio.h b/android/system/audio.h old mode 100644 new mode 100755 diff --git a/attrib/att-database.h b/attrib/att-database.h old mode 100644 new mode 100755 diff --git a/attrib/att.c b/attrib/att.c old mode 100644 new mode 100755 index fef602c..826b3c1 --- a/attrib/att.c +++ b/attrib/att.c @@ -129,18 +129,11 @@ struct att_data_list *att_data_list_alloc(uint16_t num, uint16_t len) return list; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void get_uuid(uint8_t type, const void *val, bt_uuid_t *uuid) -#else + static void get_uuid(uint8_t type, const void *val, bt_uuid_t *uuid) -#endif { if (type == BT_UUID16) bt_uuid16_create(uuid, get_le16(val)); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (type == BT_UUID32) - bt_uuid32_create(uuid, get_le32(val)); -#endif else { uint128_t u128; @@ -160,10 +153,6 @@ uint16_t enc_read_by_grp_req(uint16_t start, uint16_t end, bt_uuid_t *uuid, if (uuid->type == BT_UUID16) uuid_len = 2; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (uuid->type == BT_UUID32) - uuid_len = 4; -#endif else if (uuid->type == BT_UUID128) uuid_len = 16; else @@ -198,10 +187,6 @@ uint16_t dec_read_by_grp_req(const uint8_t *pdu, size_t len, uint16_t *start, if (len == (min_len + 2)) type = BT_UUID16; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (len == (min_len + 4)) - type = BT_UUID32; -#endif else if (len == (min_len + 16)) type = BT_UUID128; else diff --git a/attrib/att.h b/attrib/att.h old mode 100644 new mode 100755 index c32f9ff..2311aaf --- a/attrib/att.h +++ b/attrib/att.h @@ -106,26 +106,6 @@ struct att_range { uint16_t end; }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void get_uuid(uint8_t type, const void *val, bt_uuid_t *uuid); - -static inline bt_uuid_t att_get_uuid(const void *ptr, uint8_t len) -{ - bt_uuid_t uuid; - if (len == 2) { - //return att_get_uuid16(ptr); - get_uuid(BT_UUID16, ptr, &uuid); - } else if (len == 4) { - //return att_get_uuid32(ptr); - get_uuid(BT_UUID32, ptr, &uuid); - } else { - //return att_get_uuid128(ptr); - get_uuid(BT_UUID128, ptr, &uuid); - } - return uuid; -} -#endif - struct att_data_list *att_data_list_alloc(uint16_t num, uint16_t len); void att_data_list_free(struct att_data_list *list); diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c old mode 100644 new mode 100755 index e434d3b..629d9cf --- a/attrib/gatt-service.c +++ b/attrib/gatt-service.c @@ -81,26 +81,17 @@ static GSList *parse_opts(gatt_option opt1, va_list args) while (opt != GATT_OPT_INVALID) { switch (opt) { case GATT_OPT_CHR_UUID16: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case GATT_OPT_DESC_UUID16: -#endif bt_uuid16_create(&info->uuid, va_arg(args, int)); /* characteristic declaration and value */ info->num_attrs += 2; break; case GATT_OPT_CHR_UUID: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case GATT_OPT_DESC_UUID: -#endif memcpy(&info->uuid, va_arg(args, bt_uuid_t *), sizeof(bt_uuid_t)); /* characteristic declaration and value */ info->num_attrs += 2; break; case GATT_OPT_CHR_PROPS: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case GATT_OPT_DESC_PROPS: -#endif info->props = va_arg(args, int); if (info->props & (GATT_CHR_PROP_NOTIFY | @@ -112,9 +103,6 @@ static GSList *parse_opts(gatt_option opt1, va_list args) * descriptor, but it is not supported yet. */ break; case GATT_OPT_CHR_VALUE_CB: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case GATT_OPT_DESC_VALUE_CB: -#endif cb = g_new0(struct attrib_cb, 1); cb->event = va_arg(args, attrib_event_t); cb->fn = va_arg(args, void *); @@ -142,12 +130,7 @@ static GSList *parse_opts(gatt_option opt1, va_list args) } opt = va_arg(args, gatt_option); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (opt == GATT_OPT_CHR_UUID16 || opt == GATT_OPT_CHR_UUID || - opt == GATT_OPT_DESC_UUID16 || opt == GATT_OPT_DESC_UUID) { -#else if (opt == GATT_OPT_CHR_UUID16 || opt == GATT_OPT_CHR_UUID) { -#endif info = g_new0(struct gatt_info, 1); l = g_slist_append(l, info); } @@ -285,10 +268,6 @@ static gboolean add_characteristic(struct btd_adapter *adapter, if (info->value_handle != NULL) *info->value_handle = a->handle; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY -/* Since old attrib service implementation add descriptor by default - * if notification and indication properties are set, As per new gatt server implemenation - * CCCD are added by the application*/ /* client characteristic configuration descriptor */ if (info->props & (GATT_CHR_PROP_NOTIFY | GATT_CHR_PROP_INDICATE)) { uint8_t cfg_val[2]; @@ -304,7 +283,6 @@ static gboolean add_characteristic(struct btd_adapter *adapter, if (info->ccc_handle != NULL) *info->ccc_handle = a->handle; } -#endif *handle = h; diff --git a/attrib/gatt-service.h b/attrib/gatt-service.h old mode 100644 new mode 100755 index 5a8ac38..728d3a8 --- a/attrib/gatt-service.h +++ b/attrib/gatt-service.h @@ -31,20 +31,8 @@ typedef enum { /* a uint16 value */ GATT_OPT_CHR_UUID16, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* bt_uuid_t* value */ - GATT_OPT_DESC_UUID, - - /* a uint16 value */ - GATT_OPT_DESC_UUID16, -#endif - GATT_OPT_CHR_PROPS, GATT_OPT_CHR_VALUE_CB, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - GATT_OPT_DESC_PROPS, - GATT_OPT_DESC_VALUE_CB, -#endif GATT_OPT_CHR_AUTHENTICATION, GATT_OPT_CHR_AUTHORIZATION, diff --git a/attrib/gatt.c b/attrib/gatt.c old mode 100644 new mode 100755 index 72457ce..480f874 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -185,10 +185,6 @@ static void put_uuid_le(const bt_uuid_t *uuid, void *dst) { if (uuid->type == BT_UUID16) put_le16(uuid->value.u16, dst); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (uuid->type == BT_UUID32) - put_le32(uuid->value.u32, dst); -#endif else /* Convert from 128-bit BE to LE */ bswap_128(&uuid->value.u128, dst); @@ -201,13 +197,6 @@ static void get_uuid128(uint8_t type, const void *val, bt_uuid_t *uuid) bt_uuid16_create(&uuid16, get_le16(val)); bt_uuid_to_uuid128(&uuid16, uuid); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } else if (type == BT_UUID32) { - bt_uuid_t uuid32; - - bt_uuid32_create(&uuid32, get_le32(val)); - bt_uuid_to_uuid128(&uuid32, uuid); -#endif } else { uint128_t u128; @@ -852,45 +841,6 @@ done: long_read->func(status, rpdu, rlen, long_read->user_data); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -guint gatt_read_char_by_offset(GAttrib *attrib, uint16_t handle, uint16_t offset, - GAttribResultFunc func, gpointer user_data) -{ - uint8_t *buf; - size_t buflen; - guint16 plen; - guint id; - struct read_long_data *long_read; - - long_read = g_try_new0(struct read_long_data, 1); - - if (long_read == NULL) - return 0; - - long_read->attrib = g_attrib_ref(attrib); - long_read->func = func; - long_read->user_data = user_data; - long_read->handle = handle; - - buf = g_attrib_get_buffer(attrib, &buflen); - if (offset > 0) - plen = enc_read_blob_req(handle, offset, buf, buflen); - else - plen = enc_read_req(handle, buf, buflen); - - id = g_attrib_send(attrib, 0, buf, plen, read_char_helper, - long_read, read_long_destroy); - if (id == 0) - g_free(long_read); - else { - __sync_fetch_and_add(&long_read->ref, 1); - long_read->id = id; - } - - return id; -} -#endif - guint gatt_read_char(GAttrib *attrib, uint16_t handle, GAttribResultFunc func, gpointer user_data) { diff --git a/attrib/gatt.h b/attrib/gatt.h old mode 100644 new mode 100755 index 0d998c9..63b2940 --- a/attrib/gatt.h +++ b/attrib/gatt.h @@ -120,8 +120,3 @@ guint gatt_exchange_mtu(GAttrib *attrib, uint16_t mtu, GAttribResultFunc func, gboolean gatt_parse_record(const sdp_record_t *rec, uuid_t *prim_uuid, uint16_t *psm, uint16_t *start, uint16_t *end); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -guint gatt_read_char_by_offset(GAttrib *attrib, uint16_t handle, uint16_t offset, - GAttribResultFunc func, gpointer user_data); -#endif diff --git a/attrib/gattrib.c b/attrib/gattrib.c old mode 100644 new mode 100755 diff --git a/attrib/gattrib.h b/attrib/gattrib.h old mode 100644 new mode 100755 diff --git a/attrib/gatttool.c b/attrib/gatttool.c old mode 100644 new mode 100755 diff --git a/attrib/gatttool.h b/attrib/gatttool.h old mode 100644 new mode 100755 diff --git a/attrib/interactive.c b/attrib/interactive.c old mode 100644 new mode 100755 index 62a25fa..7d4786a --- a/attrib/interactive.c +++ b/attrib/interactive.c @@ -559,9 +559,7 @@ static void cmd_char_desc(int argcp, char **argvp) static void cmd_read_hnd(int argcp, char **argvp) { int handle; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - int offset = 0; -#endif + if (conn_state != STATE_CONNECTED) { failed("Disconnected\n"); return; @@ -577,18 +575,8 @@ static void cmd_read_hnd(int argcp, char **argvp) error("Invalid handle: %s\n", argvp[1]); return; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (argcp > 2) { - offset = strtohandle(argvp[2]); - if (offset < 0) { - error("Invalid Offset: %s\n", argvp[2]); - return; - } - } - gatt_read_char_by_offset(attrib, handle, offset, char_read_cb, attrib); -#else + gatt_read_char(attrib, handle, char_read_cb, attrib); -#endif } static void cmd_read_uuid(int argcp, char **argvp) @@ -808,13 +796,8 @@ static struct { "Characteristics Discovery" }, { "char-desc", cmd_char_desc, "[start hnd] [end hnd]", "Characteristics Descriptor Discovery" }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "char-read-hnd", cmd_read_hnd, " [offset]", - "Characteristics Value/Descriptor Read by handle" }, -#else { "char-read-hnd", cmd_read_hnd, "", "Characteristics Value/Descriptor Read by handle" }, -#endif { "char-read-uuid", cmd_read_uuid, " [start hnd] [end hnd]", "Characteristics Value/Descriptor Read by UUID" }, { "char-write-req", cmd_char_write, " ", diff --git a/attrib/utils.c b/attrib/utils.c old mode 100644 new mode 100755 diff --git a/bluez.manifest b/bluez.manifest deleted file mode 100644 index 75b0fa5..0000000 --- a/bluez.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 91756f9..0000000 --- a/bootstrap +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -aclocal && \ - autoheader && \ - libtoolize --automake --copy --force && \ - automake --add-missing --copy && \ - autoconf diff --git a/bootstrap-configure b/bootstrap-configure deleted file mode 100644 index 87766b1..0000000 --- a/bootstrap-configure +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -if [ -f config.status ]; then - make maintainer-clean -fi - -./bootstrap && \ - ./configure --enable-maintainer-mode \ - --enable-debug \ - --prefix=/usr \ - --mandir=/usr/share/man \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --enable-manpages \ - --enable-backtrace \ - --enable-experimental \ - --enable-android \ - --enable-sixaxis \ - --disable-datafiles $* diff --git a/btio/btio.c b/btio/btio.c old mode 100644 new mode 100755 diff --git a/btio/btio.h b/btio/btio.h old mode 100644 new mode 100755 diff --git a/client/advertising.c b/client/advertising.c new file mode 100755 index 0000000..62201d5 --- /dev/null +++ b/client/advertising.c @@ -0,0 +1,452 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2016 Intel Corporation. All rights reserved. + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include "gdbus/gdbus.h" +#include "display.h" +#include "advertising.h" + +#define AD_PATH "/org/bluez/advertising" +#define AD_IFACE "org.bluez.LEAdvertisement1" + +static gboolean registered = FALSE; +static char *ad_type = NULL; +static char **ad_uuids = NULL; +static size_t ad_uuids_len = 0; +static char *ad_service_uuid = NULL; +static uint8_t ad_service_data[25]; +static uint8_t ad_service_data_len = 0; +static uint16_t ad_manufacturer_id; +static uint8_t ad_manufacturer_data[25]; +static uint8_t ad_manufacturer_data_len = 0; +static gboolean ad_tx_power = FALSE; + +static void ad_release(DBusConnection *conn) +{ + registered = FALSE; + + g_dbus_unregister_interface(conn, AD_PATH, AD_IFACE); +} + +static DBusMessage *release_advertising(DBusConnection *conn, + DBusMessage *msg, void *user_data) +{ + rl_printf("Advertising released\n"); + + ad_release(conn); + + return dbus_message_new_method_return(msg); +} + +static const GDBusMethodTable ad_methods[] = { + { GDBUS_METHOD("Release", NULL, NULL, release_advertising) }, + { } +}; + +static void register_setup(DBusMessageIter *iter, void *user_data) +{ + DBusMessageIter dict; + const char *path = AD_PATH; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path); + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); + dbus_message_iter_close_container(iter, &dict); +} + +static void register_reply(DBusMessage *message, void *user_data) +{ + DBusConnection *conn = user_data; + DBusError error; + + dbus_error_init(&error); + + if (dbus_set_error_from_message(&error, message) == FALSE) { + registered = TRUE; + rl_printf("Advertising object registered\n"); + } else { + rl_printf("Failed to register advertisement: %s\n", error.name); + dbus_error_free(&error); + + if (g_dbus_unregister_interface(conn, AD_PATH, + AD_IFACE) == FALSE) + rl_printf("Failed to unregister advertising object\n"); + } +} + +static gboolean get_type(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + const char *type = "peripheral"; + + if (!ad_type || strlen(ad_type) > 0) + type = ad_type; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &type); + + return TRUE; +} + +static gboolean uuids_exists(const GDBusPropertyTable *property, void *data) +{ + return ad_uuids_len != 0; +} + +static gboolean get_uuids(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + DBusMessageIter array; + size_t i; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "as", &array); + + for (i = 0; i < ad_uuids_len; i++) + dbus_message_iter_append_basic(&array, DBUS_TYPE_STRING, + &ad_uuids[i]); + + dbus_message_iter_close_container(iter, &array); + + return TRUE; +} + +static void append_array_variant(DBusMessageIter *iter, int type, void *val, + int n_elements) +{ + DBusMessageIter variant, array; + char type_sig[2] = { type, '\0' }; + char array_sig[3] = { DBUS_TYPE_ARRAY, type, '\0' }; + + dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, + array_sig, &variant); + + dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY, + type_sig, &array); + + if (dbus_type_is_fixed(type) == TRUE) { + dbus_message_iter_append_fixed_array(&array, type, val, + n_elements); + } else if (type == DBUS_TYPE_STRING || type == DBUS_TYPE_OBJECT_PATH) { + const char ***str_array = val; + int i; + + for (i = 0; i < n_elements; i++) + dbus_message_iter_append_basic(&array, type, + &((*str_array)[i])); + } + + dbus_message_iter_close_container(&variant, &array); + + dbus_message_iter_close_container(iter, &variant); +} + +static void dict_append_basic_array(DBusMessageIter *dict, int key_type, + const void *key, int type, void *val, + int n_elements) +{ + DBusMessageIter entry; + + dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, + NULL, &entry); + + dbus_message_iter_append_basic(&entry, key_type, key); + + append_array_variant(&entry, type, val, n_elements); + + dbus_message_iter_close_container(dict, &entry); +} + +static void dict_append_array(DBusMessageIter *dict, const char *key, int type, + void *val, int n_elements) +{ + dict_append_basic_array(dict, DBUS_TYPE_STRING, &key, type, val, + n_elements); +} + +static gboolean service_data_exists(const GDBusPropertyTable *property, + void *data) +{ + return ad_service_uuid != NULL; +} + +static gboolean get_service_data(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + DBusMessageIter dict; + const uint8_t *data = ad_service_data; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "{sv}", &dict); + + dict_append_array(&dict, ad_service_uuid, DBUS_TYPE_BYTE, &data, + ad_service_data_len); + + dbus_message_iter_close_container(iter, &dict); + + return TRUE; +} + +static gboolean manufacturer_data_exists(const GDBusPropertyTable *property, + void *data) +{ + return ad_manufacturer_id != 0; +} + +static gboolean get_manufacturer_data(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + DBusMessageIter dict; + const uint8_t *data = ad_manufacturer_data; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "{qv}", &dict); + + dict_append_basic_array(&dict, DBUS_TYPE_UINT16, &ad_manufacturer_id, + DBUS_TYPE_BYTE, &data, + ad_manufacturer_data_len); + + dbus_message_iter_close_container(iter, &dict); + + return TRUE; +} + +static gboolean tx_power_exists(const GDBusPropertyTable *property, void *data) +{ + return ad_tx_power; +} + +static gboolean get_tx_power(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &ad_tx_power); + + return TRUE; +} + +static const GDBusPropertyTable ad_props[] = { + { "Type", "s", get_type }, + { "ServiceUUIDs", "as", get_uuids, NULL, uuids_exists }, + { "ServiceData", "a{sv}", get_service_data, NULL, service_data_exists }, + { "ManufacturerData", "a{qv}", get_manufacturer_data, NULL, + manufacturer_data_exists }, + { "IncludeTxPower", "b", get_tx_power, NULL, tx_power_exists }, + { } +}; + +void ad_register(DBusConnection *conn, GDBusProxy *manager, const char *type) +{ + if (registered == TRUE) { + rl_printf("Advertisement is already registered\n"); + return; + } + + ad_type = g_strdup(type); + + if (g_dbus_register_interface(conn, AD_PATH, AD_IFACE, ad_methods, + NULL, ad_props, NULL, NULL) == FALSE) { + rl_printf("Failed to register advertising object\n"); + return; + } + + if (g_dbus_proxy_method_call(manager, "RegisterAdvertisement", + register_setup, register_reply, + conn, NULL) == FALSE) { + rl_printf("Failed to register advertising\n"); + return; + } +} + +static void unregister_setup(DBusMessageIter *iter, void *user_data) +{ + const char *path = AD_PATH; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path); +} + +static void unregister_reply(DBusMessage *message, void *user_data) +{ + DBusConnection *conn = user_data; + DBusError error; + + dbus_error_init(&error); + + if (dbus_set_error_from_message(&error, message) == FALSE) { + registered = FALSE; + rl_printf("Advertising object unregistered\n"); + if (g_dbus_unregister_interface(conn, AD_PATH, + AD_IFACE) == FALSE) + rl_printf("Failed to unregister advertising object\n"); + } else { + rl_printf("Failed to unregister advertisement: %s\n", + error.name); + dbus_error_free(&error); + } +} + +void ad_unregister(DBusConnection *conn, GDBusProxy *manager) +{ + if (!manager) + ad_release(conn); + + if (g_dbus_proxy_method_call(manager, "UnregisterAdvertisement", + unregister_setup, unregister_reply, + conn, NULL) == FALSE) { + rl_printf("Failed to unregister advertisement method\n"); + return; + } +} + +void ad_advertise_uuids(const char *arg) +{ + g_strfreev(ad_uuids); + ad_uuids = NULL; + ad_uuids_len = 0; + + if (!arg || !strlen(arg)) + return; + + ad_uuids = g_strsplit(arg, " ", -1); + if (!ad_uuids) { + rl_printf("Failed to parse input\n"); + return; + } + + ad_uuids_len = g_strv_length(ad_uuids); +} + +static void ad_clear_service(void) +{ + g_free(ad_service_uuid); + ad_service_uuid = NULL; + memset(ad_service_data, 0, sizeof(ad_service_data)); + ad_service_data_len = 0; +} + +void ad_advertise_service(const char *arg) +{ + wordexp_t w; + unsigned int i; + + if (wordexp(arg, &w, WRDE_NOCMD)) { + rl_printf("Invalid argument\n"); + return; + } + + ad_clear_service(); + + if (w.we_wordc == 0) + goto done; + + ad_service_uuid = g_strdup(w.we_wordv[0]); + + for (i = 1; i < w.we_wordc; i++) { + long int val; + char *endptr = NULL; + + if (i >= G_N_ELEMENTS(ad_service_data)) { + rl_printf("Too much data\n"); + goto done; + } + + val = strtol(w.we_wordv[i], &endptr, 0); + if (!endptr || *endptr != '\0' || val > UINT8_MAX) { + rl_printf("Invalid value at index %d\n", i); + ad_clear_service(); + goto done; + } + + ad_service_data[ad_service_data_len] = val; + ad_service_data_len++; + } + +done: + wordfree(&w); +} + +static void ad_clear_manufacturer(void) +{ + ad_manufacturer_id = 0; + memset(ad_manufacturer_data, 0, sizeof(ad_manufacturer_data)); + ad_manufacturer_data_len = 0; +} + +void ad_advertise_manufacturer(const char *arg) +{ + wordexp_t w; + unsigned int i; + char *endptr = NULL; + long int val; + + if (wordexp(arg, &w, WRDE_NOCMD)) { + rl_printf("Invalid argument\n"); + return; + } + + ad_clear_manufacturer(); + + if (w.we_wordc == 0) + goto done; + + val = strtol(w.we_wordv[0], &endptr, 0); + if (!endptr || *endptr != '\0' || val > UINT16_MAX) { + rl_printf("Invalid manufacture id\n"); + goto done; + } + + ad_manufacturer_id = val; + + for (i = 1; i < w.we_wordc; i++) { + if (i >= G_N_ELEMENTS(ad_service_data)) { + rl_printf("Too much data\n"); + goto done; + } + + val = strtol(w.we_wordv[i], &endptr, 0); + if (!endptr || *endptr != '\0' || val > UINT8_MAX) { + rl_printf("Invalid value at index %d\n", i); + ad_clear_service(); + goto done; + } + + ad_manufacturer_data[ad_manufacturer_data_len] = val; + ad_manufacturer_data_len++; + } + +done: + wordfree(&w); +} + + +void ad_advertise_tx_power(gboolean value) +{ + ad_tx_power = value; +} diff --git a/profiles/proximity/manager.h b/client/advertising.h old mode 100644 new mode 100755 similarity index 67% rename from profiles/proximity/manager.h rename to client/advertising.h index e65c31d..8638465 --- a/profiles/proximity/manager.h +++ b/client/advertising.h @@ -2,8 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann + * Copyright (C) 2016 Intel Corporation. All rights reserved. * * * This program is free software; you can redistribute it and/or modify @@ -22,5 +21,10 @@ * */ -int proximity_manager_init(GKeyFile *conf); -void proximity_manager_exit(void); +void ad_register(DBusConnection *conn, GDBusProxy *manager, const char *type); +void ad_unregister(DBusConnection *conn, GDBusProxy *manager); + +void ad_advertise_uuids(const char *arg); +void ad_advertise_service(const char *arg); +void ad_advertise_manufacturer(const char *arg); +void ad_advertise_tx_power(gboolean value); diff --git a/client/agent.c b/client/agent.c old mode 100644 new mode 100755 diff --git a/client/agent.h b/client/agent.h old mode 100644 new mode 100755 diff --git a/client/display.c b/client/display.c old mode 100644 new mode 100755 diff --git a/client/display.h b/client/display.h old mode 100644 new mode 100755 diff --git a/client/gatt.c b/client/gatt.c old mode 100644 new mode 100755 index 7dd3c94..37f222d --- a/client/gatt.c +++ b/client/gatt.c @@ -73,15 +73,21 @@ static void print_service(GDBusProxy *proxy, const char *description) text = uuidstr_to_str(uuid); if (!text) - text = uuid; - - rl_printf("%s%s%s%s Service\n\t%s\n\t%s\n", - description ? "[" : "", - description ? : "", - description ? "] " : "", - primary ? "Primary" : "Secondary", - g_dbus_proxy_get_path(proxy), - text); + rl_printf("%s%s%s%s Service\n\t%s\n\t%s\n", + description ? "[" : "", + description ? : "", + description ? "] " : "", + primary ? "Primary" : "Secondary", + g_dbus_proxy_get_path(proxy), + uuid); + else + rl_printf("%s%s%s%s Service\n\t%s\n\t%s\n\t%s\n", + description ? "[" : "", + description ? : "", + description ? "] " : "", + primary ? "Primary" : "Secondary", + g_dbus_proxy_get_path(proxy), + uuid, text); } void gatt_add_service(GDBusProxy *proxy) @@ -116,14 +122,19 @@ static void print_characteristic(GDBusProxy *proxy, const char *description) text = uuidstr_to_str(uuid); if (!text) - text = uuid; - - rl_printf("%s%s%sCharacteristic\n\t%s\n\t%s\n", - description ? "[" : "", - description ? : "", - description ? "] " : "", - g_dbus_proxy_get_path(proxy), - text); + rl_printf("%s%s%sCharacteristic\n\t%s\n\t%s\n", + description ? "[" : "", + description ? : "", + description ? "] " : "", + g_dbus_proxy_get_path(proxy), + uuid); + else + rl_printf("%s%s%sCharacteristic\n\t%s\n\t%s\n\t%s\n", + description ? "[" : "", + description ? : "", + description ? "] " : "", + g_dbus_proxy_get_path(proxy), + uuid, text); } static gboolean characteristic_is_child(GDBusProxy *characteristic) @@ -184,14 +195,19 @@ static void print_descriptor(GDBusProxy *proxy, const char *description) text = uuidstr_to_str(uuid); if (!text) - text = uuid; - - rl_printf("%s%s%sDescriptor\n\t%s\n\t%s\n", - description ? "[" : "", - description ? : "", - description ? "] " : "", - g_dbus_proxy_get_path(proxy), - text); + rl_printf("%s%s%sDescriptor\n\t%s\n\t%s\n", + description ? "[" : "", + description ? : "", + description ? "] " : "", + g_dbus_proxy_get_path(proxy), + uuid); + else + rl_printf("%s%s%sDescriptor\n\t%s\n\t%s\n\t%s\n", + description ? "[" : "", + description ? : "", + description ? "] " : "", + g_dbus_proxy_get_path(proxy), + uuid, text); } static gboolean descriptor_is_child(GDBusProxy *characteristic) @@ -379,9 +395,23 @@ static void read_reply(DBusMessage *message, void *user_data) rl_hexdump(value, len); } +static void read_setup(DBusMessageIter *iter, void *user_data) +{ + DBusMessageIter dict; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, + &dict); + /* TODO: Add offset support */ + dbus_message_iter_close_container(iter, &dict); +} + static void read_attribute(GDBusProxy *proxy) { - if (g_dbus_proxy_method_call(proxy, "ReadValue", NULL, read_reply, + if (g_dbus_proxy_method_call(proxy, "ReadValue", read_setup, read_reply, NULL, NULL) == FALSE) { rl_printf("Failed to read\n"); return; @@ -421,12 +451,21 @@ static void write_reply(DBusMessage *message, void *user_data) static void write_setup(DBusMessageIter *iter, void *user_data) { struct iovec *iov = user_data; - DBusMessageIter array; + DBusMessageIter array, dict; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "y", &array); dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, &iov->iov_base, iov->iov_len); dbus_message_iter_close_container(iter, &array); + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, + &dict); + /* TODO: Add offset support */ + dbus_message_iter_close_container(iter, &dict); } static void write_attribute(GDBusProxy *proxy, char *arg) diff --git a/client/gatt.h b/client/gatt.h old mode 100644 new mode 100755 diff --git a/client/main.c b/client/main.c old mode 100644 new mode 100755 index a39fba7..e1198a8 --- a/client/main.c +++ b/client/main.c @@ -38,11 +38,13 @@ #include #include +#include "src/shared/util.h" #include "gdbus/gdbus.h" #include "monitor/uuid.h" #include "agent.h" #include "display.h" #include "gatt.h" +#include "advertising.h" /* String display constants */ #define COLORED_NEW COLOR_GREEN "NEW" COLOR_OFF @@ -50,7 +52,7 @@ #define COLORED_DEL COLOR_RED "DEL" COLOR_OFF #define PROMPT_ON COLOR_BLUE "[bluetooth]" COLOR_OFF "# " -#define PROMPT_OFF "[bluetooth]# " +#define PROMPT_OFF "Waiting to connect to bluetoothd..." static GMainLoop *main_loop; static DBusConnection *dbus_conn; @@ -58,11 +60,16 @@ static DBusConnection *dbus_conn; static GDBusProxy *agent_manager; static char *auto_register_agent = NULL; -static GDBusProxy *default_ctrl; +struct adapter { + GDBusProxy *proxy; + GList *devices; +}; + +static struct adapter *default_ctrl; static GDBusProxy *default_dev; static GDBusProxy *default_attr; +static GDBusProxy *ad_manager; static GList *ctrl_list; -static GList *dev_list; static guint input = 0; @@ -77,11 +84,51 @@ static const char * const agent_arguments[] = { NULL }; +static const char * const ad_arguments[] = { + "on", + "off", + "peripheral", + "broadcast", + NULL +}; + static void proxy_leak(gpointer data) { printf("Leaking proxy %p\n", data); } +static gboolean input_handler(GIOChannel *channel, GIOCondition condition, + gpointer user_data) +{ + if (condition & G_IO_IN) { + rl_callback_read_char(); + return TRUE; + } + + if (condition & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) { + g_main_loop_quit(main_loop); + return FALSE; + } + + return TRUE; +} + +static guint setup_standard_input(void) +{ + GIOChannel *channel; + guint source; + + channel = g_io_channel_unix_new(fileno(stdin)); + + source = g_io_add_watch(channel, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + input_handler, NULL); + + g_io_channel_unref(channel); + + return source; +} + static void connect_handler(DBusConnection *connection, void *user_data) { rl_set_prompt(PROMPT_ON); @@ -92,18 +139,20 @@ static void connect_handler(DBusConnection *connection, void *user_data) static void disconnect_handler(DBusConnection *connection, void *user_data) { + if (input > 0) { + g_source_remove(input); + input = 0; + } + rl_set_prompt(PROMPT_OFF); printf("\r"); rl_on_new_line(); rl_redisplay(); - g_list_free(ctrl_list); + g_list_free_full(ctrl_list, proxy_leak); ctrl_list = NULL; default_ctrl = NULL; - - g_list_free(dev_list); - dev_list = NULL; } static void print_adapter(GDBusProxy *proxy, const char *description) @@ -126,7 +175,9 @@ static void print_adapter(GDBusProxy *proxy, const char *description) description ? : "", description ? "] " : "", address, name, - default_ctrl == proxy ? "[default]" : ""); + default_ctrl && + default_ctrl->proxy == proxy ? + "[default]" : ""); } @@ -309,8 +360,11 @@ static gboolean service_is_child(GDBusProxy *service) dbus_message_iter_get_basic(&iter, &device); - for (l = dev_list; l; l = g_list_next(l)) { - GDBusProxy *proxy = l->data; + if (!default_ctrl) + return FALSE; + + for (l = default_ctrl->devices; l; l = g_list_next(l)) { + struct GDBusProxy *proxy = l->data; path = g_dbus_proxy_get_path(proxy); @@ -321,43 +375,17 @@ static gboolean service_is_child(GDBusProxy *service) return FALSE; } -static void proxy_added(GDBusProxy *proxy, void *user_data) +static struct adapter *find_parent(GDBusProxy *device) { - const char *interface; - - interface = g_dbus_proxy_get_interface(proxy); - - if (!strcmp(interface, "org.bluez.Device1")) { - if (device_is_child(proxy, default_ctrl) == TRUE) { - dev_list = g_list_append(dev_list, proxy); - - print_device(proxy, COLORED_NEW); - } - } else if (!strcmp(interface, "org.bluez.Adapter1")) { - ctrl_list = g_list_append(ctrl_list, proxy); - - if (!default_ctrl) - default_ctrl = proxy; + GList *list; - print_adapter(proxy, COLORED_NEW); - } else if (!strcmp(interface, "org.bluez.AgentManager1")) { - if (!agent_manager) { - agent_manager = proxy; + for (list = g_list_first(ctrl_list); list; list = g_list_next(list)) { + struct adapter *adapter = list->data; - if (auto_register_agent) - agent_register(dbus_conn, agent_manager, - auto_register_agent); - } - } else if (!strcmp(interface, "org.bluez.GattService1")) { - if (service_is_child(proxy)) - gatt_add_service(proxy); - } else if (!strcmp(interface, "org.bluez.GattCharacteristic1")) { - gatt_add_characteristic(proxy); - } else if (!strcmp(interface, "org.bluez.GattDescriptor1")) { - gatt_add_descriptor(proxy); - } else if (!strcmp(interface, "org.bluez.GattManager1")) { - gatt_add_manager(proxy); + if (device_is_child(device, adapter->proxy) == TRUE) + return adapter; } + return NULL; } static void set_default_device(GDBusProxy *proxy, const char *attribute) @@ -389,10 +417,80 @@ done: rl_set_prompt(desc ? desc : PROMPT_ON); printf("\r"); rl_on_new_line(); - rl_redisplay(); g_free(desc); } +static void device_added(GDBusProxy *proxy) +{ + DBusMessageIter iter; + struct adapter *adapter = find_parent(proxy); + + if (!adapter) { + /* TODO: Error */ + return; + } + + adapter->devices = g_list_append(adapter->devices, proxy); + print_device(proxy, COLORED_NEW); + + if (default_dev) + return; + + if (g_dbus_proxy_get_property(proxy, "Connected", &iter)) { + dbus_bool_t connected; + + dbus_message_iter_get_basic(&iter, &connected); + + if (connected) + set_default_device(proxy, NULL); + } +} + +static void adapter_added(GDBusProxy *proxy) +{ + struct adapter *adapter = g_malloc0(sizeof(struct adapter)); + + adapter->proxy = proxy; + ctrl_list = g_list_append(ctrl_list, adapter); + + if (!default_ctrl) + default_ctrl = adapter; + + print_adapter(proxy, COLORED_NEW); +} + +static void proxy_added(GDBusProxy *proxy, void *user_data) +{ + const char *interface; + + interface = g_dbus_proxy_get_interface(proxy); + + if (!strcmp(interface, "org.bluez.Device1")) { + device_added(proxy); + } else if (!strcmp(interface, "org.bluez.Adapter1")) { + adapter_added(proxy); + } else if (!strcmp(interface, "org.bluez.AgentManager1")) { + if (!agent_manager) { + agent_manager = proxy; + + if (auto_register_agent) + agent_register(dbus_conn, agent_manager, + auto_register_agent); + } + } else if (!strcmp(interface, "org.bluez.GattService1")) { + if (service_is_child(proxy)) + gatt_add_service(proxy); + } else if (!strcmp(interface, "org.bluez.GattCharacteristic1")) { + gatt_add_characteristic(proxy); + } else if (!strcmp(interface, "org.bluez.GattDescriptor1")) { + gatt_add_descriptor(proxy); + } else if (!strcmp(interface, "org.bluez.GattManager1")) { + gatt_add_manager(proxy); + } else if (!strcmp(interface, "org.bluez.LEAdvertisingManager1")) { + ad_manager = proxy; + } +} + static void set_default_attribute(GDBusProxy *proxy) { const char *path; @@ -404,33 +502,56 @@ static void set_default_attribute(GDBusProxy *proxy) set_default_device(default_dev, path); } -static void proxy_removed(GDBusProxy *proxy, void *user_data) +static void device_removed(GDBusProxy *proxy) { - const char *interface; + struct adapter *adapter = find_parent(proxy); + if (!adapter) { + /* TODO: Error */ + return; + } - interface = g_dbus_proxy_get_interface(proxy); + adapter->devices = g_list_remove(adapter->devices, proxy); - if (!strcmp(interface, "org.bluez.Device1")) { - if (device_is_child(proxy, default_ctrl) == TRUE) { - dev_list = g_list_remove(dev_list, proxy); + print_device(proxy, COLORED_DEL); + + if (default_dev == proxy) + set_default_device(NULL, NULL); +} + +static void adapter_removed(GDBusProxy *proxy) +{ + GList *ll; - print_device(proxy, COLORED_DEL); + for (ll = g_list_first(ctrl_list); ll; ll = g_list_next(ll)) { + struct adapter *adapter = ll->data; - if (default_dev == proxy) + if (adapter->proxy == proxy) { + print_adapter(proxy, COLORED_DEL); + + if (default_ctrl && default_ctrl->proxy == proxy) { + default_ctrl = NULL; set_default_device(NULL, NULL); + } + + ctrl_list = g_list_remove_link(ctrl_list, ll); + g_list_free(adapter->devices); + g_free(adapter); + g_list_free(ll); + return; } - } else if (!strcmp(interface, "org.bluez.Adapter1")) { - ctrl_list = g_list_remove(ctrl_list, proxy); + } +} - print_adapter(proxy, COLORED_DEL); +static void proxy_removed(GDBusProxy *proxy, void *user_data) +{ + const char *interface; - if (default_ctrl == proxy) { - default_ctrl = NULL; - set_default_device(NULL, NULL); + interface = g_dbus_proxy_get_interface(proxy); - g_list_free(dev_list); - dev_list = NULL; - } + if (!strcmp(interface, "org.bluez.Device1")) { + device_removed(proxy); + } else if (!strcmp(interface, "org.bluez.Adapter1")) { + adapter_removed(proxy); } else if (!strcmp(interface, "org.bluez.AgentManager1")) { if (agent_manager == proxy) { agent_manager = NULL; @@ -454,6 +575,11 @@ static void proxy_removed(GDBusProxy *proxy, void *user_data) set_default_attribute(NULL); } else if (!strcmp(interface, "org.bluez.GattManager1")) { gatt_remove_manager(proxy); + } else if (!strcmp(interface, "org.bluez.LEAdvertisingManager1")) { + if (ad_manager == proxy) { + agent_manager = NULL; + ad_unregister(dbus_conn, NULL); + } } } @@ -465,7 +591,8 @@ static void property_changed(GDBusProxy *proxy, const char *name, interface = g_dbus_proxy_get_interface(proxy); if (!strcmp(interface, "org.bluez.Device1")) { - if (device_is_child(proxy, default_ctrl) == TRUE) { + if (default_ctrl && device_is_child(proxy, + default_ctrl->proxy) == TRUE) { DBusMessageIter addr_iter; char *str; @@ -528,6 +655,28 @@ static void message_handler(DBusConnection *connection, dbus_message_get_member(message)); } +static struct adapter *find_ctrl_by_address(GList *source, const char *address) +{ + GList *list; + + for (list = g_list_first(source); list; list = g_list_next(list)) { + struct adapter *adapter = list->data; + DBusMessageIter iter; + const char *str; + + if (g_dbus_proxy_get_property(adapter->proxy, + "Address", &iter) == FALSE) + continue; + + dbus_message_iter_get_basic(&iter, &str); + + if (!strcmp(str, address)) + return adapter; + } + + return NULL; +} + static GDBusProxy *find_proxy_by_address(GList *source, const char *address) { GList *list; @@ -618,13 +767,14 @@ static void cmd_list(const char *arg) GList *list; for (list = g_list_first(ctrl_list); list; list = g_list_next(list)) { - GDBusProxy *proxy = list->data; - print_adapter(proxy, NULL); + struct adapter *adapter = list->data; + print_adapter(adapter->proxy, NULL); } } static void cmd_show(const char *arg) { + struct adapter *adapter; GDBusProxy *proxy; DBusMessageIter iter; const char *address; @@ -633,13 +783,14 @@ static void cmd_show(const char *arg) if (check_default_ctrl() == FALSE) return; - proxy = default_ctrl; + proxy = default_ctrl->proxy; } else { - proxy = find_proxy_by_address(ctrl_list, arg); - if (!proxy) { + adapter = find_ctrl_by_address(ctrl_list, arg); + if (!adapter) { rl_printf("Controller %s not available\n", arg); return; } + proxy = adapter->proxy; } if (g_dbus_proxy_get_property(proxy, "Address", &iter) == FALSE) @@ -657,52 +808,54 @@ static void cmd_show(const char *arg) print_uuids(proxy); print_property(proxy, "Modalias"); print_property(proxy, "Discovering"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - print_property(proxy, "Advertising"); -#endif } static void cmd_select(const char *arg) { - GDBusProxy *proxy; + struct adapter *adapter; if (!arg || !strlen(arg)) { rl_printf("Missing controller address argument\n"); return; } - proxy = find_proxy_by_address(ctrl_list, arg); - if (!proxy) { + adapter = find_ctrl_by_address(ctrl_list, arg); + if (!adapter) { rl_printf("Controller %s not available\n", arg); return; } - if (default_ctrl == proxy) + if (default_ctrl && default_ctrl->proxy == adapter->proxy) return; - default_ctrl = proxy; - print_adapter(proxy, NULL); - - g_list_free(dev_list); - dev_list = NULL; + default_ctrl = adapter; + print_adapter(adapter->proxy, NULL); } static void cmd_devices(const char *arg) { - GList *list; + GList *ll; - for (list = g_list_first(dev_list); list; list = g_list_next(list)) { - GDBusProxy *proxy = list->data; + if (check_default_ctrl() == FALSE) + return; + + for (ll = g_list_first(default_ctrl->devices); + ll; ll = g_list_next(ll)) { + GDBusProxy *proxy = ll->data; print_device(proxy, NULL); } } static void cmd_paired_devices(const char *arg) { - GList *list; + GList *ll; - for (list = g_list_first(dev_list); list; list = g_list_next(list)) { - GDBusProxy *proxy = list->data; + if (check_default_ctrl() == FALSE) + return; + + for (ll = g_list_first(default_ctrl->devices); + ll; ll = g_list_next(ll)) { + GDBusProxy *proxy = ll->data; DBusMessageIter iter; dbus_bool_t paired; @@ -741,7 +894,7 @@ static void cmd_system_alias(const char *arg) name = g_strdup(arg); - if (g_dbus_proxy_set_property_basic(default_ctrl, "Alias", + if (g_dbus_proxy_set_property_basic(default_ctrl->proxy, "Alias", DBUS_TYPE_STRING, &name, generic_callback, name, g_free) == TRUE) return; @@ -758,7 +911,7 @@ static void cmd_reset_alias(const char *arg) name = g_strdup(""); - if (g_dbus_proxy_set_property_basic(default_ctrl, "Alias", + if (g_dbus_proxy_set_property_basic(default_ctrl->proxy, "Alias", DBUS_TYPE_STRING, &name, generic_callback, name, g_free) == TRUE) return; @@ -779,7 +932,7 @@ static void cmd_power(const char *arg) str = g_strdup_printf("power %s", powered == TRUE ? "on" : "off"); - if (g_dbus_proxy_set_property_basic(default_ctrl, "Powered", + if (g_dbus_proxy_set_property_basic(default_ctrl->proxy, "Powered", DBUS_TYPE_BOOLEAN, &powered, generic_callback, str, g_free) == TRUE) return; @@ -800,7 +953,7 @@ static void cmd_pairable(const char *arg) str = g_strdup_printf("pairable %s", pairable == TRUE ? "on" : "off"); - if (g_dbus_proxy_set_property_basic(default_ctrl, "Pairable", + if (g_dbus_proxy_set_property_basic(default_ctrl->proxy, "Pairable", DBUS_TYPE_BOOLEAN, &pairable, generic_callback, str, g_free) == TRUE) return; @@ -822,7 +975,7 @@ static void cmd_discoverable(const char *arg) str = g_strdup_printf("discoverable %s", discoverable == TRUE ? "on" : "off"); - if (g_dbus_proxy_set_property_basic(default_ctrl, "Discoverable", + if (g_dbus_proxy_set_property_basic(default_ctrl->proxy, "Discoverable", DBUS_TYPE_BOOLEAN, &discoverable, generic_callback, str, g_free) == TRUE) return; @@ -896,7 +1049,7 @@ static void cmd_scan(const char *arg) else method = "StopDiscovery"; - if (g_dbus_proxy_method_call(default_ctrl, method, + if (g_dbus_proxy_method_call(default_ctrl->proxy, method, NULL, start_discovery_reply, GUINT_TO_POINTER(enable), NULL) == FALSE) { rl_printf("Failed to %s discovery\n", @@ -917,6 +1070,36 @@ static void append_variant(DBusMessageIter *iter, int type, void *val) dbus_message_iter_close_container(iter, &value); } +static void append_array_variant(DBusMessageIter *iter, int type, void *val, + int n_elements) +{ + DBusMessageIter variant, array; + char type_sig[2] = { type, '\0' }; + char array_sig[3] = { DBUS_TYPE_ARRAY, type, '\0' }; + + dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, + array_sig, &variant); + + dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY, + type_sig, &array); + + if (dbus_type_is_fixed(type) == TRUE) { + dbus_message_iter_append_fixed_array(&array, type, val, + n_elements); + } else if (type == DBUS_TYPE_STRING || type == DBUS_TYPE_OBJECT_PATH) { + const char ***str_array = val; + int i; + + for (i = 0; i < n_elements; i++) + dbus_message_iter_append_basic(&array, type, + &((*str_array)[i])); + } + + dbus_message_iter_close_container(&variant, &array); + + dbus_message_iter_close_container(iter, &variant); +} + static void dict_append_entry(DBusMessageIter *dict, const char *key, int type, void *val) { @@ -939,76 +1122,69 @@ static void dict_append_entry(DBusMessageIter *dict, const char *key, dbus_message_iter_close_container(dict, &entry); } +static void dict_append_basic_array(DBusMessageIter *dict, int key_type, + const void *key, int type, void *val, + int n_elements) +{ + DBusMessageIter entry; + + dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, + NULL, &entry); + + dbus_message_iter_append_basic(&entry, key_type, key); + + append_array_variant(&entry, type, val, n_elements); + + dbus_message_iter_close_container(dict, &entry); +} + +static void dict_append_array(DBusMessageIter *dict, const char *key, int type, + void *val, int n_elements) +{ + dict_append_basic_array(dict, DBUS_TYPE_STRING, &key, type, val, + n_elements); +} + #define DISTANCE_VAL_INVALID 0x7FFF struct set_discovery_filter_args { char *transport; dbus_uint16_t rssi; dbus_int16_t pathloss; - GSList *uuids; + char **uuids; + size_t uuids_len; }; -static void set_discovery_filter_setup(DBusMessageIter *iter, - void *user_data) +static void set_discovery_filter_setup(DBusMessageIter *iter, void *user_data) { struct set_discovery_filter_args *args = user_data; DBusMessageIter dict; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING - DBUS_TYPE_VARIANT_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - if (args->uuids != NULL) { - DBusMessageIter entry, value, arrayIter; - char *uuids = "UUIDs"; - GSList *l; - - dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, - NULL, &entry); - /* dict key */ - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, - &uuids); + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - dbus_message_iter_open_container(&entry, DBUS_TYPE_VARIANT, - "as", &value); - - dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY, "s", - &arrayIter); - - for (l = args->uuids; l != NULL; l = g_slist_next(l)) - /* list->data contains string representation of uuid */ - dbus_message_iter_append_basic(&arrayIter, - DBUS_TYPE_STRING, - &l->data); - - dbus_message_iter_close_container(&value, &arrayIter); - - /* close vararg*/ - dbus_message_iter_close_container(&entry, &value); - - /* close entry */ - dbus_message_iter_close_container(&dict, &entry); - } + dict_append_array(&dict, "UUIDs", DBUS_TYPE_STRING, &args->uuids, + args->uuids_len); if (args->pathloss != DISTANCE_VAL_INVALID) dict_append_entry(&dict, "Pathloss", DBUS_TYPE_UINT16, - &args->pathloss); + &args->pathloss); if (args->rssi != DISTANCE_VAL_INVALID) dict_append_entry(&dict, "RSSI", DBUS_TYPE_INT16, &args->rssi); if (args->transport != NULL) dict_append_entry(&dict, "Transport", DBUS_TYPE_STRING, - &args->transport); + &args->transport); dbus_message_iter_close_container(iter, &dict); } -static void set_discovery_filter_reply(DBusMessage *message, - void *user_data) +static void set_discovery_filter_reply(DBusMessage *message, void *user_data) { DBusError error; @@ -1024,7 +1200,8 @@ static void set_discovery_filter_reply(DBusMessage *message, static gint filtered_scan_rssi = DISTANCE_VAL_INVALID; static gint filtered_scan_pathloss = DISTANCE_VAL_INVALID; -static GSList *filtered_scan_uuids; +static char **filtered_scan_uuids; +static size_t filtered_scan_uuids_len; static char *filtered_scan_transport; static void cmd_set_scan_filter_commit(void) @@ -1036,11 +1213,12 @@ static void cmd_set_scan_filter_commit(void) args.rssi = filtered_scan_rssi; args.transport = filtered_scan_transport; args.uuids = filtered_scan_uuids; + args.uuids_len = filtered_scan_uuids_len; if (check_default_ctrl() == FALSE) return; - if (g_dbus_proxy_method_call(default_ctrl, "SetDiscoveryFilter", + if (g_dbus_proxy_method_call(default_ctrl->proxy, "SetDiscoveryFilter", set_discovery_filter_setup, set_discovery_filter_reply, &args, NULL) == FALSE) { rl_printf("Failed to set discovery filter\n"); @@ -1050,25 +1228,22 @@ static void cmd_set_scan_filter_commit(void) static void cmd_set_scan_filter_uuids(const char *arg) { - char *uuid_str, *saveptr, *uuids, *uuidstmp; - - g_slist_free_full(filtered_scan_uuids, g_free); + g_strfreev(filtered_scan_uuids); filtered_scan_uuids = NULL; + filtered_scan_uuids_len = 0; if (!arg || !strlen(arg)) - return; + goto commit; - uuids = g_strdup(arg); - for (uuidstmp = uuids; ; uuidstmp = NULL) { - uuid_str = strtok_r(uuidstmp, " \t", &saveptr); - if (uuid_str == NULL) - break; - filtered_scan_uuids = g_slist_append(filtered_scan_uuids, - strdup(uuid_str)); + filtered_scan_uuids = g_strsplit(arg, " ", -1); + if (!filtered_scan_uuids) { + rl_printf("Failed to parse input\n"); + return; } - g_free(uuids); + filtered_scan_uuids_len = g_strv_length(filtered_scan_uuids); +commit: cmd_set_scan_filter_commit(); } @@ -1108,17 +1283,38 @@ static void cmd_set_scan_filter_transport(const char *arg) cmd_set_scan_filter_commit(); } +static void clear_discovery_filter_setup(DBusMessageIter *iter, void *user_data) +{ + DBusMessageIter dict; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); + + dbus_message_iter_close_container(iter, &dict); +} + static void cmd_set_scan_filter_clear(const char *arg) { /* set default values for all options */ filtered_scan_rssi = DISTANCE_VAL_INVALID; filtered_scan_pathloss = DISTANCE_VAL_INVALID; - g_slist_free_full(filtered_scan_uuids, g_free); + g_strfreev(filtered_scan_uuids); filtered_scan_uuids = NULL; + filtered_scan_uuids_len = 0; g_free(filtered_scan_transport); filtered_scan_transport = NULL; - cmd_set_scan_filter_commit(); + if (check_default_ctrl() == FALSE) + return; + + if (g_dbus_proxy_method_call(default_ctrl->proxy, "SetDiscoveryFilter", + clear_discovery_filter_setup, set_discovery_filter_reply, + NULL, NULL) == FALSE) { + rl_printf("Failed to clear discovery filter\n"); + } } static struct GDBusProxy *find_device(const char *arg) @@ -1132,7 +1328,10 @@ static struct GDBusProxy *find_device(const char *arg) return NULL; } - proxy = find_proxy_by_address(dev_list, arg); + if (check_default_ctrl() == FALSE) + return NULL; + + proxy = find_proxy_by_address(default_ctrl->devices, arg); if (!proxy) { rl_printf("Device %s not available\n", arg); return NULL; @@ -1169,9 +1368,6 @@ static void cmd_info(const char *arg) print_property(proxy, "LegacyPairing"); print_uuids(proxy); print_property(proxy, "Modalias"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - print_property(proxy, "ManufacturerDataLen"); -#endif print_property(proxy, "ManufacturerData"); print_property(proxy, "ServiceData"); print_property(proxy, "RSSI"); @@ -1320,10 +1516,27 @@ static void remove_device_setup(DBusMessageIter *iter, void *user_data) dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path); } +static void remove_device(GDBusProxy *proxy) +{ + char *path; + + path = g_strdup(g_dbus_proxy_get_path(proxy)); + + if (!default_ctrl) + return; + + if (g_dbus_proxy_method_call(default_ctrl->proxy, "RemoveDevice", + remove_device_setup, + remove_device_reply, + path, g_free) == FALSE) { + rl_printf("Failed to remove device\n"); + g_free(path); + } +} + static void cmd_remove(const char *arg) { GDBusProxy *proxy; - char *path; if (!arg || !strlen(arg)) { rl_printf("Missing device address argument\n"); @@ -1333,22 +1546,25 @@ static void cmd_remove(const char *arg) if (check_default_ctrl() == FALSE) return; - proxy = find_proxy_by_address(dev_list, arg); - if (!proxy) { - rl_printf("Device %s not available\n", arg); + if (strcmp(arg, "*") == 0) { + GList *list; + + for (list = default_ctrl->devices; list; + list = g_list_next(list)) { + GDBusProxy *proxy = list->data; + + remove_device(proxy); + } return; } - path = g_strdup(g_dbus_proxy_get_path(proxy)); - - if (g_dbus_proxy_method_call(default_ctrl, "RemoveDevice", - remove_device_setup, - remove_device_reply, - path, g_free) == FALSE) { - rl_printf("Failed to remove device\n"); - g_free(path); + proxy = find_proxy_by_address(default_ctrl->devices, arg); + if (!proxy) { + rl_printf("Device %s not available\n", arg); return; } + + remove_device(proxy); } static void connect_reply(DBusMessage *message, void *user_data) @@ -1378,7 +1594,10 @@ static void cmd_connect(const char *arg) return; } - proxy = find_proxy_by_address(dev_list, arg); + if (check_default_ctrl() == FALSE) + return; + + proxy = find_proxy_by_address(default_ctrl->devices, arg); if (!proxy) { rl_printf("Device %s not available\n", arg); return; @@ -1447,6 +1666,30 @@ static void cmd_list_attributes(const char *arg) gatt_list_attributes(g_dbus_proxy_get_path(proxy)); } +static void cmd_set_alias(const char *arg) +{ + char *name; + + if (!arg || !strlen(arg)) { + rl_printf("Missing name argument\n"); + return; + } + + if (!default_dev) { + rl_printf("No device connected\n"); + return; + } + + name = g_strdup(arg); + + if (g_dbus_proxy_set_property_basic(default_dev, "Alias", + DBUS_TYPE_STRING, &name, + generic_callback, name, g_free) == TRUE) + return; + + g_free(name); +} + static void cmd_select_attribute(const char *arg) { GDBusProxy *proxy; @@ -1588,7 +1831,7 @@ static void cmd_register_profile(const char *arg) return; } - gatt_register_profile(dbus_conn, default_ctrl, &w); + gatt_register_profile(dbus_conn, default_ctrl->proxy, &w); wordfree(&w); } @@ -1598,7 +1841,7 @@ static void cmd_unregister_profile(const char *arg) if (check_default_ctrl() == FALSE) return; - gatt_unregister_profile(dbus_conn, default_ctrl); + gatt_unregister_profile(dbus_conn, default_ctrl->proxy); } static void cmd_version(const char *arg) @@ -1644,12 +1887,40 @@ static char *generic_generator(const char *text, int state, static char *ctrl_generator(const char *text, int state) { - return generic_generator(text, state, ctrl_list, "Address"); + static int index = 0; + static int len = 0; + GList *list; + + if (!state) { + index = 0; + len = strlen(text); + } + + for (list = g_list_nth(ctrl_list, index); list; + list = g_list_next(list)) { + struct adapter *adapter = list->data; + DBusMessageIter iter; + const char *str; + + index++; + + if (g_dbus_proxy_get_property(adapter->proxy, + "Address", &iter) == FALSE) + continue; + + dbus_message_iter_get_basic(&iter, &str); + + if (!strncmp(str, text, len)) + return strdup(str); + } + + return NULL; } static char *dev_generator(const char *text, int state) { - return generic_generator(text, state, dev_list, "Address"); + return generic_generator(text, state, + default_ctrl ? default_ctrl->devices : NULL, "Address"); } static char *attribute_generator(const char *text, int state) @@ -1677,6 +1948,113 @@ static char *capability_generator(const char *text, int state) return NULL; } +static gboolean parse_argument_advertise(const char *arg, dbus_bool_t *value, + const char **type) +{ + const char * const *opt; + + if (arg == NULL || strlen(arg) == 0) { + rl_printf("Missing on/off/type argument\n"); + return FALSE; + } + + if (strcmp(arg, "on") == 0 || strcmp(arg, "yes") == 0) { + *value = TRUE; + *type = ""; + return TRUE; + } + + if (strcmp(arg, "off") == 0 || strcmp(arg, "no") == 0) { + *value = FALSE; + return TRUE; + } + + for (opt = ad_arguments; *opt; opt++) { + if (strcmp(arg, *opt) == 0) { + *value = TRUE; + *type = *opt; + return TRUE; + } + } + + rl_printf("Invalid argument %s\n", arg); + return FALSE; +} + +static void cmd_advertise(const char *arg) +{ + dbus_bool_t enable; + const char *type; + + if (parse_argument_advertise(arg, &enable, &type) == FALSE) + return; + + if (!ad_manager) { + rl_printf("LEAdvertisingManager not found\n"); + return; + } + + if (enable == TRUE) + ad_register(dbus_conn, ad_manager, type); + else + ad_unregister(dbus_conn, ad_manager); +} + +static char *ad_generator(const char *text, int state) +{ + static int index, len; + const char *arg; + + if (!state) { + index = 0; + len = strlen(text); + } + + while ((arg = ad_arguments[index])) { + index++; + + if (!strncmp(arg, text, len)) + return strdup(arg); + } + + return NULL; +} + +static void cmd_set_advertise_uuids(const char *arg) +{ + ad_advertise_uuids(arg); +} + +static void cmd_set_advertise_service(const char *arg) +{ + ad_advertise_service(arg); +} + +static void cmd_set_advertise_manufacturer(const char *arg) +{ + ad_advertise_manufacturer(arg); +} + +static void cmd_set_advertise_tx_power(const char *arg) +{ + if (arg == NULL || strlen(arg) == 0) { + rl_printf("Missing on/off argument\n"); + return; + } + + if (strcmp(arg, "on") == 0 || strcmp(arg, "yes") == 0) { + ad_advertise_tx_power(TRUE); + return; + } + + if (strcmp(arg, "off") == 0 || strcmp(arg, "no") == 0) { + ad_advertise_tx_power(FALSE); + return; + } + + rl_printf("Invalid argument\n"); +} + static const struct { const char *cmd; const char *arg; @@ -1705,6 +2083,20 @@ static const struct { capability_generator}, { "default-agent",NULL, cmd_default_agent, "Set agent as the default one" }, + { "advertise", "", cmd_advertise, + "Enable/disable advertising with given type", + ad_generator}, + { "set-advertise-uuids", "[uuid1 uuid2 ...]", + cmd_set_advertise_uuids, "Set advertise uuids" }, + { "set-advertise-service", "[uuid][data=[xx xx ...]", + cmd_set_advertise_service, + "Set advertise service data" }, + { "set-advertise-manufacturer", "[id][data=[xx xx ...]", + cmd_set_advertise_manufacturer, + "Set advertise manufacturer data" }, + { "set-advertise-tx-power", "", + cmd_set_advertise_tx_power, + "Enable/disable TX power to be advertised" }, { "set-scan-filter-uuids", "[uuid1 uuid2 ...]", cmd_set_scan_filter_uuids, "Set scan filter uuids" }, { "set-scan-filter-rssi", "[rssi]", cmd_set_scan_filter_rssi, @@ -1737,6 +2129,7 @@ static const struct { dev_generator }, { "list-attributes", "[dev]", cmd_list_attributes, "List attributes", dev_generator }, + { "set-alias", "", cmd_set_alias, "Set device alias" }, { "select-attribute", "", cmd_select_attribute, "Select attribute", attribute_generator }, { "attribute-info", "[attribute]", cmd_attribute_info, @@ -1871,38 +2264,6 @@ done: free(input); } -static gboolean input_handler(GIOChannel *channel, GIOCondition condition, - gpointer user_data) -{ - if (condition & G_IO_IN) { - rl_callback_read_char(); - return TRUE; - } - - if (condition & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) { - g_main_loop_quit(main_loop); - return FALSE; - } - - return TRUE; -} - -static guint setup_standard_input(void) -{ - GIOChannel *channel; - guint source; - - channel = g_io_channel_unix_new(fileno(stdin)); - - source = g_io_add_watch(channel, - G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, - input_handler, NULL); - - g_io_channel_unref(channel); - - return source; -} - static gboolean signal_handler(GIOChannel *channel, GIOCondition condition, gpointer user_data) { @@ -2013,9 +2374,8 @@ static GOptionEntry options[] = { static void client_ready(GDBusClient *client, void *user_data) { - guint *input = user_data; - - *input = setup_standard_input(); + if (!input) + input = setup_standard_input(); } int main(int argc, char *argv[]) @@ -2047,6 +2407,7 @@ int main(int argc, char *argv[]) main_loop = g_main_loop_new(NULL, FALSE); dbus_conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL); + setlinebuf(stdout); rl_attempted_completion_function = cmd_completion; rl_erase_empty_line = 1; @@ -2065,8 +2426,7 @@ int main(int argc, char *argv[]) g_dbus_client_set_proxy_handlers(client, proxy_added, proxy_removed, property_changed, NULL); - input = 0; - g_dbus_client_set_ready_watch(client, client_ready, &input); + g_dbus_client_set_ready_watch(client, client_ready, NULL); g_main_loop_run(main_loop); @@ -2082,7 +2442,6 @@ int main(int argc, char *argv[]) g_main_loop_unref(main_loop); g_list_free_full(ctrl_list, proxy_leak); - g_list_free_full(dev_list, proxy_leak); g_free(auto_register_agent); diff --git a/compile b/compile new file mode 100755 index 0000000..531136b --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..1f5c50c --- /dev/null +++ b/config.guess @@ -0,0 +1,1420 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2014 Free Software Foundation, Inc. + +timestamp='2014-03-23' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2014 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100755 index 0000000..a567af6 --- /dev/null +++ b/config.h.in @@ -0,0 +1,138 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Directory for the Android daemon storage files */ +#undef ANDROID_STORAGEDIR + +/* Directory for the configuration files */ +#undef CONFIGDIR + +/* Define to 1 if you have the backtrace support. */ +#undef HAVE_BACKTRACE_SUPPORT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_ALG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_READLINE_READLINE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the udev_hwdb_new() function. */ +#undef HAVE_UDEV_HWDB_NEW + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_VALGRIND_MEMCHECK_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Define if threading support is required */ +#undef NEED_THREADS + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Directory for the storage files */ +#undef STORAGEDIR + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#undef restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +# define _Restrict +# define __restrict__ +#endif diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..bba4efb --- /dev/null +++ b/config.sub @@ -0,0 +1,1799 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2014 Free Software Foundation, Inc. + +timestamp='2014-09-11' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2014 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 | or1k | or1knd | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | riscv32 | riscv64 \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | k1om-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | or1k*-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..29654e4 --- /dev/null +++ b/configure @@ -0,0 +1,16576 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for bluez 5.43. +# +# +# Copyright (C) 1992-1996, 1998-2012 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. +as_myself= +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 + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # 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. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +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 +test -x / || 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 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || 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 : + export CONFIG_SHELL + # 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. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +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_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_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; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # 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 -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +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 + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# 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'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +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='bluez' +PACKAGE_TARNAME='bluez' +PACKAGE_VERSION='5.43' +PACKAGE_STRING='bluez 5.43' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +# 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_default_prefix=/usr/local +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +SPEEXDSP_LIBS +SPEEXDSP_CFLAGS +SBC_LIBS +SBC_CFLAGS +ANDROID_FALSE +ANDROID_TRUE +CONFIGDIR +SIXAXIS_FALSE +SIXAXIS_TRUE +DEPRECATED_FALSE +DEPRECATED_TRUE +EXPERIMENTAL_FALSE +EXPERIMENTAL_TRUE +MANPAGES_FALSE +MANPAGES_TRUE +DATAFILES_FALSE +DATAFILES_TRUE +SYSTEMD_USERUNITDIR +SYSTEMD_SYSTEMUNITDIR +SYSTEMD_FALSE +SYSTEMD_TRUE +READLINE_FALSE +READLINE_TRUE +CLIENT_FALSE +CLIENT_TRUE +OBEX_FALSE +OBEX_TRUE +ICAL_LIBS +ICAL_CFLAGS +CUPS_FALSE +CUPS_TRUE +HID2HCI_FALSE +HID2HCI_TRUE +UDEV_DIR +UDEV_FALSE +UDEV_TRUE +UDEV_LIBS +UDEV_CFLAGS +MONITOR_FALSE +MONITOR_TRUE +TOOLS_FALSE +TOOLS_TRUE +TEST_FALSE +TEST_TRUE +LIBRARY_FALSE +LIBRARY_TRUE +BACKTRACE_LIBS +BACKTRACE_CFLAGS +DBUS_SESSIONBUSDIR +DBUS_SYSTEMBUSDIR +DBUS_CONFDIR +DBUS_LIBS +DBUS_CFLAGS +GTHREAD_LIBS +GTHREAD_CFLAGS +GLIB_LIBS +GLIB_CFLAGS +MISC_LDFLAGS +MISC_CFLAGS +VALGRIND_FALSE +VALGRIND_TRUE +DBUS_RUN_SESSION_FALSE +DBUS_RUN_SESSION_TRUE +COVERAGE_FALSE +COVERAGE_TRUE +enable_valgrind +enable_dbus_run_session +enable_coverage +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +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 +WARNING_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +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_silent_rules +enable_dependency_tracking +enable_maintainer_mode +enable_static +enable_shared +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_optimization +enable_debug +enable_pie +enable_threads +with_dbusconfdir +with_dbussystembusdir +with_dbussessionbusdir +enable_backtrace +enable_library +enable_test +enable_tools +enable_monitor +enable_udev +with_udevdir +enable_cups +enable_obex +enable_client +enable_systemd +with_systemdsystemunitdir +with_systemduserunitdir +enable_datafiles +enable_manpages +enable_experimental +enable_deprecated +enable_sixaxis +enable_android +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +GLIB_CFLAGS +GLIB_LIBS +GTHREAD_CFLAGS +GTHREAD_LIBS +DBUS_CFLAGS +DBUS_LIBS +UDEV_CFLAGS +UDEV_LIBS +ICAL_CFLAGS +ICAL_LIBS +SBC_CFLAGS +SBC_LIBS +SPEEXDSP_CFLAGS +SPEEXDSP_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 + 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 bluez 5.43 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/bluez] + --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 bluez 5.43:";; + 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] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-static[=PKGS] build static libraries [default=no] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-optimization disable code optimization through compiler + --enable-debug enable compiling with debugging information + --enable-pie enable position independent executables flag + --enable-threads enable threading support + --enable-backtrace compile backtrace support + --enable-library install Bluetooth library + --enable-test enable test/example scripts + --disable-tools disable Bluetooth tools + --disable-monitor disable Bluetooth monitor + --disable-udev disable udev device support + --disable-cups disable CUPS printer support + --disable-obex disable OBEX profile support + --disable-client disable command line client + --disable-systemd disable systemd integration + --disable-datafiles do not install configuration and data files + --enable-manpages enable building of manual pages + --enable-experimental enable experimental plugins (SAP, NFC, ...) + --enable-deprecated enable deprecated plugins (BLE services, ...) + --enable-sixaxis enable sixaxis plugin + --enable-android enable BlueZ for Android + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-dbusconfdir=DIR path to D-Bus configuration directory + --with-dbussystembusdir=DIR + path to D-Bus system bus services directory + --with-dbussessionbusdir=DIR + path to D-Bus session bus services directory + --with-udevdir=DIR path to udev directory + --with-systemdsystemunitdir=DIR + path to systemd system unit directory + --with-systemduserunitdir=DIR + path to systemd user unit directory + +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 + GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config + GLIB_LIBS linker flags for GLIB, overriding pkg-config + GTHREAD_CFLAGS + C compiler flags for GTHREAD, overriding pkg-config + GTHREAD_LIBS + linker flags for GTHREAD, overriding pkg-config + DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config + DBUS_LIBS linker flags for DBUS, overriding pkg-config + UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config + UDEV_LIBS linker flags for UDEV, overriding pkg-config + ICAL_CFLAGS C compiler flags for ICAL, overriding pkg-config + ICAL_LIBS linker flags for ICAL, overriding pkg-config + SBC_CFLAGS C compiler flags for SBC, overriding pkg-config + SBC_LIBS linker flags for SBC, overriding pkg-config + SPEEXDSP_CFLAGS + C compiler flags for SPEEXDSP, overriding pkg-config + SPEEXDSP_LIBS + linker flags for SPEEXDSP, 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 +bluez configure 5.43 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 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; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_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; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# 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 \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; 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 \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# 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; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# 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 \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# 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 || + 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; ${as_lineno_stack:+:} 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 \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +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 bluez $as_me 5.43, which was +generated by GNU Autoconf 2.69. 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 + +# 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.14' + +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 ${ac_cv_path_install+:} false; 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 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + 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; } +# 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 ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + 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 + 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 + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + 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; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +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 --is-lightweight"; then + am_missing_run="$MISSING " +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 ${ac_cv_prog_STRIP+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_STRIP+:} false; 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 as_fn_executable_p "$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 ${ac_cv_path_mkdir+:} false; 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 + as_fn_executable_p "$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; } + +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 ${ac_cv_prog_AWK+:} false; 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 as_fn_executable_p "$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 \${ac_cv_prog_make_${ac_make}_set+:} false; 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 + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +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='bluez' + VERSION='5.43' + + +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"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 +$as_echo_n "checking how to create a pax tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_pax-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=posix -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=posix -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x pax -w "$$tardir"' + am__tar_='pax -L -x pax -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H pax -L' + am__tar_='find "$tardir" -print | cpio -o -H pax -L' + am__untar='cpio -i -H pax -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_pax}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if ${am_cv_prog_tar_pax+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_prog_tar_pax=$_am_tool +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5 +$as_echo "$am_cv_prog_tar_pax" >&6; } + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +ac_config_headers="$ac_config_headers config.h" + +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='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +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 +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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_objext+:} false; 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 ${ac_cv_c_compiler_gnu+:} false; 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 ${ac_cv_prog_cc_g+:} false; 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 ${ac_cv_prog_cc_c89+:} false; 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 +struct stat; +/* 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 + +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 whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$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 ${am_cv_CC_dependencies_compiler_type+:} false; 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". + rm -rf conftest.dir + 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 10 /bin/sh. + echo '/* dummy */' > 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 + ;; + msvc7 | msvc7msys | 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 + + + +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 ${ac_cv_prog_CPP+:} false; 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 ${ac_cv_path_GREP+:} false; 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" + as_fn_executable_p "$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 ${ac_cv_path_EGREP+:} false; 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" + as_fn_executable_p "$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 ${ac_cv_header_stdc+:} false; 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 + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + + + + + + + + + +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 ${ac_cv_path_PKG_CONFIG+:} false; 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 as_fn_executable_p "$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 ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; 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 as_fn_executable_p "$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 + + + with_cflags="" + if (test "$USE_MAINTAINER_MODE" = "yes"); then + with_cflags="$with_cflags -Wall -Werror -Wextra" + with_cflags="$with_cflags -Wno-unused-parameter" + with_cflags="$with_cflags -Wno-missing-field-initializers" + with_cflags="$with_cflags -Wdeclaration-after-statement" + with_cflags="$with_cflags -Wmissing-declarations" + with_cflags="$with_cflags -Wredundant-decls" + with_cflags="$with_cflags -Wcast-align" + with_cflags="$with_cflags -Wswitch-enum" + with_cflags="$with_cflags -Wformat -Wformat-security" + with_cflags="$with_cflags -DG_DISABLE_DEPRECATED" + with_cflags="$with_cflags -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_28" + with_cflags="$with_cflags -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_28" + fi + WARNING_CFLAGS=$with_cflags + + + +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 C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } +int +main () +{ +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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 + +{ $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 ${ac_cv_c_compiler_gnu+:} false; 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 ${ac_cv_prog_cc_g+:} false; 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 ${ac_cv_prog_cc_c89+:} false; 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 +struct stat; +/* 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 + +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 whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$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 ${am_cv_CC_dependencies_compiler_type+:} false; 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". + rm -rf conftest.dir + 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 10 /bin/sh. + echo '/* dummy */' > 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 + ;; + msvc7 | msvc7msys | 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 whether ${CC-cc} accepts -fPIE" >&5 +$as_echo_n "checking whether ${CC-cc} accepts -fPIE... " >&6; } +if ${ac_cv_prog_cc_pie+:} false; then : + $as_echo_n "(cached) " >&6 +else + + echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then + ac_cv_prog_cc_pie=yes + else + ac_cv_prog_cc_pie=no + fi + rm -rf conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_pie" >&5 +$as_echo "$ac_cv_prog_cc_pie" >&6; } + + + + + + + +# 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=no +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.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +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 ${ac_cv_build+:} false; 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 ${ac_cv_host+:} false; 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 + + +# Backslashify 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' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +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 ${ac_cv_path_SED+:} false; 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" + as_fn_executable_p "$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 ${ac_cv_path_FGREP+:} false; 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" + as_fn_executable_p "$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 ${lt_cv_path_LD+:} false; 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 ${lt_cv_prog_gnu_ld+:} false; 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 ${lt_cv_path_NM+:} false; 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 "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + 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 ${ac_cv_prog_DUMPBIN+:} false; 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 as_fn_executable_p "$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 "link -dump" +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 ${ac_cv_prog_ac_ct_DUMPBIN+:} false; 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 as_fn_executable_p "$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 + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + 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 ${lt_cv_nm_interface+:} false; 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:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: 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 ${lt_cv_sys_max_cmd_len+:} false; 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + 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 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + 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" && \ + test undefined != "$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"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$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%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && 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 how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $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 ${lt_cv_ld_reload_flag+:} false; 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 + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + 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 ${ac_cv_prog_OBJDUMP+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_OBJDUMP+:} false; 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 as_fn_executable_p "$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 ${lt_cv_deplibs_check_method+:} false; 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. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && 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 + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + 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 + ;; + +haiku*) + 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])(-bit)?( [LM]SB)? 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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | 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_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +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}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $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 +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="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 + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + 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 ${ac_cv_prog_AR+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$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 +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 + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +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 ${ac_cv_prog_ac_ct_AR+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$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_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 + + + test -n "$ac_ct_AR" && break +done + + 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 +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_STRIP+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_RANLIB+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_RANLIB+:} false; 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 as_fn_executable_p "$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 \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 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 ${lt_cv_sys_global_symbol_pipe+:} false; 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};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /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 + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # 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 +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#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. */ +LT_DLSYM_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_globsym_save_LIBS=$LIBS + lt_globsym_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_globsym_save_LIBS + CFLAGS=$lt_globsym_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 + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# 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 '$LINENO' "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*|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*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + 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" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + 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 ${lt_cv_cc_needs_belf+:} false; 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 + ;; +*-*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*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + 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" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $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 +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + 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 + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + 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 ${ac_cv_prog_DSYMUTIL+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_NMEDIT+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_NMEDIT+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_LIPO+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_LIPO+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_OTOOL+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_OTOOL+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_OTOOL64+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_OTOOL64+:} false; 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 as_fn_executable_p "$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 ${lt_cv_apple_cc_single_mod+:} false; 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 there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 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 ${lt_cv_ld_exported_symbols_list+:} false; 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; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&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" != ":" && test "$lt_cv_ld_force_load" = "no"; 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" = xyes; 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 --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +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 ${lt_cv_objdir+:} false; 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 + +# 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 "$cc_temp" | $SED "s%.*/%%; 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 ${lt_cv_path_MAGIC_CMD+:} false; 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 ${lt_cv_path_MAGIC_CMD+:} false; 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 + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $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 ${lt_cv_prog_compiler_rtti_exceptions+:} false; 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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= + + + 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' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + 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 + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + 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 | 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' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # 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* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # 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='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + 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* | sunf77* | sunf90* | sunf95*) + 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}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# 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 ${lt_cv_prog_compiler_pic_works+:} false; 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 ${lt_cv_prog_compiler_static_works+:} false; 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 "$_lt_linker_boilerplate" | $SED '/^$/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 ${lt_cv_prog_compiler_c_o+:} false; 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 ${lt_cv_prog_compiler_c_o+:} false; 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_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 | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = 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.19, 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 install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_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' + export_dynamic_flag_spec='${wl}--export-all-symbols' + 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + 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 + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + 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=' $pic_flag' + 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # 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; func_echo_all \"$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]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + 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; func_echo_all \"$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* | bgf* | bgxlf* | mpixlf*) + # 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='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_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 $linker_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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + 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") || (\$ 2 == "W")) && (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. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 + } + }' + lt_cv_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 "$lt_cv_aix_libpath_"; then + lt_cv_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 "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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 func_echo_all "${wl}${allow_undefined_flag}"; 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. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 + } + }' + lt_cv_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 "$lt_cv_aix_libpath_"; then + lt_cv_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 "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + 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. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + 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 `func_echo_all "$deplibs" | $SED '\''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' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + 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=func_echo_all + 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 + ;; + + # 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 $pic_flag -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 $pic_flag ${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 && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${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_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 && test "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${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' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${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 + + ;; + 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=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_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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" && func_echo_all "-set_version $verstring"` -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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; 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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + 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 $pic_flag ${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 $pic_flag ${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; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $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 + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + 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 + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # 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 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # 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; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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=`func_echo_all "$lib" | $SED '\''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 # correct to gnu/linux during the next big refactor + 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,$cc_basename in + yes,*) + # gcc + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + 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 + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + 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 + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # 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' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # 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 # correct to gnu/linux during the next big refactor + 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 + ;; + +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[23].*) 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 + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + 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=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + 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' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + 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 + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + 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 : + lt_cv_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 + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # 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;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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 # correct to gnu/linux during the next big refactor + 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 ${ac_cv_lib_dl_dlopen+:} false; 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" = xyes; 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" = xyes; 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 ${ac_cv_lib_dld_shl_load+:} false; 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" = xyes; 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" = xyes; 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 ${ac_cv_lib_dl_dlopen+:} false; 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" = xyes; 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 ${ac_cv_lib_svld_dlopen+:} false; 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" = xyes; 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 ${ac_cv_lib_dld_dld_link+:} false; 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" = xyes; 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 ${lt_cv_dlopen_self+:} false; 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 $LINENO "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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* 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 ${lt_cv_dlopen_self_static+:} false; 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 $LINENO "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 + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 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; + else puts (dlerror ()); + } + /* 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: + + + +if (test "$USE_MAINTAINER_MODE" = "yes"); then + # Extract the first word of "lcov", so it can be a program name with args. +set dummy lcov; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_enable_coverage+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$enable_coverage"; then + ac_cv_prog_enable_coverage="$enable_coverage" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_enable_coverage="yes" + $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 + + test -z "$ac_cv_prog_enable_coverage" && ac_cv_prog_enable_coverage="no" +fi +fi +enable_coverage=$ac_cv_prog_enable_coverage +if test -n "$enable_coverage"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_coverage" >&5 +$as_echo "$enable_coverage" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "dbus-run-session", so it can be a program name with args. +set dummy dbus-run-session; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_enable_dbus_run_session+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$enable_dbus_run_session"; then + ac_cv_prog_enable_dbus_run_session="$enable_dbus_run_session" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_enable_dbus_run_session="yes" + $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 +enable_dbus_run_session=$ac_cv_prog_enable_dbus_run_session +if test -n "$enable_dbus_run_session"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dbus_run_session" >&5 +$as_echo "$enable_dbus_run_session" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + # Extract the first word of "valgrind", so it can be a program name with args. +set dummy valgrind; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_enable_valgrind+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$enable_valgrind"; then + ac_cv_prog_enable_valgrind="$enable_valgrind" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_enable_valgrind="yes" + $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 +enable_valgrind=$ac_cv_prog_enable_valgrind +if test -n "$enable_valgrind"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_valgrind" >&5 +$as_echo "$enable_valgrind" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + for ac_header in valgrind/memcheck.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "valgrind/memcheck.h" "ac_cv_header_valgrind_memcheck_h" "$ac_includes_default" +if test "x$ac_cv_header_valgrind_memcheck_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_VALGRIND_MEMCHECK_H 1 +_ACEOF + +fi + +done + +fi + if test "${enable_coverage}" = "yes"; then + COVERAGE_TRUE= + COVERAGE_FALSE='#' +else + COVERAGE_TRUE='#' + COVERAGE_FALSE= +fi + + if test "${enable_dbus_run_session}" = "yes"; then + DBUS_RUN_SESSION_TRUE= + DBUS_RUN_SESSION_FALSE='#' +else + DBUS_RUN_SESSION_TRUE='#' + DBUS_RUN_SESSION_FALSE= +fi + + if test "${enable_valgrind}" = "yes"; then + VALGRIND_TRUE= + VALGRIND_FALSE='#' +else + VALGRIND_TRUE='#' + VALGRIND_FALSE= +fi + + + + misc_cflags="" + misc_ldflags="" + # Check whether --enable-optimization was given. +if test "${enable_optimization+set}" = set; then : + enableval=$enable_optimization; + if (test "${enableval}" = "no"); then + misc_cflags="$misc_cflags -O0" + fi + +fi + + # Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_g}" = "yes"); then + misc_cflags="$misc_cflags -g" + fi + +fi + + # Check whether --enable-pie was given. +if test "${enable_pie+set}" = set; then : + enableval=$enable_pie; + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_pie}" = "yes"); then + misc_cflags="$misc_cflags -fPIC" + misc_ldflags="$misc_ldflags -pie" + fi + +fi + + if (test "$enable_coverage" = "yes"); then + misc_cflags="$misc_cflags --coverage" + misc_ldflags="$misc_ldflags --coverage" + fi + MISC_CFLAGS=$misc_cflags + + MISC_LDFLAGS=$misc_ldflags + + + +# Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; enable_threads=${enableval} +fi + + +ac_fn_c_check_func "$LINENO" "signalfd" "ac_cv_func_signalfd" +if test "x$ac_cv_func_signalfd" = xyes; then : + dummy=yes +else + as_fn_error $? "signalfd support is required" "$LINENO" 5 +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $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 clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=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_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : + dummy=yes +else + as_fn_error $? "realtime clock support is required" "$LINENO" 5 +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $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 pthread_create (); +int +main () +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_create=yes +else + ac_cv_lib_pthread_pthread_create=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_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : + dummy=yes +else + as_fn_error $? "posix thread support is required" "$LINENO" 5 +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; 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" = xyes; then : + dummy=yes +else + as_fn_error $? "dynamic linking loader is required" "$LINENO" 5 +fi + + +for ac_header in linux/types.h linux/if_alg.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 + + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } + +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_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 >= 2.28\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.28") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.28" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_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 >= 2.28\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.28") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.28" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +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 + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.28" 2>&1` + else + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.28" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLIB_PKG_ERRORS" >&5 + + as_fn_error $? "GLib >= 2.28 is required" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "GLib >= 2.28 is required" "$LINENO" 5 +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dummy=yes +fi + + + +if (test "${enable_threads}" = "yes"); then + +$as_echo "#define NEED_THREADS 1" >>confdefs.h + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTHREAD" >&5 +$as_echo_n "checking for GTHREAD... " >&6; } + +if test -n "$GTHREAD_CFLAGS"; then + pkg_cv_GTHREAD_CFLAGS="$GTHREAD_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0 >= 2.16\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gthread-2.0 >= 2.16") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTHREAD_CFLAGS=`$PKG_CONFIG --cflags "gthread-2.0 >= 2.16" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTHREAD_LIBS"; then + pkg_cv_GTHREAD_LIBS="$GTHREAD_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gthread-2.0 >= 2.16\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gthread-2.0 >= 2.16") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTHREAD_LIBS=`$PKG_CONFIG --libs "gthread-2.0 >= 2.16" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +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 + GTHREAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gthread-2.0 >= 2.16" 2>&1` + else + GTHREAD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gthread-2.0 >= 2.16" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTHREAD_PKG_ERRORS" >&5 + + as_fn_error $? "GThread >= 2.16 is required" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "GThread >= 2.16 is required" "$LINENO" 5 +else + GTHREAD_CFLAGS=$pkg_cv_GTHREAD_CFLAGS + GTHREAD_LIBS=$pkg_cv_GTHREAD_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dummy=yes +fi + GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" + GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 +$as_echo_n "checking for DBUS... " >&6; } + +if test -n "$DBUS_CFLAGS"; then + pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.6\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.6") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.6" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DBUS_LIBS"; then + pkg_cv_DBUS_LIBS="$DBUS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.6\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.6") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.6" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +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 + DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 1.6" 2>&1` + else + DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.6" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DBUS_PKG_ERRORS" >&5 + + as_fn_error $? "D-Bus >= 1.6 is required" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "D-Bus >= 1.6 is required" "$LINENO" 5 +else + DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS + DBUS_LIBS=$pkg_cv_DBUS_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dummy=yes +fi + + + + +# Check whether --with-dbusconfdir was given. +if test "${with_dbusconfdir+set}" = set; then : + withval=$with_dbusconfdir; path_dbusconfdir=${withval} +fi + +if (test -z "${path_dbusconfdir}"); then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking D-Bus configuration directory" >&5 +$as_echo_n "checking D-Bus configuration directory... " >&6; } + path_dbusconfdir="`$PKG_CONFIG --variable=sysconfdir dbus-1`" + if (test -z "${path_dbusconfdir}"); then + as_fn_error $? "D-Bus configuration directory is required" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${path_dbusconfdir}" >&5 +$as_echo "${path_dbusconfdir}" >&6; } +fi +DBUS_CONFDIR=${path_dbusconfdir} + + + +# Check whether --with-dbussystembusdir was given. +if test "${with_dbussystembusdir+set}" = set; then : + withval=$with_dbussystembusdir; path_dbussystembusdir=${withval} +fi + +if (test -z "${path_dbussystembusdir}"); then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking D-Bus system bus services dir" >&5 +$as_echo_n "checking D-Bus system bus services dir... " >&6; } + path_dbussystembusdir="`$PKG_CONFIG --variable=system_bus_services_dir dbus-1`" + if (test -z "${path_dbussystembusdir}"); then + as_fn_error $? "D-Bus system bus services directory is required" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${path_dbussystembusdir}" >&5 +$as_echo "${path_dbussystembusdir}" >&6; } +fi +DBUS_SYSTEMBUSDIR=${path_dbussystembusdir} + + + +# Check whether --with-dbussessionbusdir was given. +if test "${with_dbussessionbusdir+set}" = set; then : + withval=$with_dbussessionbusdir; path_dbussessionbusdir=${withval} +fi + +if (test -z "${path_dbussessionbusdir}"); then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking D-Bus session bus services dir" >&5 +$as_echo_n "checking D-Bus session bus services dir... " >&6; } + path_dbussessionbusdir="`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`" + if (test -z "${path_dbussessionbusdir}"); then + as_fn_error $? "D-Bus session bus services directory is required" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${path_dbussessionbusdir}" >&5 +$as_echo "${path_dbussessionbusdir}" >&6; } +fi +DBUS_SESSIONBUSDIR=${path_dbussessionbusdir} + + +# Check whether --enable-backtrace was given. +if test "${enable_backtrace+set}" = set; then : + enableval=$enable_backtrace; enable_backtrace=${enableval} +fi + + +if (test "${enable_backtrace}" = "yes"); then + ac_fn_c_check_header_mongrel "$LINENO" "elfutils/libdwfl.h" "ac_cv_header_elfutils_libdwfl_h" "$ac_includes_default" +if test "x$ac_cv_header_elfutils_libdwfl_h" = xyes; then : + dummy=yes +else + as_fn_error $? "elfutils support is required" "$LINENO" 5 +fi + + + +$as_echo "#define HAVE_BACKTRACE_SUPPORT 1" >>confdefs.h + + BACKTRACE_CFLAGS="" + BACKTRACE_LIBS="-ldw" + + +fi + +# Check whether --enable-library was given. +if test "${enable_library+set}" = set; then : + enableval=$enable_library; enable_library=${enableval} +fi + + if test "${enable_library}" = "yes"; then + LIBRARY_TRUE= + LIBRARY_FALSE='#' +else + LIBRARY_TRUE='#' + LIBRARY_FALSE= +fi + + +# Check whether --enable-test was given. +if test "${enable_test+set}" = set; then : + enableval=$enable_test; enable_test=${enableval} +fi + + if test "${enable_test}" = "yes"; then + TEST_TRUE= + TEST_FALSE='#' +else + TEST_TRUE='#' + TEST_FALSE= +fi + + +# Check whether --enable-tools was given. +if test "${enable_tools+set}" = set; then : + enableval=$enable_tools; enable_tools=${enableval} +fi + + if test "${enable_tools}" != "no"; then + TOOLS_TRUE= + TOOLS_FALSE='#' +else + TOOLS_TRUE='#' + TOOLS_FALSE= +fi + + +# Check whether --enable-monitor was given. +if test "${enable_monitor+set}" = set; then : + enableval=$enable_monitor; enable_monitor=${enableval} +fi + + if test "${enable_monitor}" != "no"; then + MONITOR_TRUE= + MONITOR_FALSE='#' +else + MONITOR_TRUE='#' + MONITOR_FALSE= +fi + + +# Check whether --enable-udev was given. +if test "${enable_udev+set}" = set; then : + enableval=$enable_udev; enable_udev=${enableval} +fi + +if (test "${enable_tools}" != "no" && test "${enable_udev}" != "no"); then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UDEV" >&5 +$as_echo_n "checking for UDEV... " >&6; } + +if test -n "$UDEV_CFLAGS"; then + pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 172\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libudev >= 172") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 172" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$UDEV_LIBS"; then + pkg_cv_UDEV_LIBS="$UDEV_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 172\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libudev >= 172") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 172" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +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 + UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 172" 2>&1` + else + UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 172" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$UDEV_PKG_ERRORS" >&5 + + as_fn_error $? "libudev >= 172 is required" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "libudev >= 172 is required" "$LINENO" 5 +else + UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS + UDEV_LIBS=$pkg_cv_UDEV_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dummy=yes +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for udev_hwdb_new in -ludev" >&5 +$as_echo_n "checking for udev_hwdb_new in -ludev... " >&6; } +if ${ac_cv_lib_udev_udev_hwdb_new+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ludev $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 udev_hwdb_new (); +int +main () +{ +return udev_hwdb_new (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_udev_udev_hwdb_new=yes +else + ac_cv_lib_udev_udev_hwdb_new=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_udev_udev_hwdb_new" >&5 +$as_echo "$ac_cv_lib_udev_udev_hwdb_new" >&6; } +if test "x$ac_cv_lib_udev_udev_hwdb_new" = xyes; then : + +$as_echo "#define HAVE_UDEV_HWDB_NEW 1" >>confdefs.h + +fi + +fi + if test "${enable_udev}" != "no"; then + UDEV_TRUE= + UDEV_FALSE='#' +else + UDEV_TRUE='#' + UDEV_FALSE= +fi + + + +# Check whether --with-udevdir was given. +if test "${with_udevdir+set}" = set; then : + withval=$with_udevdir; path_udevdir=${withval} +fi + +if (test "${enable_udev}" != "no" && test -z "${path_udevdir}"); then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking udev directory" >&5 +$as_echo_n "checking udev directory... " >&6; } + path_udevdir="`$PKG_CONFIG --variable=udevdir udev`" + if (test -z "${path_udevdir}"); then + as_fn_error $? "udev directory is required" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${path_udevdir}" >&5 +$as_echo "${path_udevdir}" >&6; } +fi +UDEV_DIR=${path_udevdir} + + + if test "${enable_tools}" != "no" && + test "${enable_udev}" != "no"; then + HID2HCI_TRUE= + HID2HCI_FALSE='#' +else + HID2HCI_TRUE='#' + HID2HCI_FALSE= +fi + + +# Check whether --enable-cups was given. +if test "${enable_cups+set}" = set; then : + enableval=$enable_cups; enable_cups=${enableval} +fi + + if test "${enable_cups}" != "no"; then + CUPS_TRUE= + CUPS_FALSE='#' +else + CUPS_TRUE='#' + CUPS_FALSE= +fi + + +# Check whether --enable-obex was given. +if test "${enable_obex+set}" = set; then : + enableval=$enable_obex; enable_obex=${enableval} +fi + +if (test "${enable_obex}" != "no"); then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICAL" >&5 +$as_echo_n "checking for ICAL... " >&6; } + +if test -n "$ICAL_CFLAGS"; then + pkg_cv_ICAL_CFLAGS="$ICAL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libical\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libical") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ICAL_CFLAGS=`$PKG_CONFIG --cflags "libical" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$ICAL_LIBS"; then + pkg_cv_ICAL_LIBS="$ICAL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libical\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libical") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ICAL_LIBS=`$PKG_CONFIG --libs "libical" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +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 + ICAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libical" 2>&1` + else + ICAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libical" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ICAL_PKG_ERRORS" >&5 + + as_fn_error $? "libical is required" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "libical is required" "$LINENO" 5 +else + ICAL_CFLAGS=$pkg_cv_ICAL_CFLAGS + ICAL_LIBS=$pkg_cv_ICAL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dummy=yes +fi + + +fi + if test "${enable_obex}" != "no"; then + OBEX_TRUE= + OBEX_FALSE='#' +else + OBEX_TRUE='#' + OBEX_FALSE= +fi + + +# Check whether --enable-client was given. +if test "${enable_client+set}" = set; then : + enableval=$enable_client; enable_client=${enableval} +fi + + if test "${enable_client}" != "no"; then + CLIENT_TRUE= + CLIENT_FALSE='#' +else + CLIENT_TRUE='#' + CLIENT_FALSE= +fi + + +if (test "${enable_client}" != "no"); then + for ac_header in readline/readline.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" +if test "x$ac_cv_header_readline_readline_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_READLINE_READLINE_H 1 +_ACEOF + enable_readline=yes +else + as_fn_error $? "readline header files are required" "$LINENO" 5 +fi + +done + +fi + if test "${enable_readline}" = "yes"; then + READLINE_TRUE= + READLINE_FALSE='#' +else + READLINE_TRUE='#' + READLINE_FALSE= +fi + + +# Check whether --enable-systemd was given. +if test "${enable_systemd+set}" = set; then : + enableval=$enable_systemd; enable_systemd=${enableval} +fi + + if test "${enable_systemd}" != "no"; then + SYSTEMD_TRUE= + SYSTEMD_FALSE='#' +else + SYSTEMD_TRUE='#' + SYSTEMD_FALSE= +fi + + + +# Check whether --with-systemdsystemunitdir was given. +if test "${with_systemdsystemunitdir+set}" = set; then : + withval=$with_systemdsystemunitdir; path_systemunitdir=${withval} +fi + +if (test "${enable_systemd}" != "no" && test -z "${path_systemunitdir}"); then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking systemd system unit dir" >&5 +$as_echo_n "checking systemd system unit dir... " >&6; } + path_systemunitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`" + if (test -z "${path_systemunitdir}"); then + as_fn_error $? "systemd system unit directory is required" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${path_systemunitdir}" >&5 +$as_echo "${path_systemunitdir}" >&6; } +fi +SYSTEMD_SYSTEMUNITDIR=${path_systemunitdir} + + + +# Check whether --with-systemduserunitdir was given. +if test "${with_systemduserunitdir+set}" = set; then : + withval=$with_systemduserunitdir; path_userunitdir=${withval} +fi + +if (test "${enable_systemd}" != "no" && test -z "${path_userunitdir}"); then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking systemd user unit dir" >&5 +$as_echo_n "checking systemd user unit dir... " >&6; } + path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir systemd`" + if (test -z "${path_userunitdir}"); then + as_fn_error $? "systemd user unit directory is required" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${path_userunitdir}" >&5 +$as_echo "${path_userunitdir}" >&6; } +fi +SYSTEMD_USERUNITDIR=${path_userunitdir} + + +# Check whether --enable-datafiles was given. +if test "${enable_datafiles+set}" = set; then : + enableval=$enable_datafiles; enable_datafiles=${enableval} +fi + + if test "${enable_datafiles}" != "no"; then + DATAFILES_TRUE= + DATAFILES_FALSE='#' +else + DATAFILES_TRUE='#' + DATAFILES_FALSE= +fi + + +# Check whether --enable-manpages was given. +if test "${enable_manpages+set}" = set; then : + enableval=$enable_manpages; enable_manpages=${enableval} +fi + + if test "${enable_manpages}" = "yes"; then + MANPAGES_TRUE= + MANPAGES_FALSE='#' +else + MANPAGES_TRUE='#' + MANPAGES_FALSE= +fi + + +# Check whether --enable-experimental was given. +if test "${enable_experimental+set}" = set; then : + enableval=$enable_experimental; enable_experimental=${enableval} +fi + + if test "${enable_experimental}" = "yes"; then + EXPERIMENTAL_TRUE= + EXPERIMENTAL_FALSE='#' +else + EXPERIMENTAL_TRUE='#' + EXPERIMENTAL_FALSE= +fi + + +# Check whether --enable-deprecated was given. +if test "${enable_deprecated+set}" = set; then : + enableval=$enable_deprecated; enable_deprecated=${enableval} +fi + + if test "${enable_deprecated}" = "yes"; then + DEPRECATED_TRUE= + DEPRECATED_FALSE='#' +else + DEPRECATED_TRUE='#' + DEPRECATED_FALSE= +fi + + +# Check whether --enable-sixaxis was given. +if test "${enable_sixaxis+set}" = set; then : + enableval=$enable_sixaxis; enable_sixaxis=${enableval} +fi + + if test "${enable_sixaxis}" = "yes" && + test "${enable_udev}" != "no"; then + SIXAXIS_TRUE= + SIXAXIS_FALSE='#' +else + SIXAXIS_TRUE='#' + SIXAXIS_FALSE= +fi + + +if (test "${prefix}" = "NONE"); then + if (test "$localstatedir" = '${prefix}/var'); then + localstatedir='/var' + + fi + + prefix="${ac_default_prefix}" +fi + +if (test "$localstatedir" = '${prefix}/var'); then + storagedir="${prefix}/var/lib/bluetooth" +else + storagedir="${localstatedir}/lib/bluetooth" +fi + +cat >>confdefs.h <<_ACEOF +#define STORAGEDIR "${storagedir}" +_ACEOF + + +if (test "$sysconfdir" = '${prefix}/etc'); then + configdir="${prefix}/etc/bluetooth" +else + configdir="${sysconfdir}/bluetooth" +fi + +cat >>confdefs.h <<_ACEOF +#define CONFIGDIR "${configdir}" +_ACEOF + +CONFIGDIR="${configdir}" + + +# Check whether --enable-android was given. +if test "${enable_android+set}" = set; then : + enableval=$enable_android; enable_android=${enableval} +fi + + if test "${enable_android}" = "yes"; then + ANDROID_TRUE= + ANDROID_FALSE='#' +else + ANDROID_TRUE='#' + ANDROID_FALSE= +fi + + +if (test "${enable_android}" = "yes"); then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SBC" >&5 +$as_echo_n "checking for SBC... " >&6; } + +if test -n "$SBC_CFLAGS"; then + pkg_cv_SBC_CFLAGS="$SBC_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sbc >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sbc >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SBC_CFLAGS=`$PKG_CONFIG --cflags "sbc >= 1.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SBC_LIBS"; then + pkg_cv_SBC_LIBS="$SBC_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sbc >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sbc >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SBC_LIBS=`$PKG_CONFIG --libs "sbc >= 1.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +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 + SBC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sbc >= 1.2" 2>&1` + else + SBC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sbc >= 1.2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SBC_PKG_ERRORS" >&5 + + as_fn_error $? "SBC library >= 1.2 is required" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "SBC library >= 1.2 is required" "$LINENO" 5 +else + SBC_CFLAGS=$pkg_cv_SBC_CFLAGS + SBC_LIBS=$pkg_cv_SBC_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dummy=yes +fi + + +fi + +if (test "${enable_android}" = "yes"); then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SPEEXDSP" >&5 +$as_echo_n "checking for SPEEXDSP... " >&6; } + +if test -n "$SPEEXDSP_CFLAGS"; then + pkg_cv_SPEEXDSP_CFLAGS="$SPEEXDSP_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"speexdsp >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "speexdsp >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SPEEXDSP_CFLAGS=`$PKG_CONFIG --cflags "speexdsp >= 1.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SPEEXDSP_LIBS"; then + pkg_cv_SPEEXDSP_LIBS="$SPEEXDSP_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"speexdsp >= 1.2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "speexdsp >= 1.2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SPEEXDSP_LIBS=`$PKG_CONFIG --libs "speexdsp >= 1.2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +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 + SPEEXDSP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "speexdsp >= 1.2" 2>&1` + else + SPEEXDSP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "speexdsp >= 1.2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SPEEXDSP_PKG_ERRORS" >&5 + + as_fn_error $? "SPEEXDSP library >= 1.2 is required" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "SPEEXDSP library >= 1.2 is required" "$LINENO" 5 +else + SPEEXDSP_CFLAGS=$pkg_cv_SPEEXDSP_CFLAGS + SPEEXDSP_LIBS=$pkg_cv_SPEEXDSP_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + dummy=yes +fi + + +fi + + +cat >>confdefs.h <<_ACEOF +#define ANDROID_STORAGEDIR "${storagedir}/android" +_ACEOF + + +ac_config_files="$ac_config_files Makefile src/bluetoothd.8 lib/bluez.pc" + +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 + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + 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 + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + 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 "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" 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 "${COVERAGE_TRUE}" && test -z "${COVERAGE_FALSE}"; then + as_fn_error $? "conditional \"COVERAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DBUS_RUN_SESSION_TRUE}" && test -z "${DBUS_RUN_SESSION_FALSE}"; then + as_fn_error $? "conditional \"DBUS_RUN_SESSION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${VALGRIND_TRUE}" && test -z "${VALGRIND_FALSE}"; then + as_fn_error $? "conditional \"VALGRIND\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBRARY_TRUE}" && test -z "${LIBRARY_FALSE}"; then + as_fn_error $? "conditional \"LIBRARY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TEST_TRUE}" && test -z "${TEST_FALSE}"; then + as_fn_error $? "conditional \"TEST\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${TOOLS_TRUE}" && test -z "${TOOLS_FALSE}"; then + as_fn_error $? "conditional \"TOOLS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MONITOR_TRUE}" && test -z "${MONITOR_FALSE}"; then + as_fn_error $? "conditional \"MONITOR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${UDEV_TRUE}" && test -z "${UDEV_FALSE}"; then + as_fn_error $? "conditional \"UDEV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HID2HCI_TRUE}" && test -z "${HID2HCI_FALSE}"; then + as_fn_error $? "conditional \"HID2HCI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CUPS_TRUE}" && test -z "${CUPS_FALSE}"; then + as_fn_error $? "conditional \"CUPS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OBEX_TRUE}" && test -z "${OBEX_FALSE}"; then + as_fn_error $? "conditional \"OBEX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CLIENT_TRUE}" && test -z "${CLIENT_FALSE}"; then + as_fn_error $? "conditional \"CLIENT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${READLINE_TRUE}" && test -z "${READLINE_FALSE}"; then + as_fn_error $? "conditional \"READLINE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SYSTEMD_TRUE}" && test -z "${SYSTEMD_FALSE}"; then + as_fn_error $? "conditional \"SYSTEMD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DATAFILES_TRUE}" && test -z "${DATAFILES_FALSE}"; then + as_fn_error $? "conditional \"DATAFILES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MANPAGES_TRUE}" && test -z "${MANPAGES_FALSE}"; then + as_fn_error $? "conditional \"MANPAGES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${EXPERIMENTAL_TRUE}" && test -z "${EXPERIMENTAL_FALSE}"; then + as_fn_error $? "conditional \"EXPERIMENTAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${DEPRECATED_TRUE}" && test -z "${DEPRECATED_FALSE}"; then + as_fn_error $? "conditional \"DEPRECATED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SIXAXIS_TRUE}" && test -z "${SIXAXIS_FALSE}"; then + as_fn_error $? "conditional \"SIXAXIS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ANDROID_TRUE}" && test -z "${ANDROID_FALSE}"; then + as_fn_error $? "conditional \"ANDROID\" 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. +as_myself= +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 -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +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 + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# 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 bluez $as_me 5.43, which was +generated by GNU Autoconf 2.69. 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="\\ +bluez config.status 5.43 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 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' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +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 \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +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_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$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 \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +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" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/bluetoothd.8") CONFIG_FILES="$CONFIG_FILES src/bluetoothd.8" ;; + "lib/bluez.pc") CONFIG_FILES="$CONFIG_FILES lib/bluez.pc" ;; + + *) 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= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_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 -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# 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 {' >"$ac_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 >>"\$ac_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 >>"\$ac_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 < "$ac_tmp/subs1.awk" > "$ac_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 >"$ac_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_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; 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="$ac_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 >"$ac_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 "$ac_tmp/subs.awk" \ + >$ac_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' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_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 "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_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 "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_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 "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_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"" || { + # Older Autoconf 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"` + # 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'`; 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, 2009, 2010, 2011 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 + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# 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 + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# 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 + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# 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 + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# 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 + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# 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 + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# 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 + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# 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 + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# 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 + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# 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 + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# 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 + +# 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 + +# 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 + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_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 '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +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}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + 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 old mode 100644 new mode 100755 index bceaa81..530d512 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(bluez, 5.37) +AC_INIT(bluez, 5.43) AM_INIT_AUTOMAKE([foreign subdir-objects color-tests silent-rules tar-pax no-dist-gzip dist-xz]) @@ -34,8 +34,13 @@ AC_PROG_LIBTOOL if (test "$USE_MAINTAINER_MODE" = "yes"); then AC_CHECK_PROG(enable_coverage, [lcov], [yes], [no]) + AC_CHECK_PROG(enable_dbus_run_session, [dbus-run-session], [yes]) + AC_CHECK_PROG(enable_valgrind, [valgrind], [yes]) + AC_CHECK_HEADERS(valgrind/memcheck.h) fi AM_CONDITIONAL(COVERAGE, test "${enable_coverage}" = "yes") +AM_CONDITIONAL(DBUS_RUN_SESSION, test "${enable_dbus_run_session}" = "yes") +AM_CONDITIONAL(VALGRIND, test "${enable_valgrind}" = "yes") MISC_FLAGS @@ -74,14 +79,6 @@ PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.6, dummy=yes, AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) -PKG_CHECK_MODULES(LIBXML, libxml-2.0) -AC_SUBST(LIBXML_CFLAGS) -AC_SUBST(LIBXML_LIBS) - -PKG_CHECK_MODULES(INIPARSER, iniparser) -AC_SUBST(INIPARSER_CFLAGS) -AC_SUBST(INIPARSER_LIBS) - AC_ARG_WITH([dbusconfdir], AC_HELP_STRING([--with-dbusconfdir=DIR], [path to D-Bus configuration directory]), [path_dbusconfdir=${withval}]) @@ -185,8 +182,12 @@ AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no") AC_ARG_ENABLE(obex, AC_HELP_STRING([--disable-obex], [disable OBEX profile support]), [enable_obex=${enableval}]) -AC_SUBST(ICAL_CFLAGS) -AC_SUBST(ICAL_LIBS) +if (test "${enable_obex}" != "no"); then + PKG_CHECK_MODULES(ICAL, libical, dummy=yes, + AC_MSG_ERROR(libical is required)) + AC_SUBST(ICAL_CFLAGS) + AC_SUBST(ICAL_LIBS) +fi AM_CONDITIONAL(OBEX, test "${enable_obex}" != "no") AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client], @@ -246,38 +247,11 @@ AC_ARG_ENABLE(experimental, AC_HELP_STRING([--enable-experimental], [enable_experimental=${enableval}]) AM_CONDITIONAL(EXPERIMENTAL, test "${enable_experimental}" = "yes") -# Start of TIZEN_FEATURE_BLUEZ_MODIFY -AC_ARG_ENABLE(wearable, AC_HELP_STRING([--enable-wearable], - [enable wearable profile]), [enable_wearable=${enableval}]) -AM_CONDITIONAL(WEARABLE, test "${enable_wearable}" = "yes") - -AC_ARG_ENABLE(autopair, AC_HELP_STRING([--enable-autopair], - [Enable Autopair Plugin]), [enable_autopair=${enableval}]) -AM_CONDITIONAL(AUTOPAIR, test "${enable_autopair}" = "yes") - -AC_ARG_ENABLE(hid, AC_HELP_STRING([--enable-hid], - [Enable HID Plugin]), [enable_hid=${enableval}]) -AM_CONDITIONAL(TIZEN_HID_PLUGIN, test "${enable_hid}" = "yes") - -AM_CONDITIONAL(TIZEN_HEALTH_PLUGIN, test "${enable_health}" = "yes") - -AC_ARG_ENABLE(proximity, AC_HELP_STRING([--enable-proximity], - [Enable PROXIMITY Plugin]), [enable_proximity=${enableval}]) -AM_CONDITIONAL(TIZEN_PROXIMITY_PLUGIN, test "${enable_proximity}" = "yes") - -AC_ARG_ENABLE(tds, AC_HELP_STRING([--enable-tds], - [Enable TDS Plugin]), [enable_tds=${enableval}]) -AM_CONDITIONAL(TIZEN_TDS_PLUGIN, test "${enable_tds}" = "yes") - -AC_ARG_ENABLE(tizenunusedplugin, AC_HELP_STRING([--enable-tizenunusedplugin], - [Enable Unused Plugin]), [enable_tizenunusedplugin=${enableval}]) -AM_CONDITIONAL(TIZEN_UNUSED_PLUGIN, test "${enable_tizenunusedplugin}" = "yes") - -AC_ARG_ENABLE(sap, AC_HELP_STRING([--enable-sap], - [Enable SAP Plugin]), [enable_sap=${enableval}]) -AM_CONDITIONAL(TIZEN_SAP_PLUGIN, test "${enable_sap}" = "yes") +AC_ARG_ENABLE(deprecated, AC_HELP_STRING([--enable-deprecated], + [enable deprecated plugins (BLE services, ...)]), + [enable_deprecated=${enableval}]) +AM_CONDITIONAL(DEPRECATED, test "${enable_deprecated}" = "yes") -# End of TIZEN_FEATURE_BLUEZ_MODIFY AC_ARG_ENABLE(sixaxis, AC_HELP_STRING([--enable-sixaxis], [enable sixaxis plugin]), [enable_sixaxis=${enableval}]) AM_CONDITIONAL(SIXAXIS, test "${enable_sixaxis}" = "yes" && diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..4ebd5b3 --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2013 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# 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 outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +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" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# 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 + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +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 -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## 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). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - 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 -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # 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. +## 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. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -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 -ne 0; then + 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 ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # 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 + ;; + +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. + set_dir_from "$object" + set_base_from "$object" + 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 -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + 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. + set_dir_from "$object" + set_base_from "$object" + 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 -ne 0; then + 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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_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. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool 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$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # 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 + ;; + +#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 "X$1" != 'X--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|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | 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 "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + 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. + -arch) + eat=yes ;; + -*|$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" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | 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 "X$1" != 'X--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. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # 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 + ;; + +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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt old mode 100644 new mode 100755 index 4208e40..08de6cd --- a/doc/adapter-api.txt +++ b/doc/adapter-api.txt @@ -45,7 +45,7 @@ Methods void StartDiscovery() Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.Failed - void SetDiscoveryFilter(dict filter) [Experimental] + void SetDiscoveryFilter(dict filter) This method sets the device discovery filter for the caller. When this method is called with no filter @@ -80,7 +80,11 @@ Methods void StartDiscovery() When discovery filter is set, Device objects will be created as new devices with matching criteria are - discovered. PropertiesChanged signals will be emitted + discovered regardless of they are connectable or + discoverable which enables listening to + non-connectable and non-discoverable devices. + + PropertiesChanged signals will be emitted for already existing Device objects, with updated RSSI value. If one or more discovery filters have been set, the RSSI delta-threshold, that is imposed by @@ -105,159 +109,6 @@ Methods void StartDiscovery() org.bluez.Error.NotSupported org.bluez.Error.Failed -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - void StartCustomDiscovery(string pattern) - - This method starts the device discovery session with - parameter. The valid paramter strings are "BREDR", - "LE" or "LE_BREDR" which will perform the inquiry for - appropriate types. This includes an inquiry procedure - and remote device name resolving. Use StopDiscovery - to release the sessions acquired. - - This process will start creating Device objects as - new devices are discovered. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.Failed - - void StartLEDiscovery() - - This method starts the LE device discovery session. - General discovery and active scan is default. - Use StopLEDiscovery to release the sessions - acquired. - - This process will start emitting DeviceFound and - PropertyChanged "LEDiscovering" signals. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.Failed - - void StopLEDiscovery() - - This method will cancel any previous StartLEDiscovery - transaction. - - Note that a discovery procedure is shared between all - discovery sessions thus calling StopLEDiscovery will only - release a single session. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.Failed - org.bluez.Error.NotAuthorized - - void SetAdvertising(boolean enable) - - This method is used to set LE advertising on a - controller that supports it. - - This process will emit PropertyChanged "Advertising" - signal. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void SetAdvertisingParameters(uint32 interval_min, - uint32 interval_max, uint32 filter_policy, - uint32 type) - - This method allows for setting the Low Energy - advertising interval and advertising filter policy. - It is only supported on controller with LE support. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.Failed - - void SetAdvertisingData(array{byte} value) - - This method is used to set LE advertising data on a - controller that supports it. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void SetScanParameters(uint32 type, uint32 interval, uint32 window) - - This method allows for setting the Low Energy - scan interval and window. - It is only supported on controller with LE support. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.Failed - - void SetScanRespData(array{byte} value) - - This method is used to set LE scan response data on - a controller that supports it. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void AddDeviceWhiteList(string address, uint32 address_type) - - This method is used to add LE device to White List for given - address. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void RemoveDeviceWhiteList(string address, uint32 address_type) - - This method is used to remove LE device to White List for given - address. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void ClearDeviceWhiteList() - - This method is used to clear LE device to White List - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.Failed - - void SetLePrivacy(boolean enable_privacy) - - This method is used to set/reset LE privacy feature for the local - adapter when it supports the feature. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void SetLeStaticRandomAddress(boolean enable_random_address) - - This method is used to set/reset LE static random address for the local - adapter when it supports the feature. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void SetManufacturerData(array{byte} value) - - This method is used to set Manufacturer data on a - controller that supports it. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.InvalidArguments - org.bluez.Error.Failed - - void CreateDevice(string address) - - Creates a new object path for a remote device. This - method will connect to the remote device and retrieve - all SDP records. - - Possible errors: org.bluez.Error.InvalidArguments -#endif - Properties string Address [readonly] The Bluetooth device address. @@ -368,12 +219,3 @@ Properties string Address [readonly] Local Device ID information in modalias format used by the kernel and udev. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - boolean LEDiscovering [readonly] - - Indicates that a device LE discovery procedure is active. - - string Version [readonly] - - The Bluetooth version. -#endif diff --git a/doc/advertising-api.txt b/doc/advertising-api.txt old mode 100644 new mode 100755 index 4ee37bb..1c18ae3 --- a/doc/advertising-api.txt +++ b/doc/advertising-api.txt @@ -3,7 +3,7 @@ BlueZ D-Bus LE Advertising API Description Advertising packets are structured data which is broadcast on the LE Advertising channels and available for all devices in range. Because of the limited space -available in LE Advertising packets (32 bytes), each packet's contents must be +available in LE Advertising packets (31 bytes), each packet's contents must be carefully controlled. BlueZ acts as a store for the Advertisement Data which is meant to be sent. diff --git a/doc/agent-api.txt b/doc/agent-api.txt old mode 100644 new mode 100755 diff --git a/doc/alert-api.txt b/doc/alert-api.txt old mode 100644 new mode 100755 diff --git a/doc/assigned-numbers.txt b/doc/assigned-numbers.txt old mode 100644 new mode 100755 diff --git a/doc/btmon.txt b/doc/btmon.txt old mode 100644 new mode 100755 diff --git a/doc/btsnoop.txt b/doc/btsnoop.txt new file mode 100755 index 0000000..975a53f --- /dev/null +++ b/doc/btsnoop.txt @@ -0,0 +1,178 @@ +BTSnoop/Monitor protocol formats +******************************** + +Opcode definitions +================== + +New Index +--------- + + Code: 0x0000 + Parameters: Type (1 Octet + Bus (1 Octet) + BD_Addr (6 Octets) + Name (8 Octets) + + This opcode indicates that a new controller instance with a + given index was added. With some protocols, like the TTY-based + one there is only a single supported controller, meaning the + index is implicitly 0. + +Deleted Index +------------- + + Code: 0x0001 + + This opcode indicates that the controller with a specific index + was removed. + +Command Packet +-------------- + + Code: 0x0002 + + HCI command packet. + +Event Packet +------------ + + Code: 0x0003 + + HCI event packet. + +ACL TX Packet +------------- + + Code: 0x0004 + + Outgoing ACL packet. + +ACL RX Packet +------------- + + Code: 0x0005 + + Incoming ACL packet. + +SCO TX Packet +-------------- + + Code: 0x0006 + + Outgoing SCO packet. + +SCO RX Packet +------------- + + Code: 0x0007 + + Incomnig SCO packet. + +Open Index +---------- + + Code: 0x0008 + + The HCI transport for the specified controller has been opened. + +Close Index +----------- + + Code: 0x0009 + + The HCI transport for the specified controller has been closed. + +Index Information +----------------- + + Code: 0x000a + Parameters: BD_Addr (6 Octets) + Manufacturer (2 Octets) + + Information about a specific controller. + +Vendor Diagnostics +------------------ + + Code: 0x000b + + Vendor diagnostic information. + +System Note +----------- + + Code: 0x000c + + System note. + +User Logging +------------ + + Code: 0x000d + Parameters: Priority (1 Octet) + Ident_Length (1 Octet) + Ident (Ident_Length Octets) + + User logging information. + + +TTY-based protocol +================== + +This section covers the protocol that can be parsed by btmon when +passing it the --tty parameter. The protocol is little endian, packet +based, and has the following header for each packet: + +struct tty_hdr { + uint16_t data_len; + uint16_t opcode; + uint8_t flags; + uint8_t hdr_len; + uint8_t ext_hdr[0]; +} __attribute__ ((packed)); + +The actual payload starts at ext_hdr + hdr_len and has the length of +data_len - 4 - hdr_len. Each field of the header is defined as follows: + +data_len: + This is the total length of the entire packet, excuding the + data_len field itself. + +opcode: + The BTSnoop opcode + +flags: + Special flags for the packet. Currently no flags are defined. + +hdr_len: + Length of the extended header. + +ext_hdr: + This is a sequence of header extension fields formatted as: + + struct { + uint8_t type; + uint8_t value[length]; + } + + The length of the value is dependent on the type. Currently the + following types are defined: + + Type Length Meaning + ---------------------------------------------------------------- + 1 Command drops 1 byte Dropped HCI command packets + 2 Event drops 1 byte Dropped HCI event packets + 3 ACL TX drops 1 byte Dropped ACL TX packets + 4 ACL RX drops 1 byte Dropped ACL RX packets + 5 SCO TX drops 1 byte Dropped SCO TX packets + 6 SCO RX drops 1 byte Dropped SCO RX packets + 7 Other drops 1 byte Dropped other packets + 8 32-bit timestamp 4 bytes Timestamp in 1/10th ms + + The drops fields indicate the number of packets that the + implementation had to drop (e.g. due to lack of buffers) since + the last reported drop count. + + The fields of the extended header must be sorted by increasing + type. This is essential so that unknown types can be ignored and + the parser can jump to processing the payload. diff --git a/doc/coding-style.txt b/doc/coding-style.txt deleted file mode 100644 index f0bf880..0000000 --- a/doc/coding-style.txt +++ /dev/null @@ -1,279 +0,0 @@ -BlueZ coding style -****************** - -Every project has its coding style, and BlueZ is not an exception. This -document describes the preferred coding style for BlueZ code, in order to keep -some level of consistency among developers so that code can be easily -understood and maintained. - -First of all, BlueZ coding style must follow every rule for Linux kernel -(http://www.kernel.org/doc/Documentation/CodingStyle). There also exists a tool -named checkpatch.pl to help you check the compliance with it. Just type -"checkpatch.pl --no-tree patch_name" to check your patch. In theory, you need -to clean up all the warnings and errors except this one: "ERROR: Missing -Signed-off-by: line(s)". BlueZ does not used Signed-Off lines, so including -them is actually an error. In certain circumstances one can ignore the 80 -character per line limit. This is generally only allowed if the alternative -would make the code even less readable. - -Besides the kernel coding style above, BlueZ has special flavors for its own. -Some of them are mandatory (marked as 'M'), while some others are optional -(marked as 'O'), but generally preferred. - -M1: Blank line before and after an if/while/do/for statement -============================================================ - -There should be a blank line before if statement unless the if is nested and -not preceded by an expression or variable declaration. - -Example: -1) -a = 1; -if (b) { // wrong - -2) -a = 1 - -if (b) { -} -a = 2; // wrong - -3) -if (a) { - if (b) // correct - -4) -b = 2; - -if (a) { // correct - -} - -b = 3; - -The only exception to this rule applies when a variable is being checked for -errors as such: - -err = stat(filename, &st); -if (err || !S_ISDIR(st.st_mode)) - return; - -M2: Multiple line comment -========================= - -If your comment has more than one line, please start it from the second line. - -Example: -/* - * first line comment // correct - * ... - * last line comment - */ - - -M3: Space before and after operator -=================================== - -There should be a space before and after each operator. - -Example: -a + b; // correct - - -M4: Wrap long lines -=================== - -If your condition in if, while, for statement or a function declaration is too -long to fit in one line, the new line needs to be indented not aligned with the -body. - -Example: -1) -if ((adapter->supported_settings & MGMT_SETTING_SSP) && - !(adapter->current_settings & MGMT_SETTING_SSP)) // wrong - -2) -if ((adapter->supported_settings & MGMT_SETTING_SSP) && - !(adapter->current_settings & MGMT_SETTING_SSP)) - -3) -void btd_adapter_register_pin_cb(struct btd_adapter *adapter, - btd_adapter_pin_cb_t cb) // wrong - -4) -void btd_adapter_register_pin_cb(struct btd_adapter *adapter, - btd_adapter_pin_cb_t cb) - -The referred style for line wrapping is to indent as far as possible to the -right without hitting the 80 columns limit. - -M5: Space when doing type casting -================================= - -There should be a space between new type and variable. - -Example: -1) -a = (int *)b; // wrong -2) -a = (int *) b; // correct - - -M6: Don't initialize variable unnecessarily -=========================================== - -When declaring a variable, try not to initialize it unless necessary. - -Example: -int i = 1; // wrong - -for (i = 0; i < 3; i++) { -} - -M7: Follow the order of include header elements -=============================================== - -When writing an include header the various elements should be in the following -order: - - #includes - - forward declarations - - #defines - - enums - - typedefs - - function declarations and inline function definitions - -M8: Internal headers must not use include guards -================================================ - -Any time when creating a new header file with non-public API, that header -must not contain include guards. - -M9: Naming of enums -=================== - -Enums must have a descriptive name. The enum type should be small caps and -it should not be typedef-ed. Enum contents should be in CAPITAL letters and -prefixed by the enum type name. - -Example: - -enum animal_type { - ANIMAL_TYPE_FOUR_LEGS, - ANIMAL_TYPE_EIGHT_LEGS, - ANIMAL_TYPE_TWO_LEGS, -}; - -If the enum contents have values (e.g. from specification) the formatting -should be as follows: - -enum animal_type { - ANIMAL_TYPE_FOUR_LEGS = 4, - ANIMAL_TYPE_EIGHT_LEGS = 8, - ANIMAL_TYPE_TWO_LEGS = 2, -}; - -M10: Enum as switch variable -============================ - -If the variable of a switch is an enum, you must include all values in -switch body even if providing default. This is enforced by compiler option -enabling extra warning in such case. The reason for this is to ensure that if -later on enum is modified and one forget to change the switch accordingly, the -compiler will complain the new added type hasn't been handled. - -Example: - -enum animal_type { - ANIMAL_TYPE_FOUR_LEGS = 4, - ANIMAL_TYPE_EIGHT_LEGS = 8, - ANIMAL_TYPE_TWO_LEGS = 2, -}; - -enum animal_type t; - -switch (t) { // OK -case ANIMAL_TYPE_FOUR_LEGS: - ... - break; -case ANIMAL_TYPE_EIGHT_LEGS: - ... - break; -case ANIMAL_TYPE_TWO_LEGS: - ... - break; -default: - break; -} - -switch (t) { // Wrong -case ANIMAL_TYPE_FOUR_LEGS: - ... - break; -case ANIMAL_TYPE_TWO_LEGS: - ... - break; -default: - break; -} - -However if the enum comes from an external header file outside BlueZ, such as -Android headers, we cannot make any assumption of how the enum is defined and -this rule might not apply. - -M11: Always use parenthesis with sizeof -======================================= - -The expression argument to the sizeof operator should always be in -parenthesis, too. - -Example: -1) -memset(stuff, 0, sizeof(*stuff)); - -2) -memset(stuff, 0, sizeof *stuff); // Wrong - -M12: Use void if function has no parameters -=========================================== - -A function with no parameters must use void in the parameter list. - -Example: -1) -void foo(void) -{ -} - -2) -void foo() // Wrong -{ -} - -O1: Try to avoid complex if body -================================ - -It's better not to have a complicated statement for if. You may judge its -contrary condition and return | break | continue | goto ASAP. - -Example: -1) -if (device) { // worse - memset(&eir_data, 0, sizeof(eir_data)); - if (eir_len > 0) - eir_parse(&eir_data, ev->eir, eir_len); - ... -} else { - error("Unable to get device object for %s", addr); - return; -} - -2) -if (!device) { - error("Unable to get device object for %s", addr); - return; -} - -memset(&eir_data, 0, sizeof(eir_data)); -if (eir_len > 0) - eir_parse(&eir_data, ev->eir, eir_len); -... diff --git a/doc/cyclingspeed-api.txt b/doc/cyclingspeed-api.txt old mode 100644 new mode 100755 diff --git a/doc/device-api.txt b/doc/device-api.txt old mode 100644 new mode 100755 index 69c854e..13b2881 --- a/doc/device-api.txt +++ b/doc/device-api.txt @@ -21,6 +21,20 @@ Methods void Connect() If at least one profile was connected successfully this method will indicate success. + For dual-mode devices only one bearer is connected at + time, the conditions are in the following order: + + 1. Connect the disconnected bearer if already + connected. + + 2. Connect first the bonded bearer. If no + bearers are bonded or both are skip and check + latest seen bearer. + + 3. Connect last seen bearer, in case the + timestamps are the same BR/EDR takes + precedence. + Possible errors: org.bluez.Error.NotReady org.bluez.Error.Failed org.bluez.Error.InProgress @@ -67,11 +81,7 @@ Methods void Connect() org.bluez.Error.InvalidArguments org.bluez.Error.NotSupported -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - void Pair(uint8 conn_type) -#else void Pair() -#endif This method will connect to the remote device, initiate pairing and then retrieve all SDP records @@ -89,14 +99,6 @@ Methods void Connect() In case there is no application agent and also no default agent present, this method will fail. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - conn_type represents the type of the connection to be - used for pairing. - 0xFF -> BR/EDR and LE - 0x00 -> BR/EDR only - 0x01 -> LE only -#endif - Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.Failed org.bluez.Error.AlreadyExists @@ -114,29 +116,6 @@ Methods void Connect() Possible errors: org.bluez.Error.DoesNotExist org.bluez.Error.Failed -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - void ConnectLe() - - This is a generic method to connect GATT of - the remote device supporting LE and have been - flagged as auto-connectable on our side. - - Possible errors: org.bluez.Error.NotReady - org.bluez.Error.Failed - org.bluez.Error.InProgress - org.bluez.Error.AlreadyConnected - - - void DisconnectLe() - - This method disconnects a specific remote device LE - connection by terminating the low-level ACL connection. - The use of this method should be restricted to administrator - use. - - Possible errors: org.bluez.Error.NotConnected -#endif - Properties string Address [readonly] The Bluetooth device address of the remote device. @@ -175,11 +154,7 @@ Properties string Address [readonly] Indicates if the remote device is paired. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - byte Connected [readonly] -#else boolean Connected [readonly] -#endif Indicates if the remote device is currently connected. A PropertiesChanged signal indicate changes to this @@ -235,7 +210,7 @@ Properties string Address [readonly] Received Signal Strength Indicator of the remote device (inquiry or advertising). - int16 TxPower [readonly, optional, experimental] + int16 TxPower [readonly, optional] Advertised transmitted power level (inquiry or advertising). @@ -251,18 +226,11 @@ Properties string Address [readonly] Service advertisement data. Keys are the UUIDs in string format followed by its byte array value. - array{object} GattServices [readonly, optional] + bool ServicesResolved [readonly] - List of GATT service object paths. Each referenced - object exports the org.bluez.GattService1 interface and - represents a remote GATT service. This property will be - updated once all remote GATT services of this device - have been discovered and exported over D-Bus. + Indicate whether or not service discovery has been + resolved. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - boolean GattConnected [readonly] + array{byte} AdvertisingFlags [readonly, experimental] - Indicates if the remote LE device is currently connected. - A PropertiesChanged signal indicate changes to this - status. -#endif + The Advertising Data Flags of the remote device. diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt old mode 100644 new mode 100755 index 7c4fff5..6c98b87 --- a/doc/gatt-api.txt +++ b/doc/gatt-api.txt @@ -27,7 +27,7 @@ using GattManager1 registration method and must implement the methods and properties defined in GattService1 interface. Service org.bluez -Interface org.bluez.GattService1 [Experimental] +Interface org.bluez.GattService1 Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX Properties string UUID [read-only] @@ -45,14 +45,6 @@ Properties string UUID [read-only] belongs to. Only present on services from remote devices. - array{object} Characteristics [read-only] - - Array of object paths representing the characteristics - of this service. This property is set only when the - characteristic discovery has been completed, however the - characteristic objects will become available via - ObjectManager as soon as they get discovered. - array{object} Includes [read-only]: Not implemented Array of object paths representing the included @@ -66,26 +58,32 @@ For local GATT defined services, the object paths need to follow the service path hierarchy and are freely definable. Service org.bluez -Interface org.bluez.GattCharacteristic1 [Experimental] +Interface org.bluez.GattCharacteristic1 Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY -Methods array{byte} ReadValue() +Methods array{byte} ReadValue(dict options) Issues a request to read the value of the characteristic and returns the value if the operation was successful. + Possible options: "offset": uint16 offset + "device": Object Device (Server only) + Possible Errors: org.bluez.Error.Failed org.bluez.Error.InProgress org.bluez.Error.NotPermitted org.bluez.Error.NotAuthorized org.bluez.Error.NotSupported - void WriteValue(array{byte} value) + void WriteValue(array{byte} value, dict options) Issues a request to write the value of the characteristic. + Possible options: "offset": Start offset + "device": Device path (Server only) + Possible Errors: org.bluez.Error.Failed org.bluez.Error.InProgress org.bluez.Error.NotPermitted @@ -117,7 +115,7 @@ Properties string UUID [read-only] object Service [read-only] - Object path of the GATT service the characteristc + Object path of the GATT service the characteristic belongs to. array{byte} Value [read-only, optional] @@ -127,7 +125,7 @@ Properties string UUID [read-only] when a notification or indication is received, upon which a PropertiesChanged signal will be emitted. - boolean Notifying [read-only] + boolean Notifying [read-only, optional] True, if notifications or indications on this characteristic are currently enabled. @@ -152,22 +150,8 @@ Properties string UUID [read-only] "encrypt-write" "encrypt-authenticated-read" "encrypt-authenticated-write" - - array{object} Descriptors [read-only] - - Array of object paths representing the descriptors - of this service. This property is set only when the - descriptor discovery has been completed, however the - descriptor objects will become available via - ObjectManager as soon as they get discovered. - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - string Unicast [read-only] - - 12:34:56:78:9A:BC remote device address, if address is set then - notifications or indications shall be sent to only "XX_XX_XX_XX_XX_XX" - device otherwise notification or indication shall be multicasted. -#endif + "secure-read" (Server only) + "secure-write" (Server only) Characteristic Descriptors hierarchy ==================================== @@ -175,26 +159,32 @@ Characteristic Descriptors hierarchy Local or remote GATT characteristic descriptors hierarchy. Service org.bluez -Interface org.bluez.GattDescriptor1 [Experimental] +Interface org.bluez.GattDescriptor1 Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY/descriptorZZZ -Methods array{byte} ReadValue() +Methods array{byte} ReadValue(dict flags) Issues a request to read the value of the characteristic and returns the value if the operation was successful. + Possible options: "offset": Start offset + "device": Device path (Server only) + Possible Errors: org.bluez.Error.Failed org.bluez.Error.InProgress org.bluez.Error.NotPermitted org.bluez.Error.NotAuthorized org.bluez.Error.NotSupported - void WriteValue(array{byte} value) + void WriteValue(array{byte} value, dict flags) Issues a request to write the value of the characteristic. + Possible options: "offset": Start offset + "device": Device path (Server only) + Possible Errors: org.bluez.Error.Failed org.bluez.Error.InProgress org.bluez.Error.NotPermitted @@ -208,7 +198,7 @@ Properties string UUID [read-only] object Characteristic [read-only] - Object path of the GATT characteristc the descriptor + Object path of the GATT characteristic the descriptor belongs to. array{byte} Value [read-only, optional] @@ -229,9 +219,11 @@ Properties string UUID [read-only] "encrypt-write" "encrypt-authenticated-read" "encrypt-authenticated-write" + "secure-read" (Server Only) + "secure-write" (Server Only) -Profile hierarcy -================ +GATT Profile hierarchy +===================== Local profile (GATT client) instance. By registering this type of object an application effectively indicates support for a specific GATT profile @@ -239,7 +231,7 @@ and requests automatic connections to be established to devices supporting it. Service -Interface org.bluez.GattProfile1 [Experimental] +Interface org.bluez.GattProfile1 Object path Methods void Release() @@ -250,6 +242,10 @@ Methods void Release() profile, because when this method gets called it has already been unregistered. +Properties array{string} UUIDs [read-only] + + 128-bit GATT service UUIDs to auto connect. + GATT Manager hierarchy ====================== @@ -311,18 +307,28 @@ unregister the service. Similarly, if the application disconnects from the bus, all of its registered services will be automatically unregistered. InterfacesAdded signals will be ignored. +Examples: + - Client + test/example-gatt-client + client/bluetoothctl + - Server + test/example-gatt-server + tools/gatt-service + + Service org.bluez -Interface org.bluez.GattManager1 [Experimental] +Interface org.bluez.GattManager1 Object path [variable prefix]/{hci0,hci1,...} Methods void RegisterApplication(object application, dict options) Registers a local GATT services hierarchy as described - above. + above (GATT Server) and/or GATT profiles (GATT Client). The application object path together with the D-Bus system bus connection ID define the identification of - the application registering a GATT based service. + the application registering a GATT based + service or profile. Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.AlreadyExists @@ -336,44 +342,3 @@ Methods void RegisterApplication(object application, dict options) Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.DoesNotExist - - void RegisterProfile(object profile, array{string} UUIDs, - dict options) - - Registers a GATT (client role) profile exported - under interface GattProfile1. The array of UUIDs - specifies the mandatory set of remote service - UUIDs that should all be available for the - remote device to match this profile. Matching - devices will be added to the auto-connection - list and connected whenever available. - - Possible errors: org.bluez.Error.InvalidArguments - org.bluez.Error.AlreadyExists - - void UnregisterProfile(object profile) - - This unregisters the profile that has been - previously registered. The object path parameter - must match the same value that has been used - on registration. - - Possible errors: org.bluez.Error.InvalidArguments - org.bluez.Error.DoesNotExist -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - GetService(string uuid) - - This Reads the service, characterstics and descriptors - that has been previously registered. The string uuid parameter - must match the same value that has been used - on registration. - - The return values includes, - Key objectpath - ---- ----------- - Service /serviceX - CharacteristicsX /serviceX/CharacterisitcX - DescriptorX /serviceX/CharacterisitcX/DescriptorX - - Possible errors: org.bluez.Error.InvalidArguments -#endif diff --git a/doc/health-api.txt b/doc/health-api.txt old mode 100644 new mode 100755 diff --git a/doc/heartrate-api.txt b/doc/heartrate-api.txt old mode 100644 new mode 100755 diff --git a/doc/input-api.txt b/doc/input-api.txt old mode 100644 new mode 100755 diff --git a/doc/maintainer-guidelines.txt b/doc/maintainer-guidelines.txt deleted file mode 100644 index 21162d4..0000000 --- a/doc/maintainer-guidelines.txt +++ /dev/null @@ -1,114 +0,0 @@ -Maintainer guidelines -********************* - -This document is intended for the maintainers of the BlueZ project. It -serves as basic guidelines for handling patch review and commit access. - - -Rule 1: Keep the GIT tree clean and linear -========================================== - -The bluetooth.git, bluetooth-next.git and bluez.git trees are not your -private playground. The history is meant to be clean and linear. - - - NO merges - - NO branches - - NO tags - -If anyone needs testing or work on a feature, clone the tree and do -it in your own copy. The master trees are off limits. - -One advise to avoid any accidental errors in this area to set proper -options in global ~/.gitconfig or local .git/config files. - - [merge] - ff = only - -Violations of this rule are not acceptable. This rule is enforced. If -in doubt ask one of the seasoned maintainers. - - -Rule 2: Enforce clean commit messages -===================================== - -The commit messages are required to be clean and follow style guidelines -to be consistent. - -Commit messages should adhere to a 72 characters by line limit. That -makes it easy to read them via git log in a terminal window. Exceptions -to this rule are logs, trace or other verbatim copied information. - -Every commit requires full names and email addresses. No synonyms or -nicknames are allowed. It is also important that the Outlook style -names with lastname, firstname are not allowed. It is the maintainers -job to ensure we get proper firstname lastname authorship. - -It is also important that the committer itself uses a valid name and -email address when committing patches. So ensure that either the -global ~/.gitconfig or local .git/config provides proper values. - - [user] - name = Peter Mustermann - email = peter@mustermann.de - -Commit messages for bluez.git shall not contain Signed-off-by -signatures. They are not used in userspace and with that it is the -maintainers job to ensure they do not get committed to the repository. - -For bluetooth.git and bluetooth-next.git The Signed-off-by process is -used and the signatures are required. - -Tags like Change-Id generated from Gerrit are never acceptable. It is -the maintainers job to ensure that these are not committed into the -repositories. - -Violations of this rule create a mess in the tree that can not be -reversed. If in doubt ask one of the seasoned maintainers. - - -Rule 3: Enforce correct coding style -==================================== - -The coding style follows roughly the kernel coding style with any -exceptions documented in doc/coding-style.txt. - -To ensure trivial white-space errors don't get committed, have the -following in your .gitconfig: - - [apply] - whitespace = error - -It can also be helpful to use the checkpatch.pl script coming with the -Linux kernel to do some automated checking. Adding the following to your -.git/hooks/pre-commit and .git/hooks/pre-applypatch is a simple way to -do this: - - exec git diff --cached | ~/src/linux/scripts/checkpatch.pl -q \ - --no-tree --no-signoff --show-types \ - --ignore CAMELCASE,NEW_TYPEDEFS,INITIALISED_STATIC - - -The above assumes that a kernel tree resides in ~/src/linux/. - - -Rule 4: Pay extra attention to adding new files to the tree -=========================================================== - -New files that are added to the tree require several things to be -verified first: - - - Check that the names are acceptible with other maintainers - - Ensure that the file modes are correct - - Verify that the license & copyright headers are correct - - If the file is supposed to be part of the release tarball, - make sure that it gets picked up by 'make dist' (particularly - important for documentation or other files that are not code) - - -Rule 5: Keep the mailing list in sync with the commit process -============================================================= - -When applying patches, be sure to send a response to the mailing list as -soon as the code has been pushed to the upstream tree. Usually this -means one email per patch, however patch-sets may only have one response -covering the entire set. If applying a subset of a patch-set clearly -state what was applied in your response. diff --git a/doc/media-api.txt b/doc/media-api.txt old mode 100644 new mode 100755 diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt old mode 100644 new mode 100755 index 0d94f8b..34270dd --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -25,7 +25,10 @@ Linux kernel v3.17 Version 1.7 Linux kernel v3.19 Version 1.8 Linux kernel v4.1 Version 1.9 Linux kernel v4.2 Version 1.10 -Linux kernel v4.5 Version 1.11 (not yet released) +Linux kernel v4.5 Version 1.11 +Linux kernel v4.6 Version 1.12 +Linux kernel v4.8 Version 1.13 +Linux kernel v4.9 Version 1.14 (not yet released) Version 1.1 introduces Set Device ID command. @@ -69,7 +72,19 @@ Connectable when controller is powered off. Version 1.10 does not introduce any new command or event. It extends the advertising feature to support 5 parallel advertising instances. -Version 1.11 introduces Get Advertising Size Information command. +Version 1.11 introduces Get Advertising Size Information and Start Limited +Discovery commands. + +Version 1.12 introduces a new limited privacy mode (value 0x02 passed to +the Set Privacy command). + +Version 1.13 introduces a new authentication failure reason code for the +Device Disconnected event. + +Version 1.14 introduces Read Extended Controller Information command and +Extended Controller Information Changed event. It also adds Set Appearance +command. The advertising flags Appearance and Local Name for adding scan +response information are now supported. Example @@ -547,6 +562,7 @@ Set Secure Simple Pairing Command Invalid Parameters Invalid Index + Set High Speed Command ====================== @@ -1821,11 +1837,9 @@ Set Privacy Command means resolvable private address is used when the controller is discoverable and also when pairing is initiated. - With value 0x02 the kernel will use privacy mode with resolvable - private address. In case the controller is bondable and - discoverable the identity address is used. Also when pairing is - initiated, the connection will be established with the identity - address. + With value 0x02 the kernel will use a limited privacy mode with a + resolvable private address except when the controller is bondable + and discoverable, in which case the identity address is used. Exposing the identity address when bondable and discoverable or during initiated pairing can be a privacy issue. For dual-mode @@ -1893,68 +1907,6 @@ Load Identity Resolving Keys Command Possible errors: Invalid Parameters Invalid Index -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -Generate Identity Resolving Key Command -======================================= - - Command Code: 0x00F6 - Controller Index: - Command Parameters: - Return Parameters: - - This command is used to generate identity resolving key for the - local device, which will be used at the time of pairing for key - distribution and to generate resolvable private address for local device. - - This command generates a Command Complete event on success - or a Command Status event on failure. - - Possible errors: Failed - Invalid Index - -Generate Resolvable Private Address Command -======================================= - - Command Code: 0x00F5 - Controller Index: - Command Parameters: - Return Parameters: Resolvable Private Address (6 Octets) - - This command is used to generate resolvable private address for the - local device when LE privacy is supported and device is having its IRK. - - This command returns generated private address which is resolvable - by remote device on success. - - This command generates a Command Complete event on success - or a Command Status event on failure. - - Possible errors: Failed - Invalid Index - -Set Random Address Command -========================== - - Command Code: 0x00F4 - Controller Index: - Command Parameters: Resolvable Private Address (6 Octets) - Return Parameters: - - This command is used to set the random address to local controller. - If local device supports LE Privacy then this command will be called to set - its Random address while active scanning remote devices and in the case of - advertising itself. - - This command intern calls the HCI Set Random address command from kernel - space to set the RPA to controller. - - This command generates a Command Complete event on success - or a Command Status event on failure. - - Possible errors: Failed - Invalid Index - -#endif Get Connection Information Command ================================== @@ -2319,7 +2271,7 @@ Start Service Discovery Command Controller Index: Command Parameters: Address_Type (1 Octet) RSSI_Threshold (1 Octet) - UUID_Count (1 Octet) + UUID_Count (2 Octets) UUID[i] (16 Octets) Return Parameters: Address_Type (1 Octet) @@ -2515,6 +2467,9 @@ Read Extended Controller Index List Command 0x04 RS232 0x05 PCI 0x06 SDIO + 0x07 SPI + 0x08 I2C + 0x09 SMD Controllers marked as RAW only operation are currently not listed by this command. @@ -2863,6 +2818,105 @@ Start Limited Discovery Command Invalid Index +Read Extended Controller Information Command +============================================ + + Command Code: 0x0042 + Controller Index: + Command Parameters: + Return Parameters: Address (6 Octets) + Bluetooth_Version (1 Octet) + Manufacturer (2 Octets) + Supported_Settings (4 Octets) + Current_Settings (4 Octets) + EIR_Data_Length (2 Octets) + EIR_Data (0-65535 Octets) + + This command is used to retrieve the current state and basic + information of a controller. It is typically used right after + getting the response to the Read Controller Index List command + or an Index Added event (or its extended counterparts). + + The Address parameter describes the controllers public address + and it can be expected that it is set. However in case of single + mode Low Energy only controllers it can be 00:00:00:00:00:00. To + power on the controller in this case, it is required to configure + a static address using Set Static Address command first. + + If the public address is set, then it will be used as identity + address for the controller. If no public address is available, + then the configured static address will be used as identity + address. + + In the case of a dual-mode controller with public address that + is configured as Low Energy only device (BR/EDR switched off), + the static address is used when set and public address otherwise. + + Current_Settings and Supported_Settings is a bitmask with + currently the following available bits: + + 0 Powered + 1 Connectable + 2 Fast Connectable + 3 Discoverable + 4 Bondable + 5 Link Level Security (Sec. mode 3) + 6 Secure Simple Pairing + 7 Basic Rate/Enhanced Data Rate + 8 High Speed + 9 Low Energy + 10 Advertising + 11 Secure Connections + 12 Debug Keys + 13 Privacy + 14 Controller Configuration + 15 Static Address + + The EIR_Data field contains information about class of device, + local name and other values. Not all of them might be present. For + example a Low Energy only device does not contain class of device + information. + + When any of the values in the EIR_Data field changes, the event + Extended Controller Information Changed will be used to inform + clients about the updated information. + + This command generates a Command Complete event on success or + a Command Status event on failure. + + Possible errors: Invalid Parameters + Invalid Index + + +Set Appearance Command +====================== + + Command Code: 0x0042 + Controller Index: + Command Parameters: Appearance (2 Octets) + Return Parameters: + + This command is used to set the appearance value of a controller. + + This command can be used when the controller is not + powered and all settings will be programmed once powered. + + The value of appearance will be remembered when switching + the controller off and back on again. So the appearance only + have to be set once when a new controller is found and will + stay until removed. + + This command generates a Command Complete event on success + or a Command Status event on failure. + + This command is only available for LE capable controllers. + It will return Not Supported otherwise. + + Possible errors: Not Supported + Invalid Parameters + Invalid Index + + Command Complete Event ====================== @@ -3122,6 +3176,7 @@ Device Disconnected Event 1 Connection timeout 2 Connection terminated by local host 3 Connection terminated by remote host + 4 Connection terminated due to authentication failure Note that the local/remote distinction just determines which side terminated the low-level connection, regardless of the @@ -3707,3 +3762,23 @@ Advertising Removed Event The event will only be sent to management sockets other than the one through which the command was sent. + + +Extended Controller Information Changed Event +============================================= + + Event Code: 0x0025 + Controller Index: + Event Parameters: EIR_Data_Length (2 Octets) + EIR_Data (0-65535 Octets) + + This event indicates that controller information has been updated + and new values are used. This includes the local name, class of + device, device id and LE address information. + + This event will only be used after Read Extended Controller + Information command has been used at least once. If it has not + been used the legacy events are used. + + The event will only be sent to management sockets other than the + one through which the change was triggered. diff --git a/doc/network-api.txt b/doc/network-api.txt old mode 100644 new mode 100755 index 0fb633c..109da28 --- a/doc/network-api.txt +++ b/doc/network-api.txt @@ -74,17 +74,3 @@ Methods void Register(string uuid, string bridge) All servers will be automatically unregistered when the calling application terminates. - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - void Disconnect(string address) - - Disconnect the device from the network device. - - Possible errors: org.bluez.Error.Failed - org.bluez.Error.NotConnected - - dict GetProperties(string address) - - Returns all properties of the specified device. - See the properties section for available properties. -#endif diff --git a/doc/obex-agent-api.txt b/doc/obex-agent-api.txt old mode 100644 new mode 100755 diff --git a/doc/obex-api.txt b/doc/obex-api.txt old mode 100644 new mode 100755 diff --git a/doc/oob-api.txt b/doc/oob-api.txt deleted file mode 100644 index d838712..0000000 --- a/doc/oob-api.txt +++ /dev/null @@ -1,38 +0,0 @@ -BlueZ D-Bus Out Of Band Pairing API description -=============================================== - -Copyright (C) 2011 Szymon Janc for ST-Ericsson - -Service org.bluez -Interface org.bluez.OutOfBand -Object path [variable prefix]/{hci0,hci1,...} - -Methods array{byte} hash, array{byte} randomizer ReadLocalData() - - This method reads local OOB data from adapter. Return - value is pair of arrays 16 bytes each. - - Note: This method will generate and return new local - OOB data. - - Possible errors: org.bluez.Error.Failed - org.bluez.Error.InProgress - - void AddRemoteData(string address, array{byte} hash, - array{byte} randomizer) - - This method adds new Out Of Band data for - specified address. If data for specified address - already exists it will be overwritten with new one. - - Possible errors: org.bluez.Error.Failed - org.bluez.Error.InvalidArguments - - void RemoveRemoteData(string address) - - This method removes Out Of Band data for specified - address. If data for specified address does not exist - nothing is removed. - - Possible errors: org.bluez.Error.Failed - org.bluez.Error.InvalidArguments diff --git a/doc/pics-opp.txt b/doc/pics-opp.txt old mode 100644 new mode 100755 diff --git a/doc/pixit-opp.txt b/doc/pixit-opp.txt old mode 100644 new mode 100755 diff --git a/doc/profile-api.txt b/doc/profile-api.txt old mode 100644 new mode 100755 index 60eee2b..ec18034 --- a/doc/profile-api.txt +++ b/doc/profile-api.txt @@ -91,100 +91,7 @@ Object path /org/bluez Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.AlreadyExists -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - void RegisterProfile2(object profile, string uuid, string destination, - string path,dict options) - This registers a profile implementation. - - If an application disconects/exits, its registered profile - will not be removed and bluez launches an application through - dbus activation when profile is connected. - - HFP HS UUID: 0000111e-0000-1000-8000-00805f9b34fb - - Default RFCOMM channel is 6. And this requires - authentication. - - string Destination - - Application bus name - - string Path - - Applicatoin path name - - Available options: - - string Name - - Human readable name for the profile - - string Service - - The primary service class UUID - (if different from the actual - profile UUID) - - string Role - - For asymmetric profiles that do not - have UUIDs available to uniquely - identify each side this - parameter allows specifying the - precise local role. - - Possible values: "client", "server" - - uint16 Channel - - RFCOMM channel number that is used - for client and server UUIDs. - - If applicable it will be used in the - SDP record as well. - - uint16 PSM - - PSM number that is used for client - and server UUIDs. - - If applicable it will be used in the - SDP record as well. - - boolean RequireAuthentication - - Pairing is required before connections - will be established. No devices will - be connected if not paired. - - boolean RequireAuthorization - - Request authorization before any - connection will be established. - - boolean AutoConnect - - In case of a client UUID this will - force connection of the RFCOMM or - L2CAP channels when a remote device - is connected. - - string ServiceRecord - - Provide a manual SDP record. - - uint16 Version - - Profile version (for SDP record) - - uint16 Features - - Profile features (for SDP record) - - Possible errors: org.bluez.Error.InvalidArguments - org.bluez.Error.AlreadyExists -#endif void UnregisterProfile(object profile) This unregisters the profile that has been previously diff --git a/doc/proximity-api.txt b/doc/proximity-api.txt old mode 100644 new mode 100755 diff --git a/doc/pts-opp.txt b/doc/pts-opp.txt old mode 100644 new mode 100755 diff --git a/doc/sap-api.txt b/doc/sap-api.txt old mode 100644 new mode 100755 diff --git a/doc/settings-storage.txt b/doc/settings-storage.txt old mode 100644 new mode 100755 index 5b7bb1f..6a708b4 --- a/doc/settings-storage.txt +++ b/doc/settings-storage.txt @@ -81,23 +81,24 @@ Settings file contains one [General] group with adapter info like: 0 = disable timer, i.e. stay discoverable forever -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - LocalIrk String Identity resolving key for local - adapter. This key value is used to - generate the RPA to suport privacy feature. - If value is NULL, i.e IRK to be generated - for this adapter. -#endif - Sample: [General] Name=My PC Discoverable=false Pairable=true DiscoverableTimeout=0 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - LocalIrk="" -#endif + + +Identity file format +==================== +Identity file contains one [General] group that holds identity information +such as keys and adresses: + + IdentityResolvingKey String 128-bit value of the IRK + +Sample: + [General] + IdentityResolvingKey=00112233445566778899aabbccddeeff Attributes file format @@ -186,6 +187,7 @@ how to interpret rest of value: 2803:value_handle:properties:uuid Descriptor: + value:uuid uuid Sample Attributes section: @@ -292,13 +294,3 @@ Long term key) related to a remote device. Counter Integer Signing counter Authenticated Boolean True if the key is authenticated - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -[IdentityResolvingKey] group contains: - - Key String Identity Resolving key in hexadecimal format - - IdentityAddress String Identity Address of the device - - IdentityAddressType String Type of Identity Address of the device -#endif diff --git a/doc/supported-features.txt b/doc/supported-features.txt old mode 100644 new mode 100755 index 33685d5..f04cf4a --- a/doc/supported-features.txt +++ b/doc/supported-features.txt @@ -14,7 +14,7 @@ SDP 4.2 Server, Client GATT 4.2 Server, Client SDAP 1.1 Server, Client RFCOMM 1.1 Server, Client -SPP 1.1 Server, Client +SPP 1.2 Server, Client PXP 1.0 Reporter, Monitor HOGP 1.0 Host diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt old mode 100644 new mode 100755 index 5612ff0..741492a --- a/doc/test-coverage.txt +++ b/doc/test-coverage.txt @@ -13,7 +13,7 @@ test-lib 14 SDP library functions test-sdp 133 SDP qualification test cases test-uuid 30 UUID conversion handling test-mgmt 9 Management interface handling -test-crypto 4 Cryptographic toolbox helpers +test-crypto 5 Cryptographic toolbox helpers test-textfile 4 Old textfile storage format test-ringbuf 3 Ring buffer functionality test-queue 6 Queue handling functionality @@ -39,7 +39,7 @@ Automated end-to-end testing Application Count Description ------------------------------------------- -mgmt-tester 305 Kernel management interface testing +mgmt-tester 331 Kernel management interface testing l2cap-tester 33 Kernel L2CAP implementation testing rfcomm-tester 9 Kernel RFCOMM implementation testing bnep-tester 1 Kernel BNEP implementation testing @@ -49,7 +49,7 @@ gap-tester 1 Daemon D-Bus API testing hci-tester 14 Controller hardware testing userchan-tester 3 Kernel HCI User Channel testting ----- - 382 + 408 Android end-to-end testing diff --git a/doc/test-runner.txt b/doc/test-runner.txt old mode 100644 new mode 100755 diff --git a/doc/thermometer-api.txt b/doc/thermometer-api.txt old mode 100644 new mode 100755 diff --git a/emulator/amp.c b/emulator/amp.c old mode 100644 new mode 100755 diff --git a/emulator/amp.h b/emulator/amp.h old mode 100644 new mode 100755 diff --git a/emulator/b1ee.c b/emulator/b1ee.c old mode 100644 new mode 100755 diff --git a/emulator/btdev.c b/emulator/btdev.c old mode 100644 new mode 100755 index 38769d8..1e94fc3 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -3098,6 +3098,7 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, } cmd_status(btdev, BT_HCI_ERR_SUCCESS, BT_HCI_CMD_LE_GENERATE_DHKEY); + dh_evt.status = BT_HCI_ERR_SUCCESS; le_meta_event(btdev, BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE, &dh_evt, sizeof(dh_evt)); break; diff --git a/emulator/btdev.h b/emulator/btdev.h old mode 100644 new mode 100755 diff --git a/emulator/bthost.c b/emulator/bthost.c old mode 100644 new mode 100755 index 3638fe4..2bcdc31 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -2329,6 +2329,11 @@ void bthost_write_le_host_supported(struct bthost *bthost, uint8_t mode) &cmd, sizeof(cmd)); } +bool bthost_bredr_capable(struct bthost *bthost) +{ + return lmp_bredr_capable(bthost); +} + void bthost_request_auth(struct bthost *bthost, uint16_t handle) { struct btconn *conn; diff --git a/emulator/bthost.h b/emulator/bthost.h old mode 100644 new mode 100755 index 7110db8..553865a --- a/emulator/bthost.h +++ b/emulator/bthost.h @@ -108,6 +108,8 @@ uint8_t bthost_get_auth_req(struct bthost *bthost); void bthost_set_reject_user_confirm(struct bthost *bthost, bool reject); bool bthost_get_reject_user_confirm(struct bthost *bthost); +bool bthost_bredr_capable(struct bthost *bthost); + uint64_t bthost_conn_get_fixed_chan(struct bthost *bthost, uint16_t handle); typedef void (*bthost_rfcomm_connect_cb) (uint16_t handle, uint16_t cid, diff --git a/emulator/hciemu.c b/emulator/hciemu.c old mode 100644 new mode 100755 index 6a53499..7debb8f --- a/emulator/hciemu.c +++ b/emulator/hciemu.c @@ -243,7 +243,8 @@ static bool create_vhci(struct hciemu *hciemu) } create_req[0] = HCI_VENDOR_PKT; - create_req[1] = HCI_BREDR; + create_req[1] = HCI_PRIMARY; + written = write(fd, create_req, sizeof(create_req)); if (written < 0) { close(fd); @@ -466,6 +467,16 @@ bool hciemu_add_master_post_command_hook(struct hciemu *hciemu, return true; } +bool hciemu_clear_master_post_command_hooks(struct hciemu *hciemu) +{ + if (!hciemu) + return false; + + queue_remove_all(hciemu->post_command_hooks, + NULL, NULL, destroy_command_hook); + return true; +} + int hciemu_add_hook(struct hciemu *hciemu, enum hciemu_hook_type type, uint16_t opcode, hciemu_hook_func_t function, void *user_data) diff --git a/emulator/hciemu.h b/emulator/hciemu.h old mode 100644 new mode 100755 index c5578d1..783f99c --- a/emulator/hciemu.h +++ b/emulator/hciemu.h @@ -66,6 +66,8 @@ typedef bool (*hciemu_hook_func_t)(const void *data, uint16_t len, bool hciemu_add_master_post_command_hook(struct hciemu *hciemu, hciemu_command_func_t function, void *user_data); +bool hciemu_clear_master_post_command_hooks(struct hciemu *hciemu); + int hciemu_add_hook(struct hciemu *hciemu, enum hciemu_hook_type type, uint16_t opcode, hciemu_hook_func_t function, void *user_data); diff --git a/emulator/hfp.c b/emulator/hfp.c old mode 100644 new mode 100755 diff --git a/emulator/le.c b/emulator/le.c old mode 100644 new mode 100755 index 82ae573..d7ee297 --- a/emulator/le.c +++ b/emulator/le.c @@ -1881,7 +1881,7 @@ struct bt_le *bt_le_new(void) } setup_cmd[0] = HCI_VENDOR_PKT; - setup_cmd[1] = HCI_BREDR; + setup_cmd[1] = HCI_PRIMARY; if (write(hci->vhci_fd, setup_cmd, sizeof(setup_cmd)) < 0) { close(hci->vhci_fd); diff --git a/emulator/le.h b/emulator/le.h old mode 100644 new mode 100755 diff --git a/emulator/main.c b/emulator/main.c old mode 100644 new mode 100755 diff --git a/emulator/phy.c b/emulator/phy.c old mode 100644 new mode 100755 diff --git a/emulator/phy.h b/emulator/phy.h old mode 100644 new mode 100755 diff --git a/emulator/serial.c b/emulator/serial.c old mode 100644 new mode 100755 diff --git a/emulator/serial.h b/emulator/serial.h old mode 100644 new mode 100755 diff --git a/emulator/server.c b/emulator/server.c old mode 100644 new mode 100755 diff --git a/emulator/server.h b/emulator/server.h old mode 100644 new mode 100755 diff --git a/emulator/smp.c b/emulator/smp.c old mode 100644 new mode 100755 index e941141..c30de36 --- a/emulator/smp.c +++ b/emulator/smp.c @@ -68,8 +68,6 @@ #define DIST_SIGN 0x04 #define DIST_LINK_KEY 0x08 -#define KEY_DIST (DIST_ENC_KEY | DIST_ID_KEY | DIST_SIGN) - #define SC_NO_DIST (DIST_ENC_KEY | DIST_LINK_KEY) #define MAX_IO_CAP 0x04 @@ -193,6 +191,14 @@ static uint8_t sc_select_method(struct smp_conn *conn) return method; } +static uint8_t key_dist(struct bthost *host) +{ + if (!bthost_bredr_capable(host)) + return (DIST_ENC_KEY | DIST_ID_KEY | DIST_SIGN); + + return (DIST_ENC_KEY | DIST_ID_KEY | DIST_SIGN | DIST_LINK_KEY); +} + static void smp_send(struct smp_conn *conn, uint8_t smp_cmd, const void *data, uint8_t len) { @@ -364,7 +370,7 @@ static bool verify_random(struct smp_conn *conn, const uint8_t rnd[16]) conn->ra_type, conn->ra, confirm)) return false; - if (memcmp(conn->pcnf, confirm, sizeof(conn->pcnf) != 0)) { + if (memcmp(conn->pcnf, confirm, sizeof(conn->pcnf)) != 0) { printf("Confirmation values don't match\n"); return false; } @@ -433,8 +439,8 @@ static void pairing_req(struct smp_conn *conn, const void *data, uint16_t len) } rsp.max_key_size = 0x10; - rsp.init_key_dist = conn->preq[5] & KEY_DIST; - rsp.resp_key_dist = conn->preq[6] & KEY_DIST; + rsp.init_key_dist = conn->preq[5] & key_dist(bthost); + rsp.resp_key_dist = conn->preq[6] & key_dist(bthost); conn->prsp[0] = BT_L2CAP_SMP_PAIRING_RESPONSE; memcpy(&conn->prsp[1], &rsp, sizeof(rsp)); @@ -691,8 +697,8 @@ void smp_pair(void *conn_data, uint8_t io_cap, uint8_t auth_req) req.oob_data = 0x00; req.auth_req = auth_req; req.max_key_size = 0x10; - req.init_key_dist = KEY_DIST; - req.resp_key_dist = KEY_DIST; + req.init_key_dist = key_dist(conn->smp->bthost); + req.resp_key_dist = key_dist(conn->smp->bthost); conn->preq[0] = BT_L2CAP_SMP_PAIRING_REQUEST; memcpy(&conn->preq[1], &req, sizeof(req)); @@ -818,8 +824,8 @@ static void smp_conn_bredr(struct smp_conn *conn, uint8_t encrypt) memset(&req, 0, sizeof(req)); req.max_key_size = 0x10; - req.init_key_dist = KEY_DIST; - req.resp_key_dist = KEY_DIST; + req.init_key_dist = key_dist(smp->bthost); + req.resp_key_dist = key_dist(smp->bthost); smp_send(conn, BT_L2CAP_SMP_PAIRING_REQUEST, &req, sizeof(req)); } diff --git a/emulator/vhci.c b/emulator/vhci.c old mode 100644 new mode 100755 index 6bba4e2..8dec20a --- a/emulator/vhci.c +++ b/emulator/vhci.c @@ -105,15 +105,15 @@ struct vhci *vhci_open(enum vhci_type type) switch (type) { case VHCI_TYPE_BREDRLE: btdev_type = BTDEV_TYPE_BREDRLE; - ctrl_type = HCI_BREDR; + ctrl_type = HCI_PRIMARY; break; case VHCI_TYPE_BREDR: btdev_type = BTDEV_TYPE_BREDR; - ctrl_type = HCI_BREDR; + ctrl_type = HCI_PRIMARY; break; case VHCI_TYPE_LE: btdev_type = BTDEV_TYPE_LE; - ctrl_type = HCI_BREDR; + ctrl_type = HCI_PRIMARY; break; case VHCI_TYPE_AMP: btdev_type = BTDEV_TYPE_AMP; diff --git a/emulator/vhci.h b/emulator/vhci.h old mode 100644 new mode 100755 diff --git a/gdbus/client.c b/gdbus/client.c old mode 100644 new mode 100755 diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h old mode 100644 new mode 100755 index b58c486..e37385f --- a/gdbus/gdbus.h +++ b/gdbus/gdbus.h @@ -277,12 +277,6 @@ gboolean g_dbus_emit_signal_valist(DBusConnection *connection, const char *path, const char *interface, const char *name, int type, va_list args); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -gboolean g_dbus_emit_signal_to_dest(DBusConnection *connection, - const char *dest, const char *path, - const char *interface, const char *name, int type, ...); -#endif - guint g_dbus_add_service_watch(DBusConnection *connection, const char *name, GDBusWatchFunction connect, GDBusWatchFunction disconnect, @@ -308,6 +302,15 @@ void g_dbus_pending_property_error_valist(GDBusPendingReply id, const char *name, const char *format, va_list args); void g_dbus_pending_property_error(GDBusPendingReply id, const char *name, const char *format, ...); + +/* + * Note that when multiple properties for a given object path are changed + * in the same mainloop iteration, they will be grouped with the last + * property changed. If this behaviour is undesired, use + * g_dbus_emit_property_changed_full() with the + * G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH flag, causing the signal to ignore + * any grouping. + */ void g_dbus_emit_property_changed(DBusConnection *connection, const char *path, const char *interface, const char *name); diff --git a/gdbus/mainloop.c b/gdbus/mainloop.c old mode 100644 new mode 100755 diff --git a/gdbus/object.c b/gdbus/object.c old mode 100644 new mode 100755 index cbda9a6..afb4587 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -33,24 +33,7 @@ #include "gdbus.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#if 0 -#include -static void gdbus_dbg(const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - - vsyslog(LOG_DEBUG, format, ap); - - va_end(ap); -} -#endif -#else #define info(fmt...) -#endif - #define error(fmt...) #define debug(fmt...) @@ -105,12 +88,6 @@ static int global_flags = 0; static struct generic_data *root; static GSList *pending = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define ADAPTER_INTERFACE "org.bluez.Adapter1" - -static char *adapter_path = NULL; -#endif - static gboolean process_changes(gpointer user_data); static void process_properties_from_interface(struct generic_data *data, struct interface_data *iface); @@ -658,11 +635,19 @@ static gboolean g_dbus_args_have_signature(const GDBusArgInfo *args, static void add_pending(struct generic_data *data) { - if (data->process_id > 0) - return; + guint old_id = data->process_id; data->process_id = g_idle_add(process_changes, data); + if (old_id > 0) { + /* + * If the element already had an old idler, remove the old one, + * no need to re-add it to the pending list. + */ + g_source_remove(old_id); + return; + } + pending = g_slist_append(pending, data); } @@ -678,13 +663,6 @@ static gboolean remove_interface(struct generic_data *data, const char *name) data->interfaces = g_slist_remove(data->interfaces, iface); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (g_strcmp0(iface->name, ADAPTER_INTERFACE) == 0) { - g_free(adapter_path); - adapter_path = NULL; - } -#endif - if (iface->destroy) { iface->destroy(iface->user_data); iface->user_data = NULL; @@ -1097,12 +1075,7 @@ static DBusHandlerResult generic_message(DBusConnection *connection, if (check_privilege(connection, message, method, iface->user_data) == TRUE) return DBUS_HANDLER_RESULT_HANDLED; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#if 0 - gdbus_dbg("%s: %s.%s()", dbus_message_get_path(message), - iface->name, method->name); -#endif -#endif + return process_message(connection, message, method, iface->user_data); } @@ -1192,36 +1165,9 @@ static DBusMessage *get_objects(DBusConnection *connection, return reply; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *default_adapter(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - DBusMessage *reply; - - if (!adapter_path) - return g_dbus_create_error(msg, - "org.bluez.Error" ".NoSuchAdapter", - "No such adapter"); - - reply = dbus_message_new_method_return(msg); - if (!reply) - return NULL; - - dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &adapter_path, - DBUS_TYPE_INVALID); - - return reply; -} -#endif - static const GDBusMethodTable manager_methods[] = { { GDBUS_METHOD("GetManagedObjects", NULL, GDBUS_ARGS({ "objects", "a{oa{sa{sv}}}" }), get_objects) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_METHOD("DefaultAdapter", - NULL, GDBUS_ARGS({ "adapter", "o" }), - default_adapter) }, -#endif { } }; @@ -1409,11 +1355,6 @@ gboolean g_dbus_register_interface(DBusConnection *connection, return FALSE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (g_strcmp0(name, ADAPTER_INTERFACE) == 0) - adapter_path = g_strdup(path); -#endif - if (!add_interface(data, name, methods, signals, properties, user_data, destroy)) { object_path_unref(connection, path); @@ -1674,65 +1615,6 @@ gboolean g_dbus_emit_signal(DBusConnection *connection, return result; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean g_dbus_emit_signal_valist_to_dest(DBusConnection *connection, - const char *dest, const char *path, const char *interface, - const char *name, int type, va_list args) -{ - DBusMessage *signal; - dbus_bool_t ret; - const GDBusArgInfo *args_info; - - if (!check_signal(connection, path, interface, name, &args_info)) - return FALSE; - - signal = dbus_message_new_signal(path, interface, name); - if (signal == NULL) { - error("Unable to allocate new %s.%s signal", interface, name); - return FALSE; - } - - ret = dbus_message_append_args_valist(signal, type, args); - if (!ret) - goto fail; - - if (g_dbus_args_have_signature(args_info, signal) == FALSE) { - error("%s.%s: got unexpected signature '%s'", interface, name, - dbus_message_get_signature(signal)); - ret = FALSE; - goto fail; - } - - ret = dbus_message_set_destination(signal, dest); - if (!ret) - error("Fail to set destination"); - - return g_dbus_send_message(connection, signal); - -fail: - dbus_message_unref(signal); - - return ret; -} - -gboolean g_dbus_emit_signal_to_dest(DBusConnection *connection, - const char *dest, const char *path, - const char *interface, const char *name, int type, ...) -{ - va_list args; - gboolean result; - - va_start(args, type); - - result = g_dbus_emit_signal_valist_to_dest(connection, dest, path, - interface, name, type, args); - - va_end(args); - - return result; -} -#endif - gboolean g_dbus_emit_signal_valist(DBusConnection *connection, const char *path, const char *interface, const char *name, int type, va_list args) diff --git a/gdbus/polkit.c b/gdbus/polkit.c old mode 100644 new mode 100755 diff --git a/gdbus/watch.c b/gdbus/watch.c old mode 100644 new mode 100755 diff --git a/gobex/gobex-apparam.c b/gobex/gobex-apparam.c old mode 100644 new mode 100755 index 6f7a952..4328172 --- a/gobex/gobex-apparam.c +++ b/gobex/gobex-apparam.c @@ -104,10 +104,8 @@ GObexApparam *g_obex_apparam_decode(const void *data, gsize size) GHashTable *tags; gsize count = 0; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (size < 2) return NULL; -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ apparam = g_obex_apparam_new(); @@ -168,13 +166,6 @@ gssize g_obex_apparam_encode(GObexApparam *apparam, void *buf, gsize len) return count; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void g_obex_apparam_remove_all(GObexApparam *apparam) -{ - g_hash_table_remove_all(apparam->tags); -} -#endif - GObexApparam *g_obex_apparam_set_bytes(GObexApparam *apparam, guint8 id, const void *value, gsize len) { diff --git a/gobex/gobex-apparam.h b/gobex/gobex-apparam.h old mode 100644 new mode 100755 index 701fd43..6c08609 --- a/gobex/gobex-apparam.h +++ b/gobex/gobex-apparam.h @@ -30,10 +30,6 @@ typedef struct _GObexApparam GObexApparam; GObexApparam *g_obex_apparam_decode(const void *data, gsize size); gssize g_obex_apparam_encode(GObexApparam *apparam, void *buf, gsize size); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void g_obex_apparam_remove_all(GObexApparam *apparam); -#endif - GObexApparam *g_obex_apparam_set_bytes(GObexApparam *apparam, guint8 id, const void *value, gsize size); GObexApparam *g_obex_apparam_set_uint8(GObexApparam *apparam, guint8 id, diff --git a/gobex/gobex-debug.h b/gobex/gobex-debug.h old mode 100644 new mode 100755 diff --git a/gobex/gobex-defs.c b/gobex/gobex-defs.c old mode 100644 new mode 100755 diff --git a/gobex/gobex-defs.h b/gobex/gobex-defs.h old mode 100644 new mode 100755 diff --git a/gobex/gobex-header.c b/gobex/gobex-header.c old mode 100644 new mode 100755 index c6634c7..c594999 --- a/gobex/gobex-header.c +++ b/gobex/gobex-header.c @@ -389,11 +389,6 @@ GObexHeader *g_obex_header_new_unicode(guint8 id, const char *str) GObexHeader *header; gsize len; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gunichar2 *utf16; - glong utf16_len; -#endif - g_obex_debug(G_OBEX_DEBUG_HEADER, "header 0x%02x", G_OBEX_HDR_ENC(id)); if (G_OBEX_HDR_ENC(id) != G_OBEX_HDR_ENC_UNICODE) @@ -406,15 +401,9 @@ GObexHeader *g_obex_header_new_unicode(guint8 id, const char *str) len = g_utf8_strlen(str, -1); header->vlen = len; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY header->hlen = len == 0 ? 3 : 3 + ((len + 1) * 2); header->v.string = g_strdup(str); -#else - header->v.string = g_strdup(str); - utf16_len = utf8_to_utf16(&utf16, header->v.string); - header->hlen = len == 0 ? 3 : 3 + utf16_len; - g_free(utf16); -#endif + g_obex_debug(G_OBEX_DEBUG_HEADER, "%s", header->v.string); return header; diff --git a/gobex/gobex-header.h b/gobex/gobex-header.h old mode 100644 new mode 100755 diff --git a/gobex/gobex-packet.c b/gobex/gobex-packet.c old mode 100644 new mode 100755 diff --git a/gobex/gobex-packet.h b/gobex/gobex-packet.h old mode 100644 new mode 100755 diff --git a/gobex/gobex-transfer.c b/gobex/gobex-transfer.c old mode 100644 new mode 100755 diff --git a/gobex/gobex.c b/gobex/gobex.c old mode 100644 new mode 100755 index 61ddc66..42175fc --- a/gobex/gobex.c +++ b/gobex/gobex.c @@ -571,12 +571,7 @@ static guint8 *digest_response(const guint8 *nonce) return result; g_checksum_update(md5, nonce, NONCE_LEN); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_checksum_update(md5, (guint8 *) ":0000", 5); -#else g_checksum_update(md5, (guint8 *) ":BlueZ", 6); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - size = NONCE_LEN; g_checksum_get_digest(md5, result, &size); diff --git a/gobex/gobex.h b/gobex/gobex.h old mode 100644 new mode 100755 diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..756420d --- /dev/null +++ b/install-sh @@ -0,0 +1,534 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/a2mp.h b/lib/a2mp.h old mode 100644 new mode 100755 diff --git a/lib/amp.h b/lib/amp.h old mode 100644 new mode 100755 diff --git a/lib/bluetooth.c b/lib/bluetooth.c old mode 100644 new mode 100755 index 4a569c0..3276b68 --- a/lib/bluetooth.c +++ b/lib/bluetooth.c @@ -360,7 +360,7 @@ const char *bt_compidtostr(int compid) case 48: return "ST Microelectronics"; case 49: - return "Synopsis"; + return "Synopsys, Inc."; case 50: return "Red-M (Communications) Ltd"; case 51: @@ -540,7 +540,7 @@ const char *bt_compidtostr(int compid) case 138: return "Jawbone"; case 139: - return "Topcorn Positioning Systems, LLC"; + return "Topcon Positioning Systems, LLC"; case 140: return "Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)"; case 141: @@ -548,7 +548,7 @@ const char *bt_compidtostr(int compid) case 142: return "Quintic Corp."; case 143: - return "Stollman E+V GmbH"; + return "Telit Wireless Solutions GmbH (Formerly Stollman E+V GmbH)"; case 144: return "Funai Electric Co., Ltd."; case 145: @@ -836,7 +836,7 @@ const char *bt_compidtostr(int compid) case 286: return "Skoda Auto a.s."; case 287: - return "Volkswagon AG"; + return "Volkswagen AG"; case 288: return "Porsche AG"; case 289: @@ -998,7 +998,7 @@ const char *bt_compidtostr(int compid) case 367: return "Podo Labs, Inc"; case 368: - return "Roche Diabetes Care AG"; + return "F. Hoffmann-La Roche AG"; case 369: return "Amazon Fulfillment Service"; case 370: @@ -1078,7 +1078,7 @@ const char *bt_compidtostr(int compid) case 407: return "WiSilica Inc"; case 408: - return "Vengit Limited"; + return "VENGIT Korlátolt Felelősségű Társaság"; case 409: return "SALTO SYSTEMS S.L."; case 410: @@ -1745,6 +1745,598 @@ const char *bt_compidtostr(int compid) return "Bytestorm Ltd."; case 741: return "Espressif Incorporated ( 乐鑫信息科技(上海)有限公司 )"; + case 742: + return "Unwire"; + case 743: + return "Connected Yard, Inc."; + case 744: + return "American Music Environments"; + case 745: + return "Sensogram Technologies, Inc."; + case 746: + return "Fujitsu Limited"; + case 747: + return "Ardic Technology"; + case 748: + return "Delta Systems, Inc"; + case 749: + return "HTC Corporation"; + case 750: + return "Citizen Holdings Co., Ltd."; + case 751: + return "SMART-INNOVATION.inc"; + case 752: + return "Blackrat Software"; + case 753: + return "The Idea Cave, LLC"; + case 754: + return "GoPro, Inc."; + case 755: + return "AuthAir, Inc"; + case 756: + return "Vensi, Inc."; + case 757: + return "Indagem Tech LLC"; + case 758: + return "Intemo Technologies"; + case 759: + return "DreamVisions co., Ltd."; + case 760: + return "Runteq Oy Ltd"; + case 761: + return "IMAGINATION TECHNOLOGIES LTD"; + case 762: + return "CoSTAR Technologies"; + case 763: + return "Clarius Mobile Health Corp."; + case 764: + return "Shanghai Frequen Microelectronics Co., Ltd."; + case 765: + return "Uwanna, Inc."; + case 766: + return "Lierda Science & Technology Group Co., Ltd."; + case 767: + return "Silicon Laboratories"; + case 768: + return "World Moto Inc."; + case 769: + return "Giatec Scientific Inc."; + case 770: + return "Loop Devices, Inc"; + case 771: + return "IACA electronique"; + case 772: + return "Martians Inc"; + case 773: + return "Swipp ApS"; + case 774: + return "Life Laboratory Inc."; + case 775: + return "FUJI INDUSTRIAL CO.,LTD."; + case 776: + return "Surefire, LLC"; + case 777: + return "Dolby Labs"; + case 778: + return "Ellisys"; + case 779: + return "Magnitude Lighting Converters"; + case 780: + return "Hilti AG"; + case 781: + return "Devdata S.r.l."; + case 782: + return "Deviceworx"; + case 783: + return "Shortcut Labs"; + case 784: + return "SGL Italia S.r.l."; + case 785: + return "PEEQ DATA"; + case 786: + return "Ducere Technologies Pvt Ltd"; + case 787: + return "DiveNav, Inc."; + case 788: + return "RIIG AI Sp. z o.o."; + case 789: + return "Thermo Fisher Scientific"; + case 790: + return "AG Measurematics Pvt. Ltd."; + case 791: + return "CHUO Electronics CO., LTD."; + case 792: + return "Aspenta International"; + case 793: + return "Eugster Frismag AG"; + case 794: + return "Amber wireless GmbH"; + case 795: + return "HQ Inc"; + case 796: + return "Lab Sensor Solutions"; + case 797: + return "Enterlab ApS"; + case 798: + return "Eyefi, Inc."; + case 799: + return "MetaSystem S.p.A"; + case 800: + return "SONO ELECTRONICS. CO., LTD"; + case 801: + return "Jewelbots"; + case 802: + return "Compumedics Limited"; + case 803: + return "Rotor Bike Components"; + case 804: + return "Astro, Inc."; + case 805: + return "Amotus Solutions"; + case 806: + return "Healthwear Technologies (Changzhou)Ltd"; + case 807: + return "Essex Electronics"; + case 808: + return "Grundfos A/S"; + case 809: + return "Eargo, Inc."; + case 810: + return "Electronic Design Lab"; + case 811: + return "ESYLUX"; + case 812: + return "NIPPON SMT.CO.,Ltd"; + case 813: + return "BM innovations GmbH"; + case 814: + return "indoormap"; + case 815: + return "OttoQ Inc"; + case 816: + return "North Pole Engineering"; + case 817: + return "3flares Technologies Inc."; + case 818: + return "Electrocompaniet A.S."; + case 819: + return "Mul-T-Lock"; + case 820: + return "Corentium AS"; + case 821: + return "Enlighted Inc"; + case 822: + return "GISTIC"; + case 823: + return "AJP2 Holdings, LLC"; + case 824: + return "COBI GmbH"; + case 825: + return "Blue Sky Scientific, LLC"; + case 826: + return "Appception, Inc."; + case 827: + return "Courtney Thorne Limited"; + case 828: + return "Virtuosys"; + case 829: + return "TPV Technology Limited"; + case 830: + return "Monitra SA"; + case 831: + return "Automation Components, Inc."; + case 832: + return "Letsense s.r.l."; + case 833: + return "Etesian Technologies LLC"; + case 834: + return "GERTEC BRASIL LTDA."; + case 835: + return "Drekker Development Pty. Ltd."; + case 836: + return "Whirl Inc"; + case 837: + return "Locus Positioning"; + case 838: + return "Acuity Brands Lighting, Inc"; + case 839: + return "Prevent Biometrics"; + case 840: + return "Arioneo"; + case 841: + return "VersaMe"; + case 842: + return "Vaddio"; + case 843: + return "Libratone A/S"; + case 844: + return "HM Electronics, Inc."; + case 845: + return "TASER International, Inc."; + case 846: + return "Safe Trust Inc."; + case 847: + return "Heartland Payment Systems"; + case 848: + return "Bitstrata Systems Inc."; + case 849: + return "Pieps GmbH"; + case 850: + return "iRiding(Xiamen)Technology Co.,Ltd."; + case 851: + return "Alpha Audiotronics, Inc."; + case 852: + return "TOPPAN FORMS CO.,LTD."; + case 853: + return "Sigma Designs, Inc."; + case 854: + return "Spectrum Brands, Inc."; + case 855: + return "Polymap Wireless"; + case 856: + return "MagniWare Ltd."; + case 857: + return "Novotec Medical GmbH"; + case 858: + return "Medicom Innovation Partner a/s"; + case 859: + return "Matrix Inc."; + case 860: + return "Eaton Corporation"; + case 861: + return "KYS"; + case 862: + return "Naya Health, Inc."; + case 863: + return "Acromag"; + case 864: + return "Insulet Corporation"; + case 865: + return "Wellinks Inc."; + case 866: + return "ON Semiconductor"; + case 867: + return "FREELAP SA"; + case 868: + return "Favero Electronics Srl"; + case 869: + return "BioMech Sensor LLC"; + case 870: + return "BOLTT Sports technologies Private limited"; + case 871: + return "Saphe International"; + case 872: + return "Metormote AB"; + case 873: + return "littleBits"; + case 874: + return "SetPoint Medical"; + case 875: + return "BRControls Products BV"; + case 876: + return "Zipcar"; + case 877: + return "AirBolt Pty Ltd"; + case 878: + return "KeepTruckin Inc"; + case 879: + return "Motiv, Inc."; + case 880: + return "Wazombi Labs OÜ"; + case 881: + return "ORBCOMM"; + case 882: + return "Nixie Labs, Inc."; + case 883: + return "AppNearMe Ltd"; + case 884: + return "Holman Industries"; + case 885: + return "Expain AS"; + case 886: + return "Electronic Temperature Instruments Ltd"; + case 887: + return "Plejd AB"; + case 888: + return "Propeller Health"; + case 889: + return "Shenzhen iMCO Electronic Technology Co.,Ltd"; + case 890: + return "Algoria"; + case 891: + return "Apption Labs Inc."; + case 892: + return "Cronologics Corporation"; + case 893: + return "MICRODIA Ltd."; + case 894: + return "lulabytes S.L."; + case 895: + return "Nestec S.A."; + case 896: + return "LLC \"MEGA-F service\""; + case 897: + return "Sharp Corporation"; + case 898: + return "Precision Outcomes Ltd"; + case 899: + return "Kronos Incorporated"; + case 900: + return "OCOSMOS Co., Ltd."; + case 901: + return "Embedded Electronic Solutions Ltd. dba e2Solutions"; + case 902: + return "Aterica Inc."; + case 903: + return "BluStor PMC, Inc."; + case 904: + return "Kapsch TrafficCom AB"; + case 905: + return "ActiveBlu Corporation"; + case 906: + return "Kohler Mira Limited"; + case 907: + return "Noke"; + case 908: + return "Appion Inc."; + case 909: + return "Resmed Ltd"; + case 910: + return "Crownstone B.V."; + case 911: + return "Xiaomi Inc."; + case 912: + return "INFOTECH s.r.o."; + case 913: + return "Thingsquare AB"; + case 914: + return "T&D"; + case 915: + return "LAVAZZA S.p.A."; + case 916: + return "Netclearance Systems, Inc."; + case 917: + return "SDATAWAY"; + case 918: + return "BLOKS GmbH"; + case 919: + return "LEGO System A/S"; + case 920: + return "Thetatronics Ltd"; + case 921: + return "Nikon Corporation"; + case 922: + return "NeST"; + case 923: + return "South Silicon Valley Microelectronics"; + case 924: + return "ALE International"; + case 925: + return "CareView Communications, Inc."; + case 926: + return "SchoolBoard Limited"; + case 927: + return "Molex Corporation"; + case 928: + return "IVT Wireless Limited"; + case 929: + return "Alpine Labs LLC"; + case 930: + return "Candura Instruments"; + case 931: + return "SmartMovt Technology Co., Ltd"; + case 932: + return "Token Zero Ltd"; + case 933: + return "ACE CAD Enterprise Co., Ltd. (ACECAD)"; + case 934: + return "Medela, Inc"; + case 935: + return "AeroScout"; + case 936: + return "Esrille Inc."; + case 937: + return "THINKERLY SRL"; + case 938: + return "Exon Sp. z o.o."; + case 939: + return "Meizu Technology Co., Ltd."; + case 940: + return "Smablo LTD"; + case 941: + return "XiQ"; + case 942: + return "Allswell Inc."; + case 943: + return "Comm-N-Sense Corp DBA Verigo"; + case 944: + return "VIBRADORM GmbH"; + case 945: + return "Otodata Wireless Network Inc."; + case 946: + return "Propagation Systems Limited"; + case 947: + return "Midwest Instruments & Controls"; + case 948: + return "Alpha Nodus, inc."; + case 949: + return "petPOMM, Inc"; + case 950: + return "Mattel"; + case 951: + return "Airbly Inc."; + case 952: + return "A-Safe Limited"; + case 953: + return "FREDERIQUE CONSTANT SA"; + case 954: + return "Maxscend Microelectronics Company Limited"; + case 955: + return "Abbott Diabetes Care"; + case 956: + return "ASB Bank Ltd"; + case 957: + return "amadas"; + case 958: + return "Applied Science, Inc."; + case 959: + return "iLumi Solutions Inc."; + case 960: + return "Arch Systems Inc."; + case 961: + return "Ember Technologies, Inc."; + case 962: + return "Snapchat Inc"; + case 963: + return "Casambi Technologies Oy"; + case 964: + return "Pico Technology Inc."; + case 965: + return "St. Jude Medical, Inc."; + case 966: + return "Intricon"; + case 967: + return "Structural Health Systems, Inc."; + case 968: + return "Avvel International"; + case 969: + return "Gallagher Group"; + case 970: + return "In2things Automation Pvt. Ltd."; + case 971: + return "SYSDEV Srl"; + case 972: + return "Vonkil Technologies Ltd"; + case 973: + return "Wynd Technologies, Inc."; + case 974: + return "CONTRINEX S.A."; + case 975: + return "MIRA, Inc."; + case 976: + return "Watteam Ltd"; + case 977: + return "Density Inc."; + case 978: + return "IOT Pot India Private Limited"; + case 979: + return "Sigma Connectivity AB"; + case 980: + return "PEG PEREGO SPA"; + case 981: + return "Wyzelink Systems Inc."; + case 982: + return "Yota Devices LTD"; + case 983: + return "FINSECUR"; + case 984: + return "Zen-Me Labs Ltd"; + case 985: + return "3IWare Co., Ltd."; + case 986: + return "EnOcean GmbH"; + case 987: + return "Instabeat, Inc"; + case 988: + return "Nima Labs"; + case 989: + return "Andreas Stihl AG & Co. KG"; + case 990: + return "Nathan Rhoades LLC"; + case 991: + return "Grob Technologies, LLC"; + case 992: + return "Actions (Zhuhai) Technology Co., Limited"; + case 993: + return "SPD Development Company Ltd"; + case 994: + return "Sensoan Oy"; + case 995: + return "Qualcomm Life Inc"; + case 996: + return "Chip-ing AG"; + case 997: + return "ffly4u"; + case 998: + return "IoT Instruments Oy"; + case 999: + return "TRUE Fitness Technology"; + case 1000: + return "Reiner Kartengeraete GmbH & Co. KG."; + case 1001: + return "SHENZHEN LEMONJOY TECHNOLOGY CO., LTD."; + case 1002: + return "Hello Inc."; + case 1003: + return "Evollve Inc."; + case 1004: + return "Jigowatts Inc."; + case 1005: + return "BASIC MICRO.COM,INC."; + case 1006: + return "CUBE TECHNOLOGIES"; + case 1007: + return "foolography GmbH"; + case 1008: + return "CLINK"; + case 1009: + return "Hestan Smart Cooking Inc."; + case 1010: + return "WindowMaster A/S"; + case 1011: + return "Flowscape AB"; + case 1012: + return "PAL Technologies Ltd"; + case 1013: + return "WHERE, Inc."; + case 1014: + return "Iton Technology Corp."; + case 1015: + return "Owl Labs Inc."; + case 1016: + return "Rockford Corp."; + case 1017: + return "Becon Technologies Co.,Ltd."; + case 1018: + return "Vyassoft Technologies Inc"; + case 1019: + return "Nox Medical"; + case 1020: + return "Kimberly-Clark"; + case 1021: + return "Trimble Navigation Ltd."; + case 1022: + return "Littelfuse"; + case 1023: + return "Withings"; + case 1024: + return "i-developer IT Beratung UG"; + case 1025: + return "リレーションズ株式会社"; + case 1026: + return "Sears Holdings Corporation"; + case 1027: + return "Gantner Electronic GmbH"; + case 1028: + return "Authomate Inc"; + case 1029: + return "Vertex International, Inc."; + case 1030: + return "Airtago"; + case 1031: + return "Swiss Audio SA"; + case 1032: + return "ToGetHome Inc."; + case 1033: + return "AXIS"; + case 1034: + return "Openmatics"; + case 1035: + return "Jana Care Inc."; + case 1036: + return "Senix Corporation"; + case 1037: + return "NorthStar Battery Company, LLC"; case 65535: return "internal use"; default: diff --git a/lib/bluetooth.h b/lib/bluetooth.h old mode 100644 new mode 100755 index 6e198e6..eb27926 --- a/lib/bluetooth.h +++ b/lib/bluetooth.h @@ -69,6 +69,7 @@ struct bt_security { #define BT_SECURITY_LOW 1 #define BT_SECURITY_MEDIUM 2 #define BT_SECURITY_HIGH 3 +#define BT_SECURITY_FIPS 4 #define BT_DEFER_SETUP 7 @@ -119,16 +120,6 @@ struct bt_voice { #define BT_SNDMTU 12 #define BT_RCVMTU 13 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define BT_LE_CONN_PARAM 14 -struct le_conn_param { - uint16_t min; - uint16_t max; - uint16_t latency; - uint16_t to_multiplier; -}; -#endif - #define BT_VOICE_TRANSPARENT 0x0003 #define BT_VOICE_CVSD_16BIT 0x0060 diff --git a/lib/bluez.pc.in b/lib/bluez.pc.in old mode 100644 new mode 100755 diff --git a/lib/bnep.h b/lib/bnep.h old mode 100644 new mode 100755 diff --git a/lib/cmtp.h b/lib/cmtp.h old mode 100644 new mode 100755 diff --git a/lib/hci.c b/lib/hci.c old mode 100644 new mode 100755 index 25fce18..a3f5d96 --- a/lib/hci.c +++ b/lib/hci.c @@ -143,7 +143,7 @@ char *hci_bustostr(int bus) { switch (bus) { case HCI_VIRTUAL: - return "VIRTUAL"; + return "Virtual"; case HCI_USB: return "USB"; case HCI_PCCARD: @@ -156,12 +156,14 @@ char *hci_bustostr(int bus) return "PCI"; case HCI_SDIO: return "SDIO"; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY + case HCI_SPI: + return "SPI"; + case HCI_I2C: + return "I2C"; case HCI_SMD: - return "QC_SMD"; -#endif + return "SMD"; default: - return "UNKNOWN"; + return "Unknown"; } } @@ -173,12 +175,12 @@ char *hci_dtypetostr(int type) char *hci_typetostr(int type) { switch (type) { - case HCI_BREDR: - return "BR/EDR"; + case HCI_PRIMARY: + return "Primary"; case HCI_AMP: return "AMP"; default: - return "UNKNOWN"; + return "Unknown"; } } @@ -592,12 +594,7 @@ static hci_map commands_map[] = { { "LE Receiver Test", 228 }, { "LE Transmitter Test", 229 }, { "LE Test End", 230 }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "LE Read Maximum Data Length", 231 }, - { "Reserved", 232 }, -#else { "Reserved", 231 }, -#endif { NULL } }; @@ -1089,38 +1086,6 @@ int hci_close_dev(int dd) /* HCI functions that require open device * dd - Device descriptor returned by hci_open_dev. */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int hci_send_data(int dd, uint16_t handle, uint8_t len, void *data) -{ - uint8_t type = HCI_ACLDATA_PKT; - hci_acl_hdr ac; - struct iovec iv[3]; - int ivn; - - ac.handle = htobs(handle); - ac.dlen= htobs(len); - - iv[0].iov_base = &type; - iv[0].iov_len = 1; - iv[1].iov_base = ∾ - iv[1].iov_len = HCI_ACL_HDR_SIZE; - ivn = 2; - - if (len) { - iv[2].iov_base = data; - iv[2].iov_len = len; - ivn = 3; - } - - while (writev(dd, iv, ivn) < 0) { - if (errno == EAGAIN || errno == EINTR) - continue; - return -1; - } - return 0; -} -#endif - int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param) { uint8_t type = HCI_COMMAND_PKT; @@ -1639,11 +1604,7 @@ int hci_write_local_name(int dd, const char *name, int to) struct hci_request rq; memset(&cp, 0, sizeof(cp)); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - strncpy((char *) cp.name, name, sizeof(cp.name) - 1); -#else strncpy((char *) cp.name, name, sizeof(cp.name)); -#endif memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; @@ -3158,132 +3119,3 @@ int hci_le_read_remote_features(int dd, uint16_t handle, uint8_t *features, int return 0; } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int hci_le_read_maximum_data_length( - int dd, uint8_t *status, uint16_t *tx_octets, - uint16_t *tx_time, uint16_t *rx_octets, - uint16_t *rx_time, int to) -{ - le_read_maximum_data_length_rp rp; - struct hci_request rq; - - memset(&rq, 0, sizeof(rq)); - memset(&rp, 0, sizeof(rp)); - - rq.ogf = OGF_LE_CTL; - rq.ocf = OCF_LE_READ_MAXIMUM_DATA_LENGTH; - rq.rparam = &rp; - rq.rlen = LE_READ_MAXIMUM_DATA_LENGTH_SIZE; - - if (hci_send_req(dd, &rq, to) < 0) - return -1; - - if (rp.status) { - errno = EIO; - return -1; - } - - *tx_octets = rp.max_tx_octets; - *tx_time = rp.max_tx_time; - *rx_octets = rp.max_rx_octets; - *rx_time = rp.max_rx_time; - *status = rp.status; - return 0; -} - -int hci_le_write_host_suggested_data_length( - int dd, uint16_t *def_tx_octets, - uint16_t *def_tx_time, int to) -{ - le_write_host_suggested_data_length_cp cp; - struct hci_request rq; - uint8_t status; - - memset(&cp, 0, sizeof(cp)); - cp.def_tx_octets = *def_tx_octets; - cp.def_tx_time = *def_tx_time; - - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_LE_CTL; - rq.ocf = OCF_LE_WRITE_HOST_SUGGESTED_DATA_LENGTH; - rq.cparam = &cp; - rq.clen = LE_WRITE_HOST_SUGGESTED_DATA_LENGTH_CP_SIZE; - rq.rparam = &status; - rq.rlen = 1; - - if (hci_send_req(dd, &rq, to) < 0) - return -1; - - if (status) { - errno = EIO; - return -1; - } - - return 0; -} - -int hci_le_read_host_suggested_data_length( - int dd, uint8_t *status, uint16_t *def_tx_octets, - uint16_t *def_tx_time, int to) -{ - le_read_host_suggested_data_length_rp rp; - struct hci_request rq; - - memset(&rp, 0, sizeof(rp)); - memset(&rq, 0, sizeof(rq)); - - rq.ogf = OGF_LE_CTL; - rq.ocf = OCF_LE_READ_HOST_SUGGESTED_DATA_LENGTH; - rq.rparam = &rp; - rq.rlen = LE_READ_HOST_SUGGESTED_DATA_LENGTH_SIZE; - - if (hci_send_req(dd, &rq, to) < 0) - return -1; - - if (rp.status) { - errno = EIO; - return -1; - } - - *def_tx_octets = rp.def_tx_octets; - *def_tx_time = rp.def_tx_time; - *status = rp.status; - return 0; -} - -int hci_le_set_data_length( - int dd, const bdaddr_t *bdaddr, uint16_t *max_tx_octets, - uint16_t *max_tx_time, int to) -{ - le_set_data_length_cp cp; - le_set_data_length_rp rp; - struct hci_request rq; - - memset(&cp, 0, sizeof(cp)); - memset(&rp, 0, sizeof(rp)); - - bacpy(&cp.bdaddr, bdaddr); - cp.max_tx_octets = *max_tx_octets; - cp.max_tx_time = *max_tx_time; - - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_LE_CTL; - rq.ocf = OCF_LE_SET_DATA_LENGTH; - rq.cparam = &cp; - rq.clen = LE_SET_DATA_LENGTH_CP_SIZE; - rq.rparam = &rp; - rq.rlen = LE_SET_DATA_LENGTH_RP_SIZE; - - if (hci_send_req(dd, &rq, to) < 0) - return -1; - - if (rp.status) { - errno = EIO; - return -1; - } - - return 0; -} - -#endif diff --git a/lib/hci.h b/lib/hci.h old mode 100644 new mode 100755 index 311390c..794333b --- a/lib/hci.h +++ b/lib/hci.h @@ -55,14 +55,14 @@ extern "C" { #define HCI_RS232 4 #define HCI_PCI 5 #define HCI_SDIO 6 - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define HCI_SMD 7 -#endif +#define HCI_SPI 7 +#define HCI_I2C 8 +#define HCI_SMD 9 /* HCI controller types */ -#define HCI_BREDR 0x00 +#define HCI_PRIMARY 0x00 #define HCI_AMP 0x01 +#define HCI_BREDR HCI_PRIMARY /* HCI device flags */ enum { @@ -1710,52 +1710,6 @@ typedef struct { } __attribute__ ((packed)) le_test_end_rp; #define LE_TEST_END_RP_SIZE 3 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define OCF_LE_READ_MAXIMUM_DATA_LENGTH 0x002F -typedef struct { - uint8_t status; - uint16_t max_tx_octets; - uint16_t max_tx_time; - uint16_t max_rx_octets; - uint16_t max_rx_time; -} __attribute__ ((packed)) -le_read_maximum_data_length_rp; -#define LE_READ_MAXIMUM_DATA_LENGTH_SIZE 9 - -#define OCF_LE_WRITE_HOST_SUGGESTED_DATA_LENGTH 0x0030 -typedef struct { - uint16_t def_tx_octets; - uint16_t def_tx_time; -} __attribute__ ((packed)) -le_write_host_suggested_data_length_cp; -#define LE_WRITE_HOST_SUGGESTED_DATA_LENGTH_CP_SIZE 4 - -#define OCF_LE_READ_HOST_SUGGESTED_DATA_LENGTH 0x0024 -typedef struct { - uint8_t status; - uint16_t def_tx_octets; - uint16_t def_tx_time; -} __attribute__ ((packed)) -le_read_host_suggested_data_length_rp; -#define LE_READ_HOST_SUGGESTED_DATA_LENGTH_SIZE 5 - -#define OCF_LE_SET_DATA_LENGTH 0x0022 -typedef struct { - bdaddr_t bdaddr; - uint16_t max_tx_octets; - uint16_t max_tx_time; -} __attribute__ ((packed)) -le_set_data_length_cp; -#define LE_SET_DATA_LENGTH_CP_SIZE 10 - -typedef struct { - uint16_t handle; - uint8_t status; -} __attribute__ ((packed)) -le_set_data_length_rp; -#define LE_SET_DATA_LENGTH_RP_SIZE 3 -#endif - #define OCF_LE_ADD_DEVICE_TO_RESOLV_LIST 0x0027 typedef struct { uint8_t bdaddr_type; @@ -1790,17 +1744,6 @@ typedef struct { /* Vendor specific commands */ #define OGF_VENDOR_CMD 0x3f -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define BRCM_QOS_PRIORITY_NORMAL 0x00 -#define BRCM_QOS_PRIORITY_HIGH 0xFF -#define BROADCOM_QOS_CMD 0xFC57 /* Only for bcm4329/bcm4330/bcm4334 chipsets */ -typedef struct { - uint16_t handle; - uint8_t priority; -} __attribute__ ((__packed__)) broadcom_qos_cp; -#define BROADCOM_QOS_CP_SIZE 3 -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - /* ---- HCI Events ---- */ #define EVT_INQUIRY_COMPLETE 0x01 diff --git a/lib/hci_lib.h b/lib/hci_lib.h old mode 100644 new mode 100755 index ff79599..55aeb17 --- a/lib/hci_lib.h +++ b/lib/hci_lib.h @@ -50,9 +50,6 @@ struct hci_version { int hci_open_dev(int dev_id); int hci_close_dev(int dd); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int hci_send_data(int dd, uint16_t handle, uint8_t len, void *data); -#endif int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param); int hci_send_req(int dd, struct hci_request *req, int timeout); @@ -144,18 +141,7 @@ int hci_le_clear_resolving_list(int dd, int to); int hci_le_read_resolving_list_size(int dd, uint8_t *size, int to); int hci_le_set_address_resolution_enable(int dev_id, uint8_t enable, int to); int hci_le_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int hci_le_read_maximum_data_length( - int dd, uint8_t *status, uint16_t *tx_octets, - uint16_t *tx_time, uint16_t *rx_octets, - uint16_t *rx_time, int to ); -int hci_le_write_host_suggested_data_length(int dd, uint16_t *def_tx_octets, - uint16_t *def_tx_time, int to); -int hci_le_read_host_suggested_data_length(int dd, uint8_t *status, - uint16_t *def_tx_octets, uint16_t *def_tx_time, int to); -int hci_le_set_data_length(int dd, const bdaddr_t *bdaddr, - uint16_t *max_tx_octets, uint16_t *max_tx_time, int to); -#endif + int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/lib/hidp.h b/lib/hidp.h old mode 100644 new mode 100755 diff --git a/lib/l2cap.h b/lib/l2cap.h old mode 100644 new mode 100755 index 62b8c33..5ce94c4 --- a/lib/l2cap.h +++ b/lib/l2cap.h @@ -182,18 +182,6 @@ typedef struct { } __attribute__ ((packed)) l2cap_conf_opt; #define L2CAP_CONF_OPT_SIZE 2 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef struct { - uint8_t mode; - uint8_t txwin_size; - uint8_t max_transmit; - uint16_t retrans_timeout; - uint16_t monitor_timeout; - uint16_t max_pdu_size; -} __attribute__ ((packed)) l2cap_conf_rfc ; -#define L2CAP_CONF_RFC_SIZE 9 -#endif - #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 #define L2CAP_CONF_QOS 0x03 diff --git a/lib/mgmt.h b/lib/mgmt.h old mode 100644 new mode 100755 index e92aa3a..798a05e --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -530,6 +530,22 @@ struct mgmt_rp_get_adv_size_info { #define MGMT_OP_START_LIMITED_DISCOVERY 0x0041 +#define MGMT_OP_READ_EXT_INFO 0x0042 +struct mgmt_rp_read_ext_info { + bdaddr_t bdaddr; + uint8_t version; + uint16_t manufacturer; + uint32_t supported_settings; + uint32_t current_settings; + uint16_t eir_len; + uint8_t eir[0]; +} __packed; + +#define MGMT_OP_SET_APPEARANCE 0x0043 +struct mgmt_cp_set_appearance { + uint16_t appearance; +} __packed; + #define MGMT_EV_CMD_COMPLETE 0x0001 struct mgmt_ev_cmd_complete { uint16_t opcode; @@ -742,6 +758,12 @@ struct mgmt_ev_advertising_removed { uint8_t instance; } __packed; +#define MGMT_EV_EXT_INFO_CHANGED 0x0025 +struct mgmt_ev_ext_info_changed { + uint16_t eir_len; + uint8_t eir[0]; +} __packed; + static const char *mgmt_op[] = { "<0x0000>", "Read Version", @@ -809,6 +831,8 @@ static const char *mgmt_op[] = { "Remove Advertising", "Get Advertising Size Information", /* 0x0040 */ "Start Limited Discovery", + "Read Extended Controller Information", + "Set Appearance", }; static const char *mgmt_ev[] = { @@ -849,6 +873,7 @@ static const char *mgmt_ev[] = { "Local Out Of Band Extended Data Updated", "Advertising Added", "Advertising Removed", + "Extended Controller Information Changed", }; static const char *mgmt_status[] = { @@ -875,361 +900,21 @@ static const char *mgmt_status[] = { "Permission Denied", }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - -#define TIZEN_OP_CODE_BASE 0xff00 -#define TIZEN_EV_BASE 0xff00 - -#define MGMT_MAX_ADVERTISING_LENGTH 31 - -#define MGMT_MAX_EIR_MANUFACTURER_DATA_LENGTH 100 - -#define MGMT_IRK_SIZE 16 - -#define MGMT_OP_SET_ADVERTISING_PARAMS (TIZEN_OP_CODE_BASE + 0x01) -struct mgmt_cp_set_advertising_params { - uint16_t interval_min; - uint16_t interval_max; - uint8_t filter_policy; - uint8_t type; -} __packed; - -#define MGMT_OP_SET_ADVERTISING_DATA (TIZEN_OP_CODE_BASE + 0x02) -struct mgmt_cp_set_advertising_data { - uint8_t data[MGMT_MAX_ADVERTISING_LENGTH]; -} __packed; - -#define MGMT_OP_SET_SCAN_RSP_DATA (TIZEN_OP_CODE_BASE + 0x03) -struct mgmt_cp_set_scan_rsp_data { - uint8_t data[MGMT_MAX_ADVERTISING_LENGTH]; -} __packed; - -#define MGMT_OP_ADD_DEV_WHITE_LIST (TIZEN_OP_CODE_BASE + 0x04) -struct mgmt_cp_add_dev_white_list { - uint8_t bdaddr_type; - bdaddr_t bdaddr; -} __packed; - -#define MGMT_OP_REMOVE_DEV_FROM_WHITE_LIST (TIZEN_OP_CODE_BASE + 0x05) -struct mgmt_cp_remove_dev_white_list { - uint8_t bdaddr_type; - bdaddr_t bdaddr; -} __packed; - -#define MGMT_OP_CLEAR_DEV_WHITE_LIST (TIZEN_OP_CODE_BASE + 0x06) - -/* BEGIN TIZEN_Bluetooth :: RSSI monitoring */ -#define MGMT_OP_SET_RSSI_ENABLE (TIZEN_OP_CODE_BASE + 0x07) -struct mgmt_cp_set_enable_rssi { - int8_t low_th; - int8_t in_range_th; - int8_t high_th; - bdaddr_t bdaddr; - int8_t link_type; -} __packed; - -struct mgmt_cc_rsp_enable_rssi { - uint8_t status; - uint8_t le_ext_opcode; - bdaddr_t bt_address; - int8_t link_type; -} __packed; - -#define MGMT_OP_GET_RAW_RSSI (TIZEN_OP_CODE_BASE + 0x08) -struct mgmt_cp_get_raw_rssi { - bdaddr_t bt_address; - uint8_t link_type; -} __packed; -struct mgmt_cc_rp_get_raw_rssi { - uint8_t status; - int8_t rssi_dbm; - uint8_t link_type; - bdaddr_t bt_address; -} __packed; - -#define MGMT_OP_SET_RSSI_DISABLE (TIZEN_OP_CODE_BASE + 0x09) -struct mgmt_cp_disable_rssi { - bdaddr_t bdaddr; - int8_t link_type; -} __packed; -struct mgmt_cc_rp_disable_rssi { - uint8_t status; - uint8_t le_ext_opcode; - bdaddr_t bt_address; - int8_t link_type; -} __packed; -/* END TIZEN_Bluetooth :: RSSI monitoring */ - -#define MGMT_OP_START_LE_DISCOVERY (TIZEN_OP_CODE_BASE + 0x0a) -struct mgmt_cp_start_le_discovery { - uint8_t type; -} __packed; - -#define MGMT_OP_STOP_LE_DISCOVERY (TIZEN_OP_CODE_BASE + 0x0b) -struct mgmt_cp_stop_le_discovery { - uint8_t type; -} __packed; - -#define MGMT_OP_LE_CONN_UPDATE (TIZEN_OP_CODE_BASE + 0x0d) -struct mgmt_cp_le_conn_update { - uint16_t interval_min; - uint16_t interval_max; - uint16_t latency; - uint16_t supervision_time_out; - bdaddr_t bdaddr; -} __packed; - -#define MGMT_OP_SET_MANUFACTURER_DATA (TIZEN_OP_CODE_BASE + 0x0e) -struct mgmt_cp_set_manufacturer_data { - uint8_t data[MGMT_MAX_EIR_MANUFACTURER_DATA_LENGTH]; -} __packed; - -#define MGMT_OP_LE_SET_SCAN_PARAMS (TIZEN_OP_CODE_BASE + 0x0f) -struct mgmt_cp_le_set_scan_params { - uint8_t type; /* le scan type */ - uint16_t interval; - uint16_t window; -} __packed; - -#define MGMT_SCO_ROLE_HANDSFREE 0x00 -#define MGMT_SCO_ROLE_AUDIO_GATEWAY 0x01 -#define MGMT_OP_SET_VOICE_SETTING (TIZEN_OP_CODE_BASE + 0x10) -struct mgmt_cp_set_voice_setting { - bdaddr_t bdaddr; - uint8_t sco_role; - uint16_t voice_setting; -} __packed; - -#define MGMT_OP_GET_ADV_TX_POWER (TIZEN_OP_CODE_BASE + 0x11) -struct mgmt_rp_get_adv_tx_power { - int8_t adv_tx_power; -} __packed; - -#define MGMT_OP_ENABLE_6LOWPAN (TIZEN_OP_CODE_BASE + 0x12) -struct mgmt_cp_enable_6lowpan { - uint8_t enable_6lowpan; -} __packed; - -#define MGMT_OP_CONNECT_6LOWPAN (TIZEN_OP_CODE_BASE + 0x13) -struct mgmt_cp_connect_6lowpan { - struct mgmt_addr_info addr; -} __packed; - -#define MGMT_OP_DISCONNECT_6LOWPAN (TIZEN_OP_CODE_BASE + 0x14) -struct mgmt_cp_disconnect_6lowpan { - struct mgmt_addr_info addr; -} __packed; - -#define MGMT_OP_LE_READ_MAXIMUM_DATA_LENGTH (TIZEN_OP_CODE_BASE + 0x15) -struct mgmt_rp_le_read_maximum_data_length { - uint8_t status; - uint16_t max_tx_octets; - uint16_t max_tx_time; - uint16_t max_rx_octets; - uint16_t max_rx_time; -} __packed; - -#define MGMT_OP_LE_WRITE_HOST_SUGGESTED_DATA_LENGTH (TIZEN_OP_CODE_BASE + 0x16) -struct mgmt_cp_le_write_host_suggested_data_length { - uint16_t def_tx_octets; - uint16_t def_tx_time; -} __packed; - -#define MGMT_OP_LE_READ_HOST_SUGGESTED_DATA_LENGTH (TIZEN_OP_CODE_BASE + 0x17) -struct mgmt_rp_le_read_host_suggested_data_length { - uint8_t status; - uint16_t def_tx_octets; - uint16_t def_tx_time; -} __packed; - -#define MGMT_OP_LE_SET_DATA_LENGTH (TIZEN_OP_CODE_BASE + 0x18) -struct mgmt_cp_le_set_data_length { - bdaddr_t bdaddr; - uint16_t max_tx_octets; - uint16_t max_tx_time; -} __packed; -#define MGMT_LE_SET_DATA_LENGTH_SIZE 10 - -#define MGMT_OP_SET_IRK (TIZEN_OP_CODE_BASE + 0x19) -struct mgmt_cp_set_irk { - uint8_t irk[16]; -} __packed; - -#define MGMT_OP_SET_DEV_RPA_RES_SUPPORT (TIZEN_OP_CODE_BASE + 0x1a) -struct mgmt_cp_set_dev_rpa_res_support { - struct mgmt_addr_info addr; - uint8_t res_support; -} __packed; - -/* BEGIN TIZEN_Bluetooth :: name update changes */ -#define MGMT_EV_DEVICE_NAME_UPDATE (TIZEN_EV_BASE + 0x01) -struct mgmt_ev_device_name_update { - struct mgmt_addr_info addr; - uint16_t eir_len; - uint8_t eir[0]; -} __packed; -/* END TIZEN_Bluetooth :: name update changes */ - -/* BEGIN TIZEN_Bluetooth :: Add handling of hardware error event */ -#define MGMT_EV_HARDWARE_ERROR (TIZEN_EV_BASE + 0x02) -struct mgmt_ev_hardware_error{ - uint8_t error_code; -} __packed; -/* END TIZEN_Bluetooth */ - -/* BEGIN TIZEN_Bluetooth :: HCI TX Timeout Error */ -#define MGMT_EV_TX_TIMEOUT_ERROR (TIZEN_EV_BASE + 0x03) -/* END TIZEN_Bluetooth */ - -/* BEGIN TIZEN_Bluetooth :: Add handling of RSSI Events */ -#define MGMT_EV_RSSI_ALERT (TIZEN_EV_BASE + 0x04) -struct mgmt_ev_vendor_specific_rssi_alert { - bdaddr_t bdaddr; - int8_t link_type; - int8_t alert_type; - int8_t rssi_dbm; -} __packed; - -#define MGMT_EV_RAW_RSSI (TIZEN_EV_BASE + 0x05) - -#define MGMT_EV_RSSI_ENABLED (TIZEN_EV_BASE + 0x06) - -#define MGMT_EV_RSSI_DISABLED (TIZEN_EV_BASE + 0x07) -/* END TIZEN_Bluetooth :: Handling of RSSI Events */ - -/* BEGIN TIZEN_Bluetooth :: Add LE connection update Events */ -#define MGMT_EV_CONN_UPDATED (TIZEN_EV_BASE + 0x08) -struct mgmt_ev_conn_updated { - struct mgmt_addr_info addr; - uint16_t conn_interval; - uint16_t conn_latency; - uint16_t supervision_timeout; -} __packed; - -#define MGMT_EV_CONN_UPDATE_FAILED (TIZEN_EV_BASE + 0x09) -struct mgmt_ev_conn_update_failed { - struct mgmt_addr_info addr; - uint8_t status; -} __packed; -/* END TIZEN_Bluetooth :: Add LE connection update Events */ - -#define MGMT_EV_LE_DEVICE_FOUND (TIZEN_EV_BASE + 0x0a) -struct mgmt_ev_le_device_found { - struct mgmt_addr_info addr; - int8_t rssi; - uint32_t flags; - int8_t adv_type; - uint16_t eir_len; - uint8_t eir[0]; -} __packed; - -#define MGMT_EV_MULTI_ADV_STATE_CHANGED (TIZEN_EV_BASE + 0x0b) -struct mgmt_ev_vendor_specific_multi_adv_state_changed { - uint8_t adv_instance; - uint8_t state_change_reason; - int16_t connection_handle; -} __packed; - -#define MGMT_EV_6LOWPAN_CONN_STATE_CHANGED (TIZEN_EV_BASE + 0x0c) -struct mgmt_ev_6lowpan_conn_state_changed { - struct mgmt_addr_info addr; - uint8_t connected; - uint8_t ifname[16]; -} __packed; - - -#define MGMT_EV_LE_DATA_LENGTH_CHANGED (TIZEN_EV_BASE + 0x0d) -struct mgmt_ev_le_data_length_changed { - struct mgmt_addr_info addr; - int16_t max_tx_octets; - int16_t max_tx_time; - int16_t max_rx_octets; - int16_t max_rx_time; -} __packed; - -static const char *mgmt_tizen_op[] = { - "<0x0000>", - "Set Advertising Parameters", - "Set Advertising Data", - "Set Scan Response Data", - "Add Device White List", - "Remove Device White List", - "Clear Device White List", - "Set RSSI Enable", - "Get Raw RSSI", - "Set RSSI Disable", - "Start LE Discovery", - "Stop LE Discovery", - "Disable LE Auto Connect", - "LE Connection Update", - "Set Manufacturer Data", - "LE Set Scan Parameters", - "Set Voice Setting", - "Get Adv Tx Power", -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - "Enable BT 6LOWPAN", - "Connect BT 6LOWPAN", - "Disconnect BT 6LOWPAN" -#endif -}; - -static const char *mgmt_tizen_ev[] = { - "<0x0000>", - "Device Name Update", - "Hardware Error", - "Tx TimeOut Error", - "RSSI Alert", - "Raw RSSI", - "RSSI Enabled", - "RSSI Disabled", - "LE Connection Updated", - "LE Connection Update Failed", - "LE Device Found", - "Multi Adv State Change", -}; -#endif /* End of TIZEN_FEATURE_BLUEZ_MODIFY */ - #ifndef NELEM #define NELEM(x) (sizeof(x) / sizeof((x)[0])) #endif static inline const char *mgmt_opstr(uint16_t op) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (op >= NELEM(mgmt_op)) { - uint16_t tizen_op = op - TIZEN_OP_CODE_BASE; - - if (tizen_op > 0 && - tizen_op < NELEM(mgmt_tizen_op)) - return mgmt_tizen_op[tizen_op]; - - return ""; - } -#else if (op >= NELEM(mgmt_op)) return ""; -#endif - return mgmt_op[op]; } static inline const char *mgmt_evstr(uint16_t ev) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (ev >= NELEM(mgmt_ev)) { - uint16_t tizen_ev = ev - TIZEN_EV_BASE; - - if (tizen_ev > 0 && - tizen_ev < NELEM(mgmt_tizen_ev)) - return mgmt_tizen_ev[tizen_ev]; - - return ""; - } -#else if (ev >= NELEM(mgmt_ev)) return ""; -#endif - return mgmt_ev[ev]; } diff --git a/lib/rfcomm.h b/lib/rfcomm.h old mode 100644 new mode 100755 diff --git a/lib/sco.h b/lib/sco.h old mode 100644 new mode 100755 diff --git a/lib/sdp.c b/lib/sdp.c old mode 100644 new mode 100755 diff --git a/lib/sdp.h b/lib/sdp.h old mode 100644 new mode 100755 diff --git a/lib/sdp_lib.h b/lib/sdp_lib.h old mode 100644 new mode 100755 diff --git a/lib/uuid.c b/lib/uuid.c old mode 100644 new mode 100755 index ac071fa..d4c7002 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -280,8 +280,11 @@ int bt_uuid_strcmp(const void *a, const void *b) { bt_uuid_t u1, u2; - bt_string_to_uuid(&u1, a); - bt_string_to_uuid(&u2, b); + if (bt_string_to_uuid(&u1, a) < 0) + return -EINVAL; + + if (bt_string_to_uuid(&u2, b) < 0) + return -EINVAL; return bt_uuid_cmp(&u1, &u2); } diff --git a/lib/uuid.h b/lib/uuid.h old mode 100644 new mode 100755 index 393fbe8..2dcfe9e --- a/lib/uuid.h +++ b/lib/uuid.h @@ -30,9 +30,6 @@ extern "C" { #endif #include -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include -#endif #define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805f9b34fb" @@ -91,9 +88,6 @@ extern "C" { #define HDP_SINK_UUID "00001402-0000-1000-8000-00805f9b34fb" #define HID_UUID "00001124-0000-1000-8000-00805f9b34fb" -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -#define HID_DEVICE_UUID "00001124-0000-1000-8000-00805f9b43bf" -#endif #define DUN_GW_UUID "00001103-0000-1000-8000-00805f9b34fb" @@ -112,12 +106,6 @@ extern "C" { #define OBEX_MNS_UUID "00001133-0000-1000-8000-00805f9b34fb" #define OBEX_MAP_UUID "00001134-0000-1000-8000-00805f9b34fb" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -/* Samsung Accessary Protocol UUIDs */ -#define WEARABLE_OLD_SAP_UUID "a49eb41e-cb06-495c-9f4f-aa80a90cdf4a" -#define WEARABLE_NEW_SAP_UUID "a49eb41e-cb06-495c-9f4f-bb80a90cdf00" -#endif - /* GATT UUIDs section */ #define GATT_PRIM_SVC_UUID 0x2800 #define GATT_SND_SVC_UUID 0x2801 @@ -139,9 +127,6 @@ extern "C" { #define GATT_CHARAC_SOFTWARE_REVISION_STRING 0x2A28 #define GATT_CHARAC_MANUFACTURER_NAME_STRING 0x2A29 #define GATT_CHARAC_PNP_ID 0x2A50 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define GATT_CHARAC_CENTRAL_RPA_RESOLUTION 0x2AA6 -#endif /* GATT Characteristic Descriptors */ #define GATT_CHARAC_EXT_PROPER_UUID 0x2900 @@ -154,11 +139,6 @@ extern "C" { #define GATT_EXTERNAL_REPORT_REFERENCE 0x2907 #define GATT_REPORT_REFERENCE 0x2908 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -/* GATT Service UUIDs : Defined by SIG */ -#define GATT_IPSP_UUID 0x1820 -#endif - typedef struct { enum { BT_UUID_UNSPEC = 0, diff --git a/ltmain.sh b/ltmain.sh new file mode 100755 index 0000000..bffda54 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,9661 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# 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. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1.11" +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# 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 () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -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_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# 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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/missing b/missing new file mode 100755 index 0000000..db98974 --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +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 + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/monitor/a2dp.c b/monitor/a2dp.c old mode 100644 new mode 100755 diff --git a/monitor/a2dp.h b/monitor/a2dp.h old mode 100644 new mode 100755 diff --git a/monitor/analyze.c b/monitor/analyze.c old mode 100644 new mode 100755 index 0f2d19a..4dc2891 --- a/monitor/analyze.c +++ b/monitor/analyze.c @@ -29,6 +29,8 @@ #include #include +#include "lib/bluetooth.h" + #include "src/shared/util.h" #include "src/shared/queue.h" #include "src/shared/btsnoop.h" @@ -45,6 +47,11 @@ struct hci_dev { unsigned long num_evt; unsigned long num_acl; unsigned long num_sco; + unsigned long vendor_diag; + unsigned long system_note; + unsigned long user_log; + unsigned long unknown; + uint16_t manufacturer; }; static struct queue *dev_list; @@ -67,13 +74,22 @@ static void dev_destroy(void *data) } printf("Found %s controller with index %u\n", str, dev->index); - printf(" BD_ADDR %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", + printf(" BD_ADDR %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", dev->bdaddr[5], dev->bdaddr[4], dev->bdaddr[3], dev->bdaddr[2], dev->bdaddr[1], dev->bdaddr[0]); + if (dev->manufacturer != 0xffff) + printf(" (%s)", bt_compidtostr(dev->manufacturer)); + printf("\n"); + + printf(" %lu commands\n", dev->num_cmd); printf(" %lu events\n", dev->num_evt); printf(" %lu ACL packets\n", dev->num_acl); printf(" %lu SCO packets\n", dev->num_sco); + printf(" %lu vendor diagnostics\n", dev->vendor_diag); + printf(" %lu system notes\n", dev->system_note); + printf(" %lu user logs\n", dev->user_log); + printf(" %lu unknown opcodes\n", dev->unknown); printf("\n"); free(dev); @@ -84,12 +100,9 @@ static struct hci_dev *dev_alloc(uint16_t index) struct hci_dev *dev; dev = new0(struct hci_dev, 1); - if (!dev) { - fprintf(stderr, "Failed to allocate new device entry\n"); - return NULL; - } dev->index = index; + dev->manufacturer = 0xffff; return dev; } @@ -111,8 +124,6 @@ static struct hci_dev *dev_lookup(uint16_t index) fprintf(stderr, "Creating new device for unknown index\n"); dev = dev_alloc(index); - if (!dev) - return NULL; queue_push_tail(dev_list, dev); } @@ -127,8 +138,6 @@ static void new_index(struct timeval *tv, uint16_t index, struct hci_dev *dev; dev = dev_alloc(index); - if (!dev) - return; dev->type = ni->type; memcpy(dev->bdaddr, ni->bdaddr, 6); @@ -251,6 +260,70 @@ static void sco_pkt(struct timeval *tv, uint16_t index, dev->num_sco++; } +static void info_index(struct timeval *tv, uint16_t index, + const void *data, uint16_t size) +{ + const struct btsnoop_opcode_index_info *hdr = data; + struct hci_dev *dev; + + data += sizeof(*hdr); + size -= sizeof(*hdr); + + dev = dev_lookup(index); + if (!dev) + return; + + dev->manufacturer = hdr->manufacturer; +} + +static void vendor_diag(struct timeval *tv, uint16_t index, + const void *data, uint16_t size) +{ + struct hci_dev *dev; + + dev = dev_lookup(index); + if (!dev) + return; + + dev->vendor_diag++; +} + +static void system_note(struct timeval *tv, uint16_t index, + const void *data, uint16_t size) +{ + struct hci_dev *dev; + + dev = dev_lookup(index); + if (!dev) + return; + + dev->system_note++; +} + +static void user_log(struct timeval *tv, uint16_t index, + const void *data, uint16_t size) +{ + struct hci_dev *dev; + + dev = dev_lookup(index); + if (!dev) + return; + + dev->user_log++; +} + +static void unknown_opcode(struct timeval *tv, uint16_t index, + const void *data, uint16_t size) +{ + struct hci_dev *dev; + + dev = dev_lookup(index); + if (!dev) + return; + + dev->unknown++; +} + void analyze_trace(const char *path) { struct btsnoop *btsnoop_file; @@ -274,10 +347,6 @@ void analyze_trace(const char *path) } dev_list = queue_new(); - if (!dev_list) { - fprintf(stderr, "Failed to allocate device list\n"); - goto done; - } while (1) { unsigned char buf[BTSNOOP_MAX_PACKET_SIZE]; @@ -312,9 +381,22 @@ void analyze_trace(const char *path) case BTSNOOP_OPCODE_OPEN_INDEX: case BTSNOOP_OPCODE_CLOSE_INDEX: break; + case BTSNOOP_OPCODE_INDEX_INFO: + info_index(&tv, index, buf, pktlen); + break; + case BTSNOOP_OPCODE_VENDOR_DIAG: + vendor_diag(&tv, index, buf, pktlen); + break; + case BTSNOOP_OPCODE_SYSTEM_NOTE: + system_note(&tv, index, buf, pktlen); + break; + case BTSNOOP_OPCODE_USER_LOGGING: + user_log(&tv, index, buf, pktlen); + break; default: - fprintf(stderr, "Wrong opcode %u\n", opcode); - goto done; + fprintf(stderr, "Unknown opcode %u\n", opcode); + unknown_opcode(&tv, index, buf, pktlen); + break; } num_packets++; diff --git a/monitor/analyze.h b/monitor/analyze.h old mode 100644 new mode 100755 diff --git a/monitor/avctp.c b/monitor/avctp.c old mode 100644 new mode 100755 index a024a0f..81e9166 --- a/monitor/avctp.c +++ b/monitor/avctp.c @@ -2430,7 +2430,12 @@ response: if (!l2cap_frame_get_u8(frame, &len)) return false; - printf("Folder: "); + if (!len) { + print_field("%*cFolder: ", indent, ' '); + continue; + } + + printf("%*cFolder: ", indent+8, ' '); for (; len > 0; len--) { uint8_t c; diff --git a/monitor/avctp.h b/monitor/avctp.h old mode 100644 new mode 100755 diff --git a/monitor/avdtp.c b/monitor/avdtp.c old mode 100644 new mode 100755 diff --git a/monitor/avdtp.h b/monitor/avdtp.h old mode 100644 new mode 100755 diff --git a/monitor/bnep.c b/monitor/bnep.c old mode 100644 new mode 100755 diff --git a/monitor/bnep.h b/monitor/bnep.h old mode 100644 new mode 100755 diff --git a/monitor/broadcom.c b/monitor/broadcom.c old mode 100644 new mode 100755 index 80edbeb..a3c3443 --- a/monitor/broadcom.c +++ b/monitor/broadcom.c @@ -35,9 +35,6 @@ #include "ll.h" #include "vendor.h" #include "broadcom.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "uuid.h" -#endif static void print_status(uint8_t status) { @@ -96,599 +93,6 @@ static void launch_ram_cmd(const void *data, uint8_t size) print_field("Address: 0x%8.8x", addr); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void set_advt_param_multi_subcmd(const void *data, uint8_t size) -{ - uint8_t adv_instance = get_u8(data + size - 2); - int8_t tx_power = *((int8_t *)(data + size - 1)); - - print_le_set_adv_parameters_cmd(data, size - 2); - - print_field("Advertising Instance: %u", adv_instance); - print_field("TX Power: %d", tx_power); -} - -static void set_advt_data_subcmd(const void *data, uint8_t size) -{ - uint8_t adv_instance = get_u8(data + size - 1); - - print_le_set_adv_data_cmd(data, size - 1); - - print_field("Advertising Instance: %u", adv_instance); -} - -static void set_scan_rsp_data_multi_subcmd(const void *data, uint8_t size) -{ - uint8_t adv_instance = get_u8(data + size - 1); - - print_le_set_scan_rsp_data_cmd(data, size - 1); - - print_field("Advertising Instance: %u", adv_instance); -} - -static void set_random_addr_multi_subcmd(const void *data, uint8_t size) -{ - uint8_t adv_instance = get_u8(data + size - 1); - - print_le_set_random_address_cmd(data, size - 1); - - print_field("Advertising Instance: %u", adv_instance); -} - -static void set_adv_enable_multi_subcmd(const void *data, uint8_t size) -{ - uint8_t adv_instance = get_u8(data + size - 1); - - print_le_set_adv_enable_cmd(data, size - 1); - - print_field("Advertising Instance: %u", adv_instance); -} - -static void enable_custom_feature_subcmd(const void *data, uint8_t size) -{ - uint8_t enable = get_u8(data); - const char *str; - - switch (enable) { - case 0x00: - str = "Disable"; - break; - case 0x01: - str = "Enable"; - break; - default: - str = "Reserved"; - break; - } - - print_field("%s offloaded RPA feature (0x%2.2x)", str, enable); -} - -static void add_irk_to_list_subcmd(const void *data, uint8_t size) -{ - uint8_t addr_type = get_u8(data + 16); - const uint8_t *addr = data + 17; - const char *str; - - print_field("LE IRK (1st byte LSB)"); - packet_hexdump(data, 16); - - switch (addr_type) { - case 0x00: - str = "Public Address"; - break; - case 0x01: - str = "Random Address"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Address type : %s (0x%2.2x)", str, addr_type); - print_field("Address : %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", - addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); -} - -static void remove_irk_from_list_subcmd(const void *data, uint8_t size) -{ - uint8_t addr_type = get_u8(data); - const uint8_t *addr = data + 1; - const char *str; - - switch (addr_type) { - case 0x00: - str = "Public Address"; - break; - case 0x01: - str = "Random Address"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Address type : %s (0x%2.2x)", str, addr_type); - print_field("Address : %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", - addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); -} - -static void read_irk_list_entry_subcmd(const void *data, uint8_t size) -{ - uint8_t index = get_u8(data); - - print_field("LE Read IRK List entry index : %u", index); -} - -static void apcf_enable_subcmd(const void *data, uint8_t size) -{ - uint8_t enable = get_u8(data); - const char *str; - - switch (enable) { - case 0x00: - str = "Disable"; - break; - case 0x01: - str = "Enable"; - break; - default: - str = "Reserved"; - break; - } - - print_field("%s APCF feature (0x%2.2x)", str, enable); -} - -static const struct { - uint8_t bit; - const char *str; -} apcf_feature_table[] = { - { 0, "Broadcast Address filter" }, - { 1, "Service Data Change filter" }, - { 2, "Service UUID check" }, - { 3, "Service Solicitation UUID check" }, - { 4, "Local Name check" }, - { 5, "Manufacturer Data check" }, - { 6, "Service Data check" }, - { } -}; - -static void print_apcf_feature(const char *label, uint16_t feature) -{ - int i; - uint16_t mask; - - mask = feature; - - print_field("%s", label); - - for (i = 0; apcf_feature_table[i].str; i++) { - if (feature & (1 << apcf_feature_table[i].bit)) { - print_field(" %s", apcf_feature_table[i].str); - mask &= ~(1 << apcf_feature_table[i].bit); - } - } - - if (mask) - print_field(" Unknown features (0x%4.4x)", mask); -} - -static void apcf_set_filtering_param_subcmd(const void *data, uint8_t size) -{ - uint8_t add = get_u8(data); - uint8_t index = get_u8(data + 1); - uint16_t feature_selection = get_le16(data + 2); - uint16_t list_logic = get_le16(data + 4); - uint16_t filter_logic = get_u8(data + 6); - uint8_t rssi_high = get_u8(data + 8); - uint8_t delivery_mode = get_u8(data + 9); - uint16_t onfound_timeout = get_le16(data + 10); - uint8_t onfound_timeout_cnt = get_u8(data + 12); - uint8_t rssi_low = get_u8(data + 13); - uint16_t onlost_timeout = get_le16(data + 14); - uint16_t no_of_tracking_entries; - const char *str; - - switch (add) { - case 0x00: - str = "Add"; - break; - case 0x01: - str = "Delete"; - break; - case 0x02: - str = "Clear"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Action : %s for filter [%d]", str, index); - - print_apcf_feature("Feature Selection", feature_selection); - print_apcf_feature("List Logic Type (OR)", ~list_logic); - print_apcf_feature("List Logic Type (AND)", list_logic); - print_apcf_feature("Filter Logic Type (OR)", ~(filter_logic << 3)); - print_apcf_feature("Filter Logic Type (AND)", filter_logic << 3); - print_field("RSSI High Threshold : %d dBm", rssi_high); - - switch (delivery_mode) { - case 0x00: - str = "Immediate"; - break; - case 0x01: - str = "On Found"; - break; - case 0x02: - str = "Batched"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Delivery_mode : %s", str); - print_field("On Found Timeout : %d miliseconds", onfound_timeout); - print_field("On Found Timeout Count : %d", onfound_timeout_cnt); - print_field("RSSI Low Threshold : %d dBm", rssi_low); - print_field("On Lost Timeout : %d miliseconds", onlost_timeout); - - if (size >= 18) { - no_of_tracking_entries = get_le16(data + 16); - print_field("Number of Tracking Entries : %d", - no_of_tracking_entries); - } -} - -static void apcf_broadcaster_addr_subcmd(const void *data, uint8_t size) -{ - uint8_t add = get_u8(data); - uint8_t index = get_u8(data + 1); - uint8_t type = get_u8(data + 7); - char *str; - - switch (add) { - case 0x00: - str = "Add"; - break; - case 0x01: - str = "Delete"; - break; - case 0x02: - str = "Clear"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Action : %s for filter [%d]", str, index); - packet_print_addr("Address", data + 2, type == 0x00 ? false : true); -} - -static void apcf_service_uuid_subcmd(const void *data, uint8_t size) -{ - uint8_t add = get_u8(data); - uint8_t index = get_u8(data + 1); - char *str; - const uint8_t *uuid; - uint16_t uuid16; - uint32_t uuid32; - - - switch (add) { - case 0x00: - str = "Add"; - break; - case 0x01: - str = "Delete"; - break; - case 0x02: - str = "Clear"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Action : %s for filter [%d]", str, index); - - switch ((size - 2) / 2) { - case 2: - uuid16 = get_le16(data + 2); - print_field(" UUID : %s (0x%4.4x)", - uuid16_to_str(uuid16), uuid16); - - uuid16 = get_le16(data + 4); - print_field(" UUID Mask: %s (0x%4.4x)", - uuid16_to_str(uuid16), uuid16); - break; - case 4: - uuid32 = get_le32(data + 2); - print_field(" UUID :%s (0x%8.8x)", - uuid32_to_str(uuid32), uuid32); - - uuid32 = get_le32(data + 6); - print_field(" UUID Mask:%s (0x%8.8x)", - uuid32_to_str(uuid32), uuid32); - break; - case 16: - uuid = data + 2; - print_field(" UUID :%8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x", - get_le32(&uuid[12]), get_le16(&uuid[10]), - get_le16(&uuid[8]), get_le16(&uuid[6]), - get_le32(&uuid[2]), get_le16(&uuid[0])); - uuid = data + 18; - print_field(" UUID :%8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x", - get_le32(&uuid[12]), get_le16(&uuid[10]), - get_le16(&uuid[8]), get_le16(&uuid[6]), - get_le32(&uuid[2]), get_le16(&uuid[0])); - break; - default: - print_field("Invalid UUIDs"); - packet_hexdump(data + 2, size - 2); - break; - } - - return; -} - -static void apcf_service_solicitation_uuid_subcmd(const void *data, uint8_t size) -{ - apcf_service_uuid_subcmd(data, size); -} - -static void apcf_local_name_subcmd(const void *data, uint8_t size) -{ - uint8_t add = get_u8(data); - uint8_t index = get_u8(data + 1); - char *str; - char name[30] = { 0 }; - - switch (add) { - case 0x00: - str = "Add"; - break; - case 0x01: - str = "Delete"; - break; - case 0x02: - str = "Clear"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Action : %s for filter [%d]", str, index); - - memcpy(name, data + 2, size - 2 < 29 ? size - 2 : 29); - print_field("Local Name : %s", name); -} - -static void apcf_manufacturer_data_subcmd(const void *data, uint8_t size) -{ - uint8_t add = get_u8(data); - uint8_t index = get_u8(data + 1); - char *str; - - switch (add) { - case 0x00: - str = "Add"; - break; - case 0x01: - str = "Delete"; - break; - case 0x02: - str = "Clear"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Action : %s for filter [%d]", str, index); - - print_field("Manufacturer data"); - packet_hexdump(data + 2, (size - 2 ) / 2); - - print_field("Manufacturer data Mask"); - packet_hexdump(data + 2 + (size - 2) / 2, (size - 2 ) / 2); -} - -static void apcf_service_data_subcmd(const void *data, uint8_t size) -{ - uint8_t add = get_u8(data); - uint8_t index = get_u8(data + 1); - char *str; - - switch (add) { - case 0x00: - str = "Add"; - break; - case 0x01: - str = "Delete"; - break; - case 0x02: - str = "Clear"; - break; - default: - str = "Reserved"; - break; - } - - print_field("Action : %s for filter [%d]", str, index); - - print_field("Service data"); - packet_hexdump(data + 2, (size - 2 ) / 2); - - print_field("Service data Mask"); - packet_hexdump(data + 2 + (size - 2) / 2, (size - 2 ) / 2); -} - -struct subcmd_data { - uint8_t subcmd; - const char *str; - void (*cmd_func) (const void *data, uint8_t size); - uint8_t cmd_size; - bool cmd_fixed; -}; - -static void print_subcmd(const struct subcmd_data *subcmd_data, - const void *data, uint8_t size) -{ - const char *subcmd_color; - - if (subcmd_data->cmd_func) - subcmd_color = COLOR_BLUE; - else - subcmd_color = COLOR_WHITE_BG; - - print_indent(6, subcmd_color, "", subcmd_data->str, COLOR_OFF, - " (0x%2.2x)", subcmd_data->subcmd); - - if (!subcmd_data->cmd_func) { - packet_hexdump(data, size); - return; - } - - if (subcmd_data->cmd_fixed) { - if (size != subcmd_data->cmd_size) { - print_text(COLOR_ERROR, "invalid packet size"); - packet_hexdump(data, size); - return; - } - } else { - if (size < subcmd_data->cmd_size) { - print_text(COLOR_ERROR, "too short packet"); - packet_hexdump(data, size); - return; - } - } - - subcmd_data->cmd_func(data, size); -} - -static const struct subcmd_data le_multi_advt_table[] = { - { 0x01, "LE Set Advertising Parameters Multi Sub Command", - set_advt_param_multi_subcmd, 23, true }, - { 0x02, "LE Set Advertising Data Multi Sub Command", - set_advt_data_subcmd, 33, false }, - { 0x03, "LE Set Scan Response Data Multi Sub Command", - set_scan_rsp_data_multi_subcmd, 33, false }, - { 0x04, "LE Set Random Address Multi Sub Command", - set_random_addr_multi_subcmd, 7, true }, - { 0x05, "LE Set Advertise Enable Multi Sub Command", - set_adv_enable_multi_subcmd, 2, true }, - { } -}; - -static void le_multi_advt_cmd(const void *data, uint8_t size) -{ - uint8_t subcmd = *((const uint8_t *)data); - struct subcmd_data unknown; - const struct subcmd_data *subcmd_data = &unknown; - int i; - - unknown.subcmd = subcmd; - unknown.str = "Unknown Sub Command"; - unknown.cmd_func = NULL; - unknown.cmd_size = 0; - unknown.cmd_fixed = true; - - for (i = 0; le_multi_advt_table[i].str; i++) { - if (le_multi_advt_table[i].subcmd == subcmd) { - subcmd_data = &le_multi_advt_table[i]; - break; - } - } - - print_subcmd(subcmd_data, data + 1, size - 1); -} - -static const struct subcmd_data le_rpa_offload_table[] = { - { 0x01, "Enable customer specific feature", - enable_custom_feature_subcmd, 1, true }, - { 0x02, "Add IRK to the list", - add_irk_to_list_subcmd, 23, true }, - { 0x03, "Remove IRK from the list", - remove_irk_from_list_subcmd, 7, true }, - { 0x04, "Clear IRK list", - null_cmd, 0, true }, - { 0x05, "Read IRK list entry", - read_irk_list_entry_subcmd, 1, true }, - { } -}; - -static void le_rpa_offload_cmd(const void *data, uint8_t size) -{ - uint8_t subcmd = *((const uint8_t *)data); - struct subcmd_data unknown; - const struct subcmd_data *subcmd_data = &unknown; - int i; - - unknown.subcmd = subcmd; - unknown.str = "Unknown Sub Command"; - unknown.cmd_func = NULL; - unknown.cmd_size = 0; - unknown.cmd_fixed = true; - - for (i = 0; le_rpa_offload_table[i].str; i++) { - if (le_rpa_offload_table[i].subcmd == subcmd) { - subcmd_data = &le_rpa_offload_table[i]; - break; - } - } - - print_subcmd(subcmd_data, data + 1, size - 1); -} - -static const struct subcmd_data le_apcf_table[] = { - { 0x00, "APCF Enable", - apcf_enable_subcmd, 1, true }, - { 0x01, "APCF Set Filtering Parameters", - apcf_set_filtering_param_subcmd, 15, false }, - { 0x02, "APCF Broadcaster Address", - apcf_broadcaster_addr_subcmd, 9, true }, - { 0x03, "APCF Service UUID", - apcf_service_uuid_subcmd, 2, false }, - { 0x04, "APCF Service Solicitation UUID", - apcf_service_solicitation_uuid_subcmd, 2, false }, - { 0x05, "APCF Local Name", - apcf_local_name_subcmd, 2, false }, - { 0x06, "APCF Manufacturer Data", - apcf_manufacturer_data_subcmd, 2, false }, - { 0x07, "APCF Service Data", - apcf_service_data_subcmd, 2, false }, - { } -}; - -static void le_apcf_cmd(const void *data, uint8_t size) -{ - uint8_t subcmd = *((const uint8_t *)data); - struct subcmd_data unknown; - const struct subcmd_data *subcmd_data = &unknown; - int i; - - unknown.subcmd = subcmd; - unknown.str = "Unknown Sub Command"; - unknown.cmd_func = NULL; - unknown.cmd_size = 0; - unknown.cmd_fixed = true; - - for (i = 0; le_apcf_table[i].str; i++) { - if (le_apcf_table[i].subcmd == subcmd) { - subcmd_data = &le_apcf_table[i]; - break; - } - } - - print_subcmd(subcmd_data, data + 1, size - 1); -} -#endif - static void read_vid_pid_rsp(const void *data, uint8_t size) { uint8_t status = get_u8(data); @@ -728,97 +132,6 @@ static void read_verbose_version_info_rsp(const void *data, uint8_t size) print_field("Build number: %u (0x%4.4x)", build_num, build_num); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void get_vendor_capabilities_rsp(const void *data, uint8_t size) -{ - uint8_t status = get_u8(data); - uint8_t max_advt_instances = get_u8(data + 1); - uint8_t offloaded_resolution_of_private_address = get_u8(data + 2); - uint16_t total_scan_results_storage = get_le16(data + 3); - uint8_t max_irk_list_sz = get_u8(data + 5); - uint8_t filtering_support = get_u8(data + 6); - uint8_t max_filter = get_u8(data + 7); - uint8_t activity_energy_info_support = get_u8(data + 8); - uint8_t onlost_follow_per_filter = get_u8(data + 9); - - print_status(status); - print_field("The Number of advertisement instances supported: %u", - max_advt_instances); - print_field("BT chip capability of RPA: %s", - offloaded_resolution_of_private_address ? - "Capable" : "Not Capable"); - print_field("Storage for scan results: %u bytes", - total_scan_results_storage); - print_field("The Number of IRK entries supported: %u", max_irk_list_sz); - print_field("Support Filtering in BT chip: %s", - filtering_support ? "Supported" : "Not Supported"); - print_field("The Number of filters supported: %u", max_filter); - print_field("Supports reporting of activity and energy info: %s", - activity_energy_info_support ? - "Capable" : "Not Capable"); - print_field("The Number of advertisers that can be analysed for " - "onlost per filter: %u", onlost_follow_per_filter); -} - -static void le_multi_advt_rsp(const void *data, uint8_t size) -{ - uint8_t status = get_u8(data); - uint8_t subcmd = get_u8(data + 1); - int i; - const char *str = "Unknown Sub Command"; - - print_status(status); - - for (i = 0; le_multi_advt_table[i].str; i++) { - if (le_multi_advt_table[i].subcmd == subcmd) { - str = le_multi_advt_table[i].str; - break; - } - } - - print_field("Multi Advertise OPcode: %s (%u)", str, subcmd); -} - -static void le_rpa_offload_rsp(const void *data, uint8_t size) -{ - uint8_t status = get_u8(data); - uint8_t subcmd = get_u8(data + 1); - int i; - const char *str = "Unknown Sub Command"; - - print_status(status); - - for (i = 0; le_rpa_offload_table[i].str; i++) { - if (le_rpa_offload_table[i].subcmd == subcmd) { - str = le_rpa_offload_table[i].str; - break; - } - } - - print_field("RPA Offload OPcode: %s (%u)", str, subcmd); -} - -static void le_apcf_rsp(const void *data, uint8_t size) -{ - uint8_t status = get_u8(data); - uint8_t subcmd = get_u8(data + 1); - int i; - const char *str = "Unknown Sub Command"; - - print_status(status); - - for (i = 0; le_apcf_table[i].str; i++) { - if (le_apcf_table[i].subcmd == subcmd) { - str = le_apcf_table[i].str; - break; - } - } - - print_field("Advertising Packet Content Filter OPcode: %s (%u)", - str, subcmd); -} -#endif - static const struct vendor_ocf vendor_ocf_table[] = { { 0x001, "Write BD ADDR", write_bd_addr_cmd, 6, true, @@ -844,25 +157,6 @@ static const struct vendor_ocf vendor_ocf_table[] = { { 0x079, "Read Verbose Config Version Info", null_cmd, 0, true, read_verbose_version_info_rsp, 7, true }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { 0x0153, "LE Get Vendor Capabilities", - null_cmd, 0, true, - get_vendor_capabilities_rsp, 10, false }, - { 0x0154, "LE Multi Advertise", - le_multi_advt_cmd, 1, false, - le_multi_advt_rsp, 2, true }, - { 0x0155, "LE RPA Offload", - le_rpa_offload_cmd, 1, false, - le_rpa_offload_rsp, 2, false }, -#if 0 - { 0x0156, "LE Batch Scan", - le_batch_scan_cmd, 1, false, - le_batch_scan_rsp, 2, true }, -#endif - { 0x0157, "LE APCF", - le_apcf_cmd, 1, false, - le_apcf_rsp, 2, false }, -#endif { } }; @@ -940,59 +234,7 @@ void broadcom_lm_diag(const void *data, uint8_t size) } } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct hci_vse_sec_brcm_link_loss_dbg_info{ - unsigned char linklost_status; - unsigned char conn_handle; - char trans_pwr; - char rssi; - unsigned char ch_map[10]; - unsigned char lmp_cmd[4]; -} __packed; - -static void linkloss_evt(const void *data, uint8_t size) -{ - - struct hci_vse_sec_brcm_link_loss_dbg_info *ev = (void *) data; - char *status = NULL; - switch (ev->linklost_status) { - case 0: - status = "BT_Link_Supervision_Timeout"; - break; - case 1: - status = "LE_Link_Supervision_Timeout"; - break; - case 2: - status = "BT_LMP_Timeout_Local"; - break; - case 3: - status = "BT_LMP_Timeout_Remote"; - break; - case 4: - status = "LE_LMP_Timeout"; - break; - case 5: - status = "Page_Timeout"; - break; - default : - break; - } - - print_field("Status:%s,Handle:%02x,Trans_Pwr:%d,RSSI:%d" - " Ch_map:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" - " LMP_cmd:0x%x%x%x%x", - status, ev->conn_handle, ev->trans_pwr, ev->rssi, - ev->ch_map[0], ev->ch_map[1], ev->ch_map[2], ev->ch_map[3], - ev->ch_map[4], ev->ch_map[5], ev->ch_map[6], ev->ch_map[7], - ev->ch_map[8], ev->ch_map[9], ev->lmp_cmd[0], ev->lmp_cmd[1], - ev->lmp_cmd[2], ev->lmp_cmd[3]); -} -#endif - static const struct vendor_evt vendor_evt_table[] = { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { 0x76, "SEC Link Loss", linkloss_evt, 18, true }, -#endif { } }; diff --git a/monitor/broadcom.h b/monitor/broadcom.h old mode 100644 new mode 100755 diff --git a/monitor/bt.h b/monitor/bt.h old mode 100644 new mode 100755 diff --git a/monitor/control.c b/monitor/control.c old mode 100644 new mode 100755 index 8fa9ea1..9bbdc37 --- a/monitor/control.c +++ b/monitor/control.c @@ -35,6 +35,10 @@ #include #include #include +#include +#include +#include +#include #include "lib/bluetooth.h" #include "lib/hci.h" @@ -48,10 +52,12 @@ #include "packet.h" #include "hcidump.h" #include "ellisys.h" +#include "tty.h" #include "control.h" static struct btsnoop *btsnoop_file = NULL; static bool hcidump_fallback = false; +static bool decode_control = true; struct control_data { uint16_t channel; @@ -792,6 +798,9 @@ static void mgmt_advertising_removed(uint16_t len, const void *buf) void control_message(uint16_t opcode, const void *data, uint16_t size) { + if (!decode_control) + return; + switch (opcode) { case MGMT_EV_INDEX_ADDED: mgmt_index_added(size, data); @@ -965,7 +974,7 @@ static void data_callback(int fd, uint32_t events, void *user_data) data->buf, pktlen); break; case HCI_CHANNEL_MONITOR: - btsnoop_write_hci(btsnoop_file, tv, index, opcode, + btsnoop_write_hci(btsnoop_file, tv, index, opcode, 0, data->buf, pktlen); ellisys_inject_hci(tv, index, opcode, data->buf, pktlen); @@ -1058,23 +1067,25 @@ static void client_callback(int fd, uint32_t events, void *user_data) data->offset += len; - if (data->offset > MGMT_HDR_SIZE) { + while (data->offset >= MGMT_HDR_SIZE) { struct mgmt_hdr *hdr = (struct mgmt_hdr *) data->buf; uint16_t pktlen = le16_to_cpu(hdr->len); + uint16_t opcode, index; + + if (data->offset < pktlen + MGMT_HDR_SIZE) + return; - if (data->offset > pktlen + MGMT_HDR_SIZE) { - uint16_t opcode = le16_to_cpu(hdr->opcode); - uint16_t index = le16_to_cpu(hdr->index); + opcode = le16_to_cpu(hdr->opcode); + index = le16_to_cpu(hdr->index); - packet_monitor(NULL, NULL, index, opcode, + packet_monitor(NULL, NULL, index, opcode, data->buf + MGMT_HDR_SIZE, pktlen); - data->offset -= pktlen + MGMT_HDR_SIZE; + data->offset -= pktlen + MGMT_HDR_SIZE; - if (data->offset > 0) - memmove(data->buf, data->buf + - MGMT_HDR_SIZE + pktlen, data->offset); - } + if (data->offset > 0) + memmove(data->buf, data->buf + MGMT_HDR_SIZE + pktlen, + data->offset); } } @@ -1157,18 +1168,205 @@ void control_server(const char *path) server_fd = fd; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -bool control_writer(const char *path, int16_t rotate_count, ssize_t file_size) -#else +static bool parse_drops(uint8_t **data, uint8_t *len, uint8_t *drops, + uint32_t *total) +{ + if (*len < 1) + return false; + + *drops = **data; + *total += *drops; + (*data)++; + (*len)--; + + return true; +} + +static bool tty_parse_header(uint8_t *hdr, uint8_t len, struct timeval **tv, + struct timeval *ctv, uint32_t *drops) +{ + uint8_t cmd = 0; + uint8_t evt = 0; + uint8_t acl_tx = 0; + uint8_t acl_rx = 0; + uint8_t sco_tx = 0; + uint8_t sco_rx = 0; + uint8_t other = 0; + uint32_t total = 0; + uint32_t ts32; + + while (len) { + uint8_t type = hdr[0]; + + hdr++; len--; + + switch (type) { + case TTY_EXTHDR_COMMAND_DROPS: + if (!parse_drops(&hdr, &len, &cmd, &total)) + return false; + break; + case TTY_EXTHDR_EVENT_DROPS: + if (!parse_drops(&hdr, &len, &evt, &total)) + return false; + break; + case TTY_EXTHDR_ACL_TX_DROPS: + if (!parse_drops(&hdr, &len, &acl_tx, &total)) + return false; + break; + case TTY_EXTHDR_ACL_RX_DROPS: + if (!parse_drops(&hdr, &len, &acl_rx, &total)) + return false; + break; + case TTY_EXTHDR_SCO_TX_DROPS: + if (!parse_drops(&hdr, &len, &sco_tx, &total)) + return false; + break; + case TTY_EXTHDR_SCO_RX_DROPS: + if (!parse_drops(&hdr, &len, &sco_rx, &total)) + return false; + break; + case TTY_EXTHDR_OTHER_DROPS: + if (!parse_drops(&hdr, &len, &other, &total)) + return false; + break; + case TTY_EXTHDR_TS32: + if (len < sizeof(ts32)) + return false; + ts32 = get_le32(hdr); + hdr += sizeof(ts32); len -= sizeof(ts32); + /* ts32 is in units of 1/10th of a millisecond */ + ctv->tv_sec = ts32 / 10000; + ctv->tv_usec = (ts32 % 10000) * 100; + *tv = ctv; + break; + default: + printf("Unknown extended header type %u\n", type); + return false; + } + } + + if (total) { + *drops += total; + printf("* Drops: cmd %u evt %u acl_tx %u acl_rx %u sco_tx %u " + "sco_rx %u other %u\n", cmd, evt, acl_tx, acl_rx, + sco_tx, sco_rx, other); + } + + return true; +} + +static void tty_callback(int fd, uint32_t events, void *user_data) +{ + struct control_data *data = user_data; + ssize_t len; + + if (events & (EPOLLERR | EPOLLHUP)) { + mainloop_remove_fd(data->fd); + return; + } + + len = read(data->fd, data->buf + data->offset, + sizeof(data->buf) - data->offset); + if (len < 0) + return; + + data->offset += len; + + while (data->offset >= sizeof(struct tty_hdr)) { + struct tty_hdr *hdr = (struct tty_hdr *) data->buf; + uint16_t pktlen, opcode, data_len; + struct timeval *tv = NULL; + struct timeval ctv; + uint32_t drops = 0; + + data_len = le16_to_cpu(hdr->data_len); + + if (data->offset < 2 + data_len) + return; + + if (data->offset < sizeof(*hdr) + hdr->hdr_len) { + fprintf(stderr, "Received corrupted data from TTY\n"); + memmove(data->buf, data->buf + 2 + data_len, + data->offset); + return; + } + + if (!tty_parse_header(hdr->ext_hdr, hdr->hdr_len, + &tv, &ctv, &drops)) + fprintf(stderr, "Unable to parse extended header\n"); + + opcode = le16_to_cpu(hdr->opcode); + pktlen = data_len - 4 - hdr->hdr_len; + + btsnoop_write_hci(btsnoop_file, tv, 0, opcode, drops, + hdr->ext_hdr + hdr->hdr_len, pktlen); + packet_monitor(tv, NULL, 0, opcode, + hdr->ext_hdr + hdr->hdr_len, pktlen); + + data->offset -= 2 + data_len; + + if (data->offset > 0) + memmove(data->buf, data->buf + 2 + data_len, + data->offset); + } +} + +int control_tty(const char *path, unsigned int speed) +{ + struct control_data *data; + struct termios ti; + int fd, err; + + fd = open(path, O_RDWR | O_NOCTTY | O_NONBLOCK); + if (fd < 0) { + err = -errno; + perror("Failed to open serial port"); + return err; + } + + if (tcflush(fd, TCIOFLUSH) < 0) { + err = -errno; + perror("Failed to flush serial port"); + close(fd); + return err; + } + + memset(&ti, 0, sizeof(ti)); + /* Switch TTY to raw mode */ + cfmakeraw(&ti); + + ti.c_cflag |= (CLOCAL | CREAD); + ti.c_cflag &= ~CRTSCTS; + + cfsetspeed(&ti, speed); + + if (tcsetattr(fd, TCSANOW, &ti) < 0) { + err = -errno; + perror("Failed to set serial port settings"); + close(fd); + return err; + } + + printf("--- %s opened ---\n", path); + + data = malloc(sizeof(*data)); + if (!data) { + close(fd); + return -ENOMEM; + } + + memset(data, 0, sizeof(*data)); + data->channel = HCI_CHANNEL_MONITOR; + data->fd = fd; + + mainloop_add_fd(data->fd, EPOLLIN, tty_callback, data, free_data); + + return 0; +} + bool control_writer(const char *path) -#endif { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - btsnoop_file = btsnoop_create(path, BTSNOOP_FORMAT_MONITOR, - rotate_count, file_size); -#else btsnoop_file = btsnoop_create(path, BTSNOOP_FORMAT_MONITOR); -#endif return !!btsnoop_file; } @@ -1198,9 +1396,6 @@ void control_reader(const char *path) break; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - setenv("PAGER", "cat", 0); -#endif open_pager(); switch (format) { @@ -1259,3 +1454,8 @@ int control_tracing(void) return 0; } + +void control_disable_decoding(void) +{ + decode_control = false; +} diff --git a/monitor/control.h b/monitor/control.h old mode 100644 new mode 100755 index 8f01056..630a852 --- a/monitor/control.h +++ b/monitor/control.h @@ -24,13 +24,11 @@ #include -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -bool control_writer(const char *path, int16_t rotate_count, ssize_t file_size); -#else bool control_writer(const char *path); -#endif void control_reader(const char *path); void control_server(const char *path); +int control_tty(const char *path, unsigned int speed); int control_tracing(void); +void control_disable_decoding(void); void control_message(uint16_t opcode, const void *data, uint16_t size); diff --git a/monitor/crc.c b/monitor/crc.c old mode 100644 new mode 100755 diff --git a/monitor/crc.h b/monitor/crc.h old mode 100644 new mode 100755 diff --git a/monitor/display.c b/monitor/display.c old mode 100644 new mode 100755 diff --git a/monitor/display.h b/monitor/display.h old mode 100644 new mode 100755 index 9216387..b85f37b --- a/monitor/display.h +++ b/monitor/display.h @@ -38,16 +38,17 @@ bool use_color(void); #define COLOR_WHITE_BG "\x1B[0;47;30m" #define COLOR_HIGHLIGHT "\x1B[1;39m" +#define COLOR_RED_BOLD "\x1B[1;31m" +#define COLOR_GREEN_BOLD "\x1B[1;32m" +#define COLOR_BLUE_BOLD "\x1B[1;34m" +#define COLOR_MAGENTA_BOLD "\x1B[1;35m" + #define COLOR_ERROR "\x1B[1;31m" #define COLOR_WARN "\x1B[1m" #define COLOR_INFO COLOR_OFF #define COLOR_DEBUG COLOR_WHITE -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define FALLBACK_TERMINAL_WIDTH 130 -#else #define FALLBACK_TERMINAL_WIDTH 80 -#endif #define print_indent(indent, color1, prefix, title, color2, fmt, args...) \ do { \ diff --git a/monitor/ellisys.c b/monitor/ellisys.c old mode 100644 new mode 100755 diff --git a/monitor/ellisys.h b/monitor/ellisys.h old mode 100644 new mode 100755 diff --git a/monitor/hcidump.c b/monitor/hcidump.c old mode 100644 new mode 100755 diff --git a/monitor/hcidump.h b/monitor/hcidump.h old mode 100644 new mode 100755 diff --git a/monitor/hwdb.c b/monitor/hwdb.c old mode 100644 new mode 100755 diff --git a/monitor/hwdb.h b/monitor/hwdb.h old mode 100644 new mode 100755 diff --git a/monitor/intel.c b/monitor/intel.c old mode 100644 new mode 100755 diff --git a/monitor/intel.h b/monitor/intel.h old mode 100644 new mode 100755 diff --git a/monitor/keys.c b/monitor/keys.c old mode 100644 new mode 100755 diff --git a/monitor/keys.h b/monitor/keys.h old mode 100644 new mode 100755 diff --git a/monitor/l2cap.c b/monitor/l2cap.c old mode 100644 new mode 100755 index 93a1b20..f4b54af --- a/monitor/l2cap.c +++ b/monitor/l2cap.c @@ -1999,6 +1999,7 @@ static void print_hex_field(const char *label, const uint8_t *data, static void print_uuid(const char *label, const void *data, uint16_t size) { const char *str; + char uuidstr[MAX_LEN_UUID_STR]; switch (size) { case 2: @@ -2010,12 +2011,12 @@ static void print_uuid(const char *label, const void *data, uint16_t size) print_field("%s: %s (0x%8.8x)", label, str, get_le32(data)); break; case 16: - str = uuid128_to_str(data); - print_field("%s: %s (%8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x)", - label, str, + sprintf(uuidstr, "%8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x", get_le32(data + 12), get_le16(data + 10), get_le16(data + 8), get_le16(data + 6), get_le32(data + 2), get_le16(data + 0)); + str = uuidstr_to_str(uuidstr); + print_field("%s: %s (%s)", label, str, uuidstr); break; default: packet_hexdump(data, size); diff --git a/monitor/l2cap.h b/monitor/l2cap.h old mode 100644 new mode 100755 diff --git a/monitor/ll.c b/monitor/ll.c old mode 100644 new mode 100755 diff --git a/monitor/ll.h b/monitor/ll.h old mode 100644 new mode 100755 diff --git a/monitor/lmp.c b/monitor/lmp.c old mode 100644 new mode 100755 diff --git a/monitor/lmp.h b/monitor/lmp.h old mode 100644 new mode 100755 diff --git a/monitor/main.c b/monitor/main.c old mode 100644 new mode 100755 index e1d133f..f9bca22 --- a/monitor/main.c +++ b/monitor/main.c @@ -33,6 +33,7 @@ #include #include "src/shared/mainloop.h" +#include "src/shared/tty.h" #include "packet.h" #include "lmp.h" @@ -63,18 +64,18 @@ static void usage(void) "\t-s, --server Start monitor server socket\n" "\t-p, --priority Show only priority or lower\n" "\t-i, --index Show only specified controller\n" + "\t-d, --tty Read data from TTY\n" + "\t-B, --tty-speed Set TTY speed (default 115200)\n" "\t-t, --time Show time instead of time offset\n" "\t-T, --date Show time and date information\n" "\t-S, --sco Dump SCO traffic\n" "\t-E, --ellisys [ip] Send Ellisys HCI Injection\n" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - "\t-C, --count Save traces by rotation\n" - "\t-W, --size Save traces at most size\n" -#endif "\t-h, --help Show help options\n"); } static const struct option main_options[] = { + { "tty", required_argument, NULL, 'd' }, + { "tty-speed", required_argument, NULL, 'B' }, { "read", required_argument, NULL, 'r' }, { "write", required_argument, NULL, 'w' }, { "analyze", required_argument, NULL, 'a' }, @@ -85,10 +86,6 @@ static const struct option main_options[] = { { "date", no_argument, NULL, 'T' }, { "sco", no_argument, NULL, 'S' }, { "ellisys", required_argument, NULL, 'E' }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "count", required_argument, NULL, 'C' }, - { "size", required_argument, NULL, 'W' }, -#endif { "todo", no_argument, NULL, '#' }, { "version", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, @@ -102,11 +99,9 @@ int main(int argc, char *argv[]) const char *writer_path = NULL; const char *analyze_path = NULL; const char *ellisys_server = NULL; + const char *tty = NULL; + unsigned int tty_speed = B115200; unsigned short ellisys_port = 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - int16_t rotate_count = -1; - ssize_t file_size = -1; -#endif const char *str; int exit_status; sigset_t mask; @@ -118,17 +113,22 @@ int main(int argc, char *argv[]) for (;;) { int opt; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - opt = getopt_long(argc, argv, "r:w:a:s:p:i:tTSE:C:W:vh", + opt = getopt_long(argc, argv, "d:r:w:a:s:p:i:tTSE:vh", main_options, NULL); -#else - opt = getopt_long(argc, argv, "r:w:a:s:p:i:tTSE:vh", - main_options, NULL); -#endif if (opt < 0) break; switch (opt) { + case 'd': + tty= optarg; + break; + case 'B': + tty_speed = tty_get_speed(atoi(optarg)); + if (!tty_speed) { + fprintf(stderr, "Unknown speed: %s\n", optarg); + return EXIT_FAILURE; + } + break; case 'r': reader_path = optarg; break; @@ -171,14 +171,6 @@ int main(int argc, char *argv[]) ellisys_server = optarg; ellisys_port = 24352; break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case 'C': - rotate_count = atoi(optarg); - break; - case 'W': - file_size = atoll(optarg); - break; -#endif case '#': packet_todo(); lmp_todo(); @@ -229,23 +221,18 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (writer_path && !control_writer(writer_path, - rotate_count, file_size)) { - printf("Failed to open '%s'\n", writer_path); - return EXIT_FAILURE; - } -#else if (writer_path && !control_writer(writer_path)) { printf("Failed to open '%s'\n", writer_path); return EXIT_FAILURE; } -#endif if (ellisys_server) ellisys_enable(ellisys_server, ellisys_port); - if (control_tracing() < 0) + if (!tty && control_tracing() < 0) + return EXIT_FAILURE; + + if (tty && control_tty(tty, tty_speed) < 0) return EXIT_FAILURE; exit_status = mainloop_run(); diff --git a/monitor/packet.c b/monitor/packet.c old mode 100644 new mode 100755 index 932fad0..6272562 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -57,6 +57,7 @@ #include "broadcom.h" #include "packet.h" +#define COLOR_CHANNEL_LABEL COLOR_WHITE #define COLOR_INDEX_LABEL COLOR_WHITE #define COLOR_TIMESTAMP COLOR_YELLOW @@ -66,13 +67,12 @@ #define COLOR_CLOSE_INDEX COLOR_RED #define COLOR_INDEX_INFO COLOR_GREEN #define COLOR_VENDOR_DIAG COLOR_YELLOW +#define COLOR_SYSTEM_NOTE COLOR_OFF #define COLOR_HCI_COMMAND COLOR_BLUE #define COLOR_HCI_COMMAND_UNKNOWN COLOR_WHITE_BG - #define COLOR_HCI_EVENT COLOR_MAGENTA #define COLOR_HCI_EVENT_UNKNOWN COLOR_WHITE_BG - #define COLOR_HCI_ACLDATA COLOR_CYAN #define COLOR_HCI_SCODATA COLOR_YELLOW @@ -84,6 +84,19 @@ #define COLOR_UNKNOWN_SERVICE_CLASS COLOR_WHITE_BG #define COLOR_UNKNOWN_PKT_TYPE_BIT COLOR_WHITE_BG +#define COLOR_CTRL_OPEN COLOR_GREEN_BOLD +#define COLOR_CTRL_CLOSE COLOR_RED_BOLD +#define COLOR_CTRL_COMMAND COLOR_BLUE_BOLD +#define COLOR_CTRL_COMMAND_UNKNOWN COLOR_WHITE_BG +#define COLOR_CTRL_EVENT COLOR_MAGENTA_BOLD +#define COLOR_CTRL_EVENT_UNKNOWN COLOR_WHITE_BG + +#define COLOR_UNKNOWN_OPTIONS_BIT COLOR_WHITE_BG +#define COLOR_UNKNOWN_SETTINGS_BIT COLOR_WHITE_BG +#define COLOR_UNKNOWN_ADDRESS_TYPE COLOR_WHITE_BG +#define COLOR_UNKNOWN_DEVICE_FLAG COLOR_WHITE_BG +#define COLOR_UNKNOWN_ADV_FLAG COLOR_WHITE_BG + #define COLOR_PHY_PACKET COLOR_BLUE static time_t time_offset = ((time_t) -1); @@ -95,6 +108,71 @@ static uint16_t index_current = 0; #define UNKNOWN_MANUFACTURER 0xffff +#define CTRL_RAW 0x0000 +#define CTRL_USER 0x0001 +#define CTRL_MGMT 0x0002 + +#define MAX_CTRL 64 + +struct ctrl_data { + bool used; + uint32_t cookie; + uint16_t format; + char name[20]; +}; + +static struct ctrl_data ctrl_list[MAX_CTRL]; + +static void assign_ctrl(uint32_t cookie, uint16_t format, const char *name) +{ + int i; + + for (i = 0; i < MAX_CTRL; i++) { + if (!ctrl_list[i].used) { + ctrl_list[i].used = true; + ctrl_list[i].cookie = cookie; + ctrl_list[i].format = format; + if (name) { + strncpy(ctrl_list[i].name, name, 19); + ctrl_list[i].name[19] = '\0'; + } else + strcpy(ctrl_list[i].name, "null"); + break; + } + } +} + +static void release_ctrl(uint32_t cookie, uint16_t *format, char *name) +{ + int i; + + if (format) + *format = 0xffff; + + for (i = 0; i < MAX_CTRL; i++) { + if (ctrl_list[i].used && ctrl_list[i].cookie == cookie) { + ctrl_list[i].used = false; + if (format) + *format = ctrl_list[i].format; + if (name) + strncpy(name, ctrl_list[i].name, 20); + break; + } + } +} + +static uint16_t get_format(uint32_t cookie) +{ + int i; + + for (i = 0; i < MAX_CTRL; i++) { + if (ctrl_list[i].used && ctrl_list[i].cookie == cookie) + return ctrl_list[i].format; + } + + return 0xffff; +} + #define MAX_CONN 16 struct conn_data { @@ -181,15 +259,29 @@ void packet_select_index(uint16_t index) #define print_space(x) printf("%*c", (x), ' '); -static void print_packet(struct timeval *tv, struct ucred *cred, - uint16_t index, char ident, +static void print_packet(struct timeval *tv, struct ucred *cred, char ident, + uint16_t index, const char *channel, const char *color, const char *label, const char *text, const char *extra) { int col = num_columns(); - char line[256], ts_str[64]; + char line[256], ts_str[96]; int n, ts_len = 0, ts_pos = 0, len = 0, pos = 0; + if (channel) { + if (use_color()) { + n = sprintf(ts_str + ts_pos, "%s", COLOR_CHANNEL_LABEL); + if (n > 0) + ts_pos += n; + } + + n = sprintf(ts_str + ts_pos, " {%s}", channel); + if (n > 0) { + ts_pos += n; + ts_len += n; + } + } + if ((filter_mask & PACKET_FILTER_SHOW_INDEX) && index != HCI_DEV_NONE) { if (use_color()) { @@ -1870,7 +1962,9 @@ static void print_randomizer_p256(const uint8_t *randomizer) static void print_pk256(const char *label, const uint8_t *key) { - print_hex_field(label, key, 64); + print_field("%s:", label); + print_hex_field(" X", &key[0], 32); + print_hex_field(" Y", &key[32], 32); } static void print_dhkey(const uint8_t *dhkey) @@ -2378,8 +2472,12 @@ void packet_print_version(const char *label, uint8_t version, break; } - print_field("%s: %s (0x%2.2x) - %s %d (0x%4.4x)", label, str, version, + if (sublabel) + print_field("%s: %s (0x%2.2x) - %s %d (0x%4.4x)", + label, str, version, sublabel, subversion, subversion); + else + print_field("%s: %s (0x%2.2x)", label, str, version); } static void print_hci_version(uint8_t version, uint16_t revision) @@ -3295,16 +3393,18 @@ static void print_uuid128_list(const char *label, const void *data, { uint8_t count = data_len / 16; unsigned int i; + char uuidstr[MAX_LEN_UUID_STR]; print_field("%s: %u entr%s", label, count, count == 1 ? "y" : "ies"); for (i = 0; i < count; i++) { const uint8_t *uuid = data + (i * 16); - print_field(" %8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x", + sprintf(uuidstr, "%8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x", get_le32(&uuid[12]), get_le16(&uuid[10]), get_le16(&uuid[8]), get_le16(&uuid[6]), get_le32(&uuid[2]), get_le16(&uuid[0])); + print_field(" %s (%s)", uuidstr_to_str(uuidstr), uuidstr); } } @@ -3800,9 +3900,22 @@ void packet_monitor(struct timeval *tv, struct ucred *cred, packet_user_logging(tv, cred, index, ul->priority, ident, data + sizeof(*ul) + ul->ident_len); break; + case BTSNOOP_OPCODE_CTRL_OPEN: + control_disable_decoding(); + packet_ctrl_open(tv, cred, index, data, size); + break; + case BTSNOOP_OPCODE_CTRL_CLOSE: + packet_ctrl_close(tv, cred, index, data, size); + break; + case BTSNOOP_OPCODE_CTRL_COMMAND: + packet_ctrl_command(tv, cred, index, data, size); + break; + case BTSNOOP_OPCODE_CTRL_EVENT: + packet_ctrl_event(tv, cred, index, data, size); + break; default: sprintf(extra_str, "(code %d len %d)", opcode, size); - print_packet(tv, cred, index, '*', COLOR_ERROR, + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, "Unknown packet", NULL, extra_str); packet_hexdump(data, size); break; @@ -3819,7 +3932,7 @@ void packet_simulator(struct timeval *tv, uint16_t frequency, sprintf(str, "%u MHz", frequency); - print_packet(tv, NULL, 0, '*', COLOR_PHY_PACKET, + print_packet(tv, NULL, '*', 0, NULL, COLOR_PHY_PACKET, "Physical packet:", NULL, str); ll_packet(frequency, data, size, false); @@ -5540,7 +5653,7 @@ static void read_local_version_rsp(const void *data, uint8_t size) if (index_current < MAX_INDEX) { switch (index_list[index_current].type) { - case HCI_BREDR: + case HCI_PRIMARY: print_lmp_version(rsp->lmp_ver, rsp->lmp_subver); break; case HCI_AMP: @@ -7300,10 +7413,6 @@ static const char *current_vendor_str(void) return "Intel"; case 15: return "Broadcom"; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - default: - return "Unknown"; -#endif } return NULL; @@ -7323,10 +7432,6 @@ static const struct vendor_ocf *current_vendor_ocf(uint16_t ocf) return intel_vendor_ocf(ocf); case 15: return broadcom_vendor_ocf(ocf); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - default: - return broadcom_vendor_ocf(ocf); -#endif } return NULL; @@ -7346,10 +7451,6 @@ static const struct vendor_evt *current_vendor_evt(uint8_t evt) return intel_vendor_evt(evt); case 15: return broadcom_vendor_evt(evt); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - default: - return broadcom_vendor_evt(evt); -#endif } return NULL; @@ -8673,26 +8774,26 @@ void packet_new_index(struct timeval *tv, uint16_t index, const char *label, sprintf(details, "(%s,%s,%s)", hci_typetostr(type), hci_bustostr(bus), name); - print_packet(tv, NULL, index, '=', COLOR_NEW_INDEX, "New Index", - label, details); + print_packet(tv, NULL, '=', index, NULL, COLOR_NEW_INDEX, + "New Index", label, details); } void packet_del_index(struct timeval *tv, uint16_t index, const char *label) { - print_packet(tv, NULL, index, '=', COLOR_DEL_INDEX, "Delete Index", - label, NULL); + print_packet(tv, NULL, '=', index, NULL, COLOR_DEL_INDEX, + "Delete Index", label, NULL); } void packet_open_index(struct timeval *tv, uint16_t index, const char *label) { - print_packet(tv, NULL, index, '=', COLOR_OPEN_INDEX, "Open Index", - label, NULL); + print_packet(tv, NULL, '=', index, NULL, COLOR_OPEN_INDEX, + "Open Index", label, NULL); } void packet_close_index(struct timeval *tv, uint16_t index, const char *label) { - print_packet(tv, NULL, index, '=', COLOR_CLOSE_INDEX, "Close Index", - label, NULL); + print_packet(tv, NULL, '=', index, NULL, COLOR_CLOSE_INDEX, + "Close Index", label, NULL); } void packet_index_info(struct timeval *tv, uint16_t index, const char *label, @@ -8702,8 +8803,8 @@ void packet_index_info(struct timeval *tv, uint16_t index, const char *label, sprintf(details, "(%s)", bt_compidtostr(manufacturer)); - print_packet(tv, NULL, index, '=', COLOR_INDEX_INFO, "Index Info", - label, details); + print_packet(tv, NULL, '=', index, NULL, COLOR_INDEX_INFO, + "Index Info", label, details); } void packet_vendor_diag(struct timeval *tv, uint16_t index, @@ -8714,7 +8815,7 @@ void packet_vendor_diag(struct timeval *tv, uint16_t index, sprintf(extra_str, "(len %d)", size); - print_packet(tv, NULL, index, '=', COLOR_VENDOR_DIAG, + print_packet(tv, NULL, '=', index, NULL, COLOR_VENDOR_DIAG, "Vendor Diagnostic", NULL, extra_str); switch (manufacturer) { @@ -8730,7 +8831,8 @@ void packet_vendor_diag(struct timeval *tv, uint16_t index, void packet_system_note(struct timeval *tv, struct ucred *cred, uint16_t index, const void *message) { - print_packet(tv, cred, index, '=', COLOR_INFO, "Note", message, NULL); + print_packet(tv, cred, '=', index, NULL, COLOR_SYSTEM_NOTE, + "Note", message, NULL); } void packet_user_logging(struct timeval *tv, struct ucred *cred, @@ -8790,7 +8892,7 @@ void packet_user_logging(struct timeval *tv, struct ucred *cred, label = "Message"; } - print_packet(tv, cred, index, '=', color, label, message, NULL); + print_packet(tv, cred, '=', index, NULL, color, label, message, NULL); } void packet_hci_command(struct timeval *tv, struct ucred *cred, uint16_t index, @@ -8808,7 +8910,7 @@ void packet_hci_command(struct timeval *tv, struct ucred *cred, uint16_t index, if (size < HCI_COMMAND_HDR_SIZE) { sprintf(extra_str, "(len %d)", size); - print_packet(tv, cred, index, '*', COLOR_ERROR, + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, "Malformed HCI Command packet", NULL, extra_str); packet_hexdump(data, size); return; @@ -8866,7 +8968,7 @@ void packet_hci_command(struct timeval *tv, struct ucred *cred, uint16_t index, sprintf(extra_str, "(0x%2.2x|0x%4.4x) plen %d", ogf, ocf, hdr->plen); - print_packet(tv, cred, index, '<', opcode_color, "HCI Command", + print_packet(tv, cred, '<', index, NULL, opcode_color, "HCI Command", opcode_str, extra_str); if (!opcode_data || !opcode_data->cmd_func) { @@ -8909,7 +9011,7 @@ void packet_hci_event(struct timeval *tv, struct ucred *cred, uint16_t index, if (size < HCI_EVENT_HDR_SIZE) { sprintf(extra_str, "(len %d)", size); - print_packet(tv, cred, index, '*', COLOR_ERROR, + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, "Malformed HCI Event packet", NULL, extra_str); packet_hexdump(data, size); return; @@ -8938,7 +9040,7 @@ void packet_hci_event(struct timeval *tv, struct ucred *cred, uint16_t index, sprintf(extra_str, "(0x%2.2x) plen %d", hdr->evt, hdr->plen); - print_packet(tv, cred, index, '>', event_color, "HCI Event", + print_packet(tv, cred, '>', index, NULL, event_color, "HCI Event", event_str, extra_str); if (!event_data || !event_data->func) { @@ -8979,24 +9081,24 @@ void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index, uint8_t flags = acl_flags(handle); char handle_str[16], extra_str[32]; - if (size < sizeof(*hdr)) { + if (size < HCI_ACL_HDR_SIZE) { if (in) - print_packet(tv, cred, index, '*', COLOR_ERROR, + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, "Malformed ACL Data RX packet", NULL, NULL); else - print_packet(tv, cred, index, '*', COLOR_ERROR, + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, "Malformed ACL Data TX packet", NULL, NULL); packet_hexdump(data, size); return; } - data += sizeof(*hdr); - size -= sizeof(*hdr); + data += HCI_ACL_HDR_SIZE; + size -= HCI_ACL_HDR_SIZE; sprintf(handle_str, "Handle %d", acl_handle(handle)); sprintf(extra_str, "flags 0x%2.2x dlen %d", flags, dlen); - print_packet(tv, cred, index, in ? '>' : '<', COLOR_HCI_ACLDATA, + print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_ACLDATA, in ? "ACL Data RX" : "ACL Data TX", handle_str, extra_str); @@ -9023,10 +9125,10 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index, if (size < HCI_SCO_HDR_SIZE) { if (in) - print_packet(tv, cred, index, '*', COLOR_ERROR, + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, "Malformed SCO Data RX packet", NULL, NULL); else - print_packet(tv, cred, index, '*', COLOR_ERROR, + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, "Malformed SCO Data TX packet", NULL, NULL); packet_hexdump(data, size); return; @@ -9038,7 +9140,7 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index, sprintf(handle_str, "Handle %d", acl_handle(handle)); sprintf(extra_str, "flags 0x%2.2x dlen %d", flags, hdr->dlen); - print_packet(tv, cred, index, in ? '>' : '<', COLOR_HCI_SCODATA, + print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_SCODATA, in ? "SCO Data RX" : "SCO Data TX", handle_str, extra_str); @@ -9053,62 +9155,2543 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index, packet_hexdump(data, size); } -void packet_todo(void) +void packet_ctrl_open(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size) +{ + uint32_t cookie; + uint16_t format; + char channel[11]; + + if (size < 6) { + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, + "Malformed Control Open packet", NULL, NULL); + packet_hexdump(data, size); + return; + } + + cookie = get_le32(data); + format = get_le16(data + 4); + + data += 6; + size -= 6; + + sprintf(channel, "0x%4.4x", cookie); + + if ((format == CTRL_RAW || format == CTRL_USER || format == CTRL_MGMT) + && size >= 8) { + uint8_t version; + uint16_t revision; + uint32_t flags; + uint8_t ident_len; + const char *comm; + char details[48]; + const char *title; + + version = get_u8(data); + revision = get_le16(data + 1); + flags = get_le32(data + 3); + ident_len = get_u8(data + 7); + + data += 8; + size -= 8; + + comm = ident_len > 0 ? data : "unknown"; + + data += ident_len; + size -= ident_len; + + assign_ctrl(cookie, format, comm); + + sprintf(details, "%sversion %u.%u", + flags & 0x0001 ? "(privileged) " : "", + version, revision); + + switch (format) { + case CTRL_RAW: + title = "RAW Open"; + break; + case CTRL_USER: + title = "USER Open"; + break; + case CTRL_MGMT: + title = "MGMT Open"; + break; + default: + title = "Control Open"; + break; + } + + print_packet(tv, cred, '@', index, channel, COLOR_CTRL_OPEN, + title, comm, details); + } else { + char label[7]; + + assign_ctrl(cookie, format, NULL); + + sprintf(label, "0x%4.4x", format); + + print_packet(tv, cred, '@', index, channel, COLOR_CTRL_OPEN, + "Control Open", label, NULL); + } + + packet_hexdump(data, size); +} + +void packet_ctrl_close(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size) +{ + uint32_t cookie; + uint16_t format; + char channel[11], label[22]; + const char *title; + + if (size < 4) { + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, + "Malformed Control Close packet", NULL, NULL); + packet_hexdump(data, size); + return; + } + + cookie = get_le32(data); + + data += 4; + size -= 4; + + sprintf(channel, "0x%4.4x", cookie); + + release_ctrl(cookie, &format, label); + + switch (format) { + case CTRL_RAW: + title = "RAW Close"; + break; + case CTRL_USER: + title = "USER Close"; + break; + case CTRL_MGMT: + title = "MGMT Close"; + break; + default: + sprintf(label, "0x%4.4x", format); + title = "Control Close"; + break; + } + + print_packet(tv, cred, '@', index, channel, COLOR_CTRL_CLOSE, + title, label, NULL); + + packet_hexdump(data, size); +} + +static const struct { + uint8_t status; + const char *str; +} mgmt_status_table[] = { + { 0x00, "Success" }, + { 0x01, "Unknown Command" }, + { 0x02, "Not Connected" }, + { 0x03, "Failed" }, + { 0x04, "Connect Failed" }, + { 0x05, "Authentication Failed" }, + { 0x06, "Not Paired" }, + { 0x07, "No Resources" }, + { 0x08, "Timeout" }, + { 0x09, "Already Connected" }, + { 0x0a, "Busy" }, + { 0x0b, "Rejected" }, + { 0x0c, "Not Supported" }, + { 0x0d, "Invalid Parameters" }, + { 0x0e, "Disconnected" }, + { 0x0f, "Not Powered" }, + { 0x10, "Cancelled" }, + { 0x11, "Invalid Index" }, + { 0x12, "RFKilled" }, + { 0x13, "Already Paired" }, + { 0x14, "Permission Denied" }, + { } +}; + +static void mgmt_print_status(uint8_t status) { + const char *str = "Unknown"; + const char *color_on, *color_off; + bool unknown = true; int i; - printf("HCI commands with missing decodings:\n"); + for (i = 0; mgmt_status_table[i].str; i++) { + if (mgmt_status_table[i].status == status) { + str = mgmt_status_table[i].str; + unknown = false; + break; + } + } - for (i = 0; opcode_table[i].str; i++) { - if (opcode_table[i].bit < 0) - continue; + if (use_color()) { + if (status) { + if (unknown) + color_on = COLOR_UNKNOWN_ERROR; + else + color_on = COLOR_RED; + } else + color_on = COLOR_GREEN; + color_off = COLOR_OFF; + } else { + color_on = ""; + color_off = ""; + } - if (opcode_table[i].cmd_func) - continue; + print_field("Status: %s%s%s (0x%2.2x)", + color_on, str, color_off, status); +} - printf("\t%s\n", opcode_table[i].str); +static void mgmt_print_address(const uint8_t *address, uint8_t type) +{ + switch (type) { + case 0x00: + print_addr_resolve("BR/EDR Address", address, 0x00, false); + break; + case 0x01: + print_addr_resolve("LE Address", address, 0x00, false); + break; + case 0x02: + print_addr_resolve("LE Address", address, 0x01, false); + break; + default: + print_addr_resolve("Address", address, 0xff, false); + break; } +} - printf("HCI events with missing decodings:\n"); +static const struct { + uint8_t bit; + const char *str; +} mgmt_address_type_table[] = { + { 0, "BR/EDR" }, + { 1, "LE Public" }, + { 2, "LE Random" }, + { } +}; - for (i = 0; event_table[i].str; i++) { - if (event_table[i].func) - continue; +static void mgmt_print_address_type(uint8_t type) +{ + uint8_t mask = type; + int i; - printf("\t%s\n", event_table[i].str); + print_field("Address type: 0x%2.2x", type); + + for (i = 0; mgmt_address_type_table[i].str; i++) { + if (type & (1 << mgmt_address_type_table[i].bit)) { + print_field(" %s", mgmt_address_type_table[i].str); + mask &= ~(1 << mgmt_address_type_table[i].bit); + } } - for (i = 0; le_meta_event_table[i].str; i++) { - if (le_meta_event_table[i].func) - continue; + if (mask) + print_text(COLOR_UNKNOWN_ADDRESS_TYPE, " Unknown address type" + " (0x%2.2x)", mask); +} - printf("\t%s\n", le_meta_event_table[i].str); +static void mgmt_print_version(uint8_t version) +{ + packet_print_version("Version", version, NULL, 0x0000); +} + +static void mgmt_print_manufacturer(uint16_t manufacturer) +{ + packet_print_company("Manufacturer", manufacturer); +} + +static const struct { + uint8_t bit; + const char *str; +} mgmt_options_table[] = { + { 0, "External configuration" }, + { 1, "Bluetooth public address configuration" }, + { } +}; + +static void mgmt_print_options(const char *label, uint32_t options) +{ + uint32_t mask = options; + int i; + + print_field("%s: 0x%8.8x", label, options); + + for (i = 0; mgmt_options_table[i].str; i++) { + if (options & (1 << mgmt_options_table[i].bit)) { + print_field(" %s", mgmt_options_table[i].str); + mask &= ~(1 << mgmt_options_table[i].bit); + } } + + if (mask) + print_text(COLOR_UNKNOWN_OPTIONS_BIT, " Unknown options" + " (0x%8.8x)", mask); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void print_le_set_adv_parameters_cmd(const void *data, uint8_t size) +static const struct { + uint8_t bit; + const char *str; +} mgmt_settings_table[] = { + { 0, "Powered" }, + { 1, "Connectable" }, + { 2, "Fast Connectable" }, + { 3, "Discoverable" }, + { 4, "Bondable" }, + { 5, "Link Security" }, + { 6, "Secure Simple Pairing" }, + { 7, "BR/EDR" }, + { 8, "High Speed" }, + { 9, "Low Energy" }, + { 10, "Advertising" }, + { 11, "Secure Connections" }, + { 12, "Debug Keys" }, + { 13, "Privacy" }, + { 14, "Controller Configuration"}, + { 15, "Static Address" }, + { } +}; + +static void mgmt_print_settings(const char *label, uint32_t settings) { - le_set_adv_parameters_cmd(data, size); + uint32_t mask = settings; + int i; + + print_field("%s: 0x%8.8x", label, settings); + + for (i = 0; mgmt_settings_table[i].str; i++) { + if (settings & (1 << mgmt_settings_table[i].bit)) { + print_field(" %s", mgmt_settings_table[i].str); + mask &= ~(1 << mgmt_settings_table[i].bit); + } + } + + if (mask) + print_text(COLOR_UNKNOWN_SETTINGS_BIT, " Unknown settings" + " (0x%8.8x)", mask); } -void print_le_set_random_address_cmd(const void *data, uint8_t size) +static void mgmt_print_name(const void *data) { - le_set_random_address_cmd(data, size); + print_field("Name: %s", (char *) data); + print_field("Short name: %s", (char *) (data + 249)); } -void print_le_set_adv_data_cmd(const void *data, uint8_t size) +static void mgmt_print_uuid(const void *data) { - le_set_adv_data_cmd(data, size); + const uint8_t *uuid = data; + + print_field("UUID: %8.8x-%4.4x-%4.4x-%4.4x-%8.8x%4.4x", + get_le32(&uuid[12]), get_le16(&uuid[10]), + get_le16(&uuid[8]), get_le16(&uuid[6]), + get_le32(&uuid[2]), get_le16(&uuid[0])); } -void print_le_set_scan_rsp_data_cmd(const void *data, uint8_t size) +static void mgmt_print_enable(const char *label, uint8_t enable) { - le_set_scan_rsp_data_cmd(data, size); + const char *str; + + switch (enable) { + case 0x00: + str = "Disabled"; + break; + case 0x01: + str = "Enabled"; + break; + default: + str = "Reserved"; + break; + } + + print_field("%s: %s (0x%2.2x)", label, str, enable); } -void print_le_set_adv_enable_cmd(const void *data, uint8_t size) +static void mgmt_print_io_capability(uint8_t capability) { - le_set_adv_enable_cmd(data, size); + const char *str; + + switch (capability) { + case 0x00: + str = "DisplayOnly"; + break; + case 0x01: + str = "DisplayYesNo"; + break; + case 0x02: + str = "KeyboardOnly"; + break; + case 0x03: + str = "NoInputNoOutput"; + break; + case 0x04: + str = "KeyboardDisplay"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Capability: %s (0x%2.2x)", str, capability); +} + +static const struct { + uint8_t bit; + const char *str; +} mgmt_device_flags_table[] = { + { 0, "Confirm Name" }, + { 1, "Legacy Pairing" }, + { 2, "Not Connectable" }, + { } +}; + +static void mgmt_print_device_flags(uint32_t flags) +{ + uint32_t mask = flags; + int i; + + print_field("Flags: 0x%8.8x", flags); + + for (i = 0; mgmt_device_flags_table[i].str; i++) { + if (flags & (1 << mgmt_device_flags_table[i].bit)) { + print_field(" %s", mgmt_device_flags_table[i].str); + mask &= ~(1 << mgmt_device_flags_table[i].bit); + } + } + + if (mask) + print_text(COLOR_UNKNOWN_DEVICE_FLAG, " Unknown device flag" + " (0x%8.8x)", mask); +} + +static void mgmt_print_device_action(uint8_t action) +{ + const char *str; + + switch (action) { + case 0x00: + str = "Background scan for device"; + break; + case 0x01: + str = "Allow incoming connection"; + break; + case 0x02: + str = "Auto-connect remote device"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Action: %s (0x%2.2x)", str, action); +} + +static const struct { + uint8_t bit; + const char *str; +} mgmt_adv_flags_table[] = { + { 0, "Switch into Connectable mode" }, + { 1, "Advertise as Discoverable" }, + { 2, "Advertise as Limited Discoverable" }, + { 3, "Add Flags field to Advertising Data" }, + { 4, "Add TX Power field to Advertising Data" }, + { 5, "Add Appearance field to Scan Response" }, + { 6, "Add Local Name in Scan Response" }, + { } +}; + +static void mgmt_print_adv_flags(uint32_t flags) +{ + uint32_t mask = flags; + int i; + + print_field("Flags: 0x%8.8x", flags); + + for (i = 0; mgmt_adv_flags_table[i].str; i++) { + if (flags & (1 << mgmt_adv_flags_table[i].bit)) { + print_field(" %s", mgmt_adv_flags_table[i].str); + mask &= ~(1 << mgmt_adv_flags_table[i].bit); + } + } + + if (mask) + print_text(COLOR_UNKNOWN_ADV_FLAG, " Unknown advertising flag" + " (0x%8.8x)", mask); +} + +static void mgmt_print_store_hint(uint8_t hint) +{ + const char *str; + + switch (hint) { + case 0x00: + str = "No"; + break; + case 0x01: + str = "Yes"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Store hint: %s (0x%2.2x)", str, hint); +} + +static void mgmt_print_connection_parameter(const void *data) +{ + uint8_t address_type = get_u8(data + 6); + uint16_t min_conn_interval = get_le16(data + 7); + uint16_t max_conn_interval = get_le16(data + 9); + uint16_t conn_latency = get_le16(data + 11); + uint16_t supv_timeout = get_le16(data + 13); + + mgmt_print_address(data, address_type); + print_field("Min connection interval: %u", min_conn_interval); + print_field("Max connection interval: %u", max_conn_interval); + print_field("Connection latency: %u", conn_latency); + print_field("Supervision timeout: %u", supv_timeout); +} + +static void mgmt_print_link_key(const void *data) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t key_type = get_u8(data + 7); + uint8_t pin_len = get_u8(data + 24); + + mgmt_print_address(data, address_type); + print_key_type(key_type); + print_link_key(data + 8); + print_field("PIN length: %d", pin_len); +} + +static void mgmt_print_long_term_key(const void *data) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t key_type = get_u8(data + 7); + uint8_t master = get_u8(data + 8); + uint8_t enc_size = get_u8(data + 9); + const char *str; + + mgmt_print_address(data, address_type); + + switch (key_type) { + case 0x00: + str = "Unauthenticated legacy key"; + break; + case 0x01: + str = "Authenticated legacy key"; + break; + case 0x02: + str = "Unauthenticated key from P-256"; + break; + case 0x03: + str = "Authenticated key from P-256"; + break; + case 0x04: + str = "Debug key from P-256"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Key type: %s (0x%2.2x)", str, key_type); + print_field("Master: 0x%2.2x", master); + print_field("Encryption size: %u", enc_size); + print_hex_field("Diversifier", data + 10, 2); + print_hex_field("Randomizer", data + 12, 8); + print_hex_field("Key", data + 20, 16); +} + +static void mgmt_print_identity_resolving_key(const void *data) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); + print_hex_field("Key", data + 7, 16); +} + +static void mgmt_print_signature_resolving_key(const void *data) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t key_type = get_u8(data + 7); + const char *str; + + mgmt_print_address(data, address_type); + + switch (key_type) { + case 0x00: + str = "Unauthenticated local CSRK"; + break; + case 0x01: + str = "Unauthenticated remote CSRK"; + break; + case 0x02: + str = "Authenticated local CSRK"; + break; + case 0x03: + str = "Authenticated remote CSRK"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Key type: %s (0x%2.2x)", str, key_type); + print_hex_field("Key", data + 8, 16); +} + +static void mgmt_print_oob_data(const void *data) +{ + print_hash_p192(data); + print_randomizer_p192(data + 16); + print_hash_p256(data + 32); + print_randomizer_p256(data + 48); +} + +static void mgmt_null_cmd(const void *data, uint16_t size) +{ +} + +static void mgmt_null_rsp(const void *data, uint16_t size) +{ +} + +static void mgmt_read_version_info_rsp(const void *data, uint16_t size) +{ + uint8_t version; + uint16_t revision; + + version = get_u8(data); + revision = get_le16(data + 1); + + print_field("Version: %u.%u", version, revision); +} + +static void mgmt_print_commands(const void *data, uint16_t num); +static void mgmt_print_events(const void *data, uint16_t num); + +static void mgmt_read_supported_commands_rsp(const void *data, uint16_t size) +{ + uint16_t num_commands = get_le16(data); + uint16_t num_events = get_le16(data + 2); + + if (size - 4 != (num_commands * 2) + (num_events *2)) { + packet_hexdump(data, size); + return; + } + + mgmt_print_commands(data + 4, num_commands); + mgmt_print_events(data + 4 + num_commands * 2, num_events); +} + +static void mgmt_read_index_list_rsp(const void *data, uint16_t size) +{ + uint16_t num_controllers = get_le16(data); + int i; + + print_field("Controllers: %u", num_controllers); + + if (size - 2 != num_controllers * 2) { + packet_hexdump(data + 2, size - 2); + return; + } + + for (i = 0; i < num_controllers; i++) { + uint16_t index = get_le16(data + 2 + (i * 2)); + + print_field(" hci%u", index); + } +} + +static void mgmt_read_controller_info_rsp(const void *data, uint16_t size) +{ + uint8_t version = get_u8(data + 6); + uint16_t manufacturer = get_le16(data + 7); + uint32_t supported_settings = get_le32(data + 9); + uint32_t current_settings = get_le32(data + 13); + + print_addr_resolve("Address", data, 0x00, false); + mgmt_print_version(version); + mgmt_print_manufacturer(manufacturer); + mgmt_print_settings("Supported settings", supported_settings); + mgmt_print_settings("Current settings", current_settings); + print_dev_class(data + 17); + mgmt_print_name(data + 20); +} + +static void mgmt_set_powered_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Powered", enable); +} + +static void mgmt_set_discoverable_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + uint16_t timeout = get_le16(data + 1); + const char *str; + + switch (enable) { + case 0x00: + str = "Disabled"; + break; + case 0x01: + str = "General"; + break; + case 0x02: + str = "Limited"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Discoverable: %s (0x%2.2x)", str, enable); + print_field("Timeout: %u", timeout); +} + +static void mgmt_set_connectable_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Connectable", enable); +} + +static void mgmt_set_fast_connectable_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Fast Connectable", enable); +} + +static void mgmt_set_bondable_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Bondable", enable); +} + +static void mgmt_set_link_security_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Link Security", enable); +} + +static void mgmt_set_secure_simple_pairing_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Secure Simple Pairing", enable); +} + +static void mgmt_set_high_speed_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("High Speed", enable); +} + +static void mgmt_set_low_energy_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Low Energy", enable); +} + +static void mgmt_new_settings_rsp(const void *data, uint16_t size) +{ + uint32_t current_settings = get_le32(data); + + mgmt_print_settings("Current settings", current_settings); +} + +static void mgmt_set_device_class_cmd(const void *data, uint16_t size) +{ + uint8_t major = get_u8(data); + uint8_t minor = get_u8(data + 1); + + print_field("Major class: 0x%2.2x", major); + print_field("Minor class: 0x%2.2x", minor); +} + +static void mgmt_set_device_class_rsp(const void *data, uint16_t size) +{ + print_dev_class(data); +} + +static void mgmt_set_local_name_cmd(const void *data, uint16_t size) +{ + mgmt_print_name(data); +} + +static void mgmt_set_local_name_rsp(const void *data, uint16_t size) +{ + mgmt_print_name(data); +} + +static void mgmt_add_uuid_cmd(const void *data, uint16_t size) +{ + uint8_t service_class = get_u8(data + 16); + + mgmt_print_uuid(data); + print_field("Service class: 0x%2.2x", service_class); +} + +static void mgmt_add_uuid_rsp(const void *data, uint16_t size) +{ + print_dev_class(data); +} + +static void mgmt_remove_uuid_cmd(const void *data, uint16_t size) +{ + mgmt_print_uuid(data); +} + +static void mgmt_remove_uuid_rsp(const void *data, uint16_t size) +{ + print_dev_class(data); +} + +static void mgmt_load_link_keys_cmd(const void *data, uint16_t size) +{ + uint8_t debug_keys = get_u8(data); + uint16_t num_keys = get_le16(data + 1); + int i; + + mgmt_print_enable("Debug keys", debug_keys); + print_field("Keys: %u", num_keys); + + if (size - 3 != num_keys * 25) { + packet_hexdump(data + 3, size - 3); + return; + } + + for (i = 0; i < num_keys; i++) + mgmt_print_link_key(data + 3 + (i * 25)); +} + +static void mgmt_load_long_term_keys_cmd(const void *data, uint16_t size) +{ + uint16_t num_keys = get_le16(data + 1); + int i; + + print_field("Keys: %u", num_keys); + + if (size - 2 != num_keys * 36) { + packet_hexdump(data + 2, size - 2); + return; + } + + for (i = 0; i < num_keys; i++) + mgmt_print_long_term_key(data + 2 + (i * 36)); +} + +static void mgmt_disconnect_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_disconnect_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_get_connections_rsp(const void *data, uint16_t size) +{ + uint16_t num_connections = get_le16(data); + int i; + + print_field("Connections: %u", num_connections); + + if (size - 2 != num_connections * 7) { + packet_hexdump(data + 2, size - 2); + return; + } + + for (i = 0; i < num_connections; i++) { + uint8_t address_type = get_u8(data + 2 + (i * 7) + 6); + + mgmt_print_address(data + 2 + (i * 7), address_type); + } +} + +static void mgmt_pin_code_reply_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t pin_len = get_u8(data + 7); + + mgmt_print_address(data, address_type); + print_field("PIN length: %u", pin_len); + print_hex_field("PIN code", data + 8, 16); +} + +static void mgmt_pin_code_reply_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_pin_code_neg_reply_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_pin_code_neg_reply_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_set_io_capability_cmd(const void *data, uint16_t size) +{ + uint8_t capability = get_u8(data); + + mgmt_print_io_capability(capability); +} + +static void mgmt_pair_device_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t capability = get_u8(data + 7); + + mgmt_print_address(data, address_type); + mgmt_print_io_capability(capability); +} + +static void mgmt_pair_device_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_cancel_pair_device_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_cancel_pair_device_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_unpair_device_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t disconnect = get_u8(data + 7); + + mgmt_print_address(data, address_type); + mgmt_print_enable("Disconnect", disconnect); +} + +static void mgmt_unpair_device_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_user_confirmation_reply_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_user_confirmation_reply_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_user_confirmation_neg_reply_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_user_confirmation_neg_reply_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_user_passkey_reply_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint32_t passkey = get_le32(data + 7); + + mgmt_print_address(data, address_type); + print_field("Passkey: 0x%4.4x", passkey); +} + +static void mgmt_user_passkey_reply_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_user_passkey_neg_reply_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_user_passkey_neg_reply_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_read_local_oob_data_rsp(const void *data, uint16_t size) +{ + mgmt_print_oob_data(data); +} + +static void mgmt_add_remote_oob_data_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); + mgmt_print_oob_data(data + 7); +} + +static void mgmt_add_remote_oob_data_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_remove_remote_oob_data_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_remove_remote_oob_data_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_start_discovery_cmd(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_start_discovery_rsp(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_stop_discovery_cmd(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_stop_discovery_rsp(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_confirm_name_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t name_known = get_u8(data + 7); + const char *str; + + mgmt_print_address(data, address_type); + + switch (name_known) { + case 0x00: + str = "No"; + break; + case 0x01: + str = "Yes"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Name known: %s (0x%2.2x)", str, name_known); +} + +static void mgmt_confirm_name_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_block_device_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_block_device_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_unblock_device_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_unblock_device_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_set_device_id_cmd(const void *data, uint16_t size) +{ + print_device_id(data, size); +} + +static void mgmt_set_advertising_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + const char *str; + + switch (enable) { + case 0x00: + str = "Disabled"; + break; + case 0x01: + str = "Enabled"; + break; + case 0x02: + str = "Connectable"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Advertising: %s (0x%2.2x)", str, enable); +} + +static void mgmt_set_bredr_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("BR/EDR", enable); +} + +static void mgmt_set_static_address_cmd(const void *data, uint16_t size) +{ + print_addr_resolve("Address", data, 0x01, false); +} + +static void mgmt_set_scan_parameters_cmd(const void *data, uint16_t size) +{ + uint16_t interval = get_le16(data); + uint16_t window = get_le16(data + 2); + + print_field("Interval: %u (0x%2.2x)", interval, interval); + print_field("Window: %u (0x%2.2x)", window, window); +} + +static void mgmt_set_secure_connections_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + const char *str; + + switch (enable) { + case 0x00: + str = "Disabled"; + break; + case 0x01: + str = "Enabled"; + break; + case 0x02: + str = "Only"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Secure Connections: %s (0x%2.2x)", str, enable); +} + +static void mgmt_set_debug_keys_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + const char *str; + + switch (enable) { + case 0x00: + str = "Disabled"; + break; + case 0x01: + str = "Enabled"; + break; + case 0x02: + str = "Generate"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Debug Keys: %s (0x%2.2x)", str, enable); +} + +static void mgmt_set_privacy_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + const char *str; + + switch (enable) { + case 0x00: + str = "Disabled"; + break; + case 0x01: + str = "Enabled"; + break; + case 0x02: + str = "Limited"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Privacy: %s (0x%2.2x)", str, enable); + print_hex_field("Key", data + 1, 16); +} + +static void mgmt_load_identity_resolving_keys_cmd(const void *data, uint16_t size) +{ + uint16_t num_keys = get_le16(data + 1); + int i; + + print_field("Keys: %u", num_keys); + + if (size - 2 != num_keys * 23) { + packet_hexdump(data + 2, size - 2); + return; + } + + for (i = 0; i < num_keys; i++) + mgmt_print_identity_resolving_key(data + 2 + (i * 23)); +} + +static void mgmt_get_connection_information_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_get_connection_information_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + int8_t rssi = get_s8(data + 7); + int8_t tx_power = get_s8(data + 8); + int8_t max_tx_power = get_s8(data + 9); + + mgmt_print_address(data, address_type); + print_rssi(rssi); + print_power_level(tx_power, NULL); + print_power_level(max_tx_power, "max"); +} + +static void mgmt_get_clock_information_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_get_clock_information_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint32_t local_clock = get_le32(data + 7); + uint32_t piconet_clock = get_le32(data + 11); + uint16_t accuracy = get_le16(data + 15); + + mgmt_print_address(data, address_type); + print_field("Local clock: 0x%8.8x", local_clock); + print_field("Piconet clock: 0x%8.8x", piconet_clock); + print_field("Accuracy: 0x%4.4x", accuracy); +} + +static void mgmt_add_device_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t action = get_u8(data + 7); + + mgmt_print_address(data, address_type); + mgmt_print_device_action(action); +} + +static void mgmt_add_device_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_remove_device_cmd(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_remove_device_rsp(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_load_connection_parameters_cmd(const void *data, uint16_t size) +{ + uint16_t num_parameters = get_le16(data); + int i; + + print_field("Parameters: %u", num_parameters); + + if (size - 2 != num_parameters * 15) { + packet_hexdump(data + 2, size - 2); + return; + } + + for (i = 0; i < num_parameters; i++) + mgmt_print_connection_parameter(data + 2 + (i * 15)); +} + +static void mgmt_read_unconf_index_list_rsp(const void *data, uint16_t size) +{ + uint16_t num_controllers = get_le16(data); + int i; + + print_field("Controllers: %u", num_controllers); + + if (size - 2 != num_controllers * 2) { + packet_hexdump(data + 2, size - 2); + return; + } + + for (i = 0; i < num_controllers; i++) { + uint16_t index = get_le16(data + 2 + (i * 2)); + + print_field(" hci%u", index); + } +} + +static void mgmt_read_controller_conf_info_rsp(const void *data, uint16_t size) +{ + uint16_t manufacturer = get_le16(data); + uint32_t supported_options = get_le32(data + 2); + uint32_t missing_options = get_le32(data + 6); + + mgmt_print_manufacturer(manufacturer); + mgmt_print_options("Supported options", supported_options); + mgmt_print_options("Missing options", missing_options); +} + +static void mgmt_set_external_configuration_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + mgmt_print_enable("Configuration", enable); +} + +static void mgmt_set_public_address_cmd(const void *data, uint16_t size) +{ + print_addr_resolve("Address", data, 0x00, false); +} + +static void mgmt_new_options_rsp(const void *data, uint16_t size) +{ + uint32_t missing_options = get_le32(data); + + mgmt_print_options("Missing options", missing_options); +} + +static void mgmt_start_service_discovery_cmd(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + int8_t rssi = get_s8(data + 1); + uint16_t num_uuids = get_le16(data + 2); + int i; + + mgmt_print_address_type(type); + print_rssi(rssi); + print_field("UUIDs: %u", num_uuids); + + if (size - 4 != num_uuids * 16) { + packet_hexdump(data + 4, size - 4); + return; + } + + for (i = 0; i < num_uuids; i++) + mgmt_print_uuid(data + 4 + (i * 16)); +} + +static void mgmt_start_service_discovery_rsp(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_read_ext_index_list_rsp(const void *data, uint16_t size) +{ + uint16_t num_controllers = get_le16(data); + int i; + + print_field("Controllers: %u", num_controllers); + + if (size - 2 != num_controllers * 4) { + packet_hexdump(data + 2, size - 2); + return; + } + + for (i = 0; i < num_controllers; i++) { + uint16_t index = get_le16(data + 2 + (i * 4)); + uint8_t type = get_u8(data + 4 + (i * 4)); + uint8_t bus = get_u8(data + 5 + (i * 4)); + const char *str; + + switch (type) { + case 0x00: + str = "Primary"; + break; + case 0x01: + str = "Unconfigured"; + break; + case 0x02: + str = "AMP"; + break; + default: + str = "Reserved"; + break; + } + + print_field(" hci%u (%s,%s)", index, str, hci_bustostr(bus)); + } +} + +static void mgmt_read_local_oob_ext_data_cmd(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_read_local_oob_ext_data_rsp(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + uint16_t data_len = get_le16(data + 1); + + mgmt_print_address_type(type); + print_field("Data length: %u", data_len); + print_eir(data + 3, size - 3, true); +} + +static void mgmt_read_advertising_features_rsp(const void *data, uint16_t size) +{ + uint32_t flags = get_le32(data); + uint8_t adv_data_len = get_u8(data + 4); + uint8_t scan_rsp_len = get_u8(data + 5); + uint8_t max_instances = get_u8(data + 6); + uint8_t num_instances = get_u8(data + 7); + int i; + + mgmt_print_adv_flags(flags); + print_field("Advertising data length: %u", adv_data_len); + print_field("Scan response length: %u", scan_rsp_len); + print_field("Max instances: %u", max_instances); + print_field("Instances: %u", num_instances); + + if (size - 8 != num_instances) { + packet_hexdump(data + 8, size - 8); + return; + } + + for (i = 0; i < num_instances; i++) { + uint8_t instance = get_u8(data + 8 + i); + + print_field(" %u", instance); + } +} + +static void mgmt_add_advertising_cmd(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + uint32_t flags = get_le32(data + 1); + uint16_t duration = get_le16(data + 5); + uint16_t timeout = get_le16(data + 7); + uint8_t adv_data_len = get_u8(data + 9); + uint8_t scan_rsp_len = get_u8(data + 10); + + print_field("Instance: %u", instance); + mgmt_print_adv_flags(flags); + print_field("Duration: %u", duration); + print_field("Timeout: %u", timeout); + print_field("Advertising data length: %u", adv_data_len); + print_eir(data + 11, adv_data_len, false); + print_field("Scan response length: %u", scan_rsp_len); + print_eir(data + 11 + adv_data_len, scan_rsp_len, false); +} + +static void mgmt_add_advertising_rsp(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + + print_field("Instance: %u", instance); +} + +static void mgmt_remove_advertising_cmd(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + + print_field("Instance: %u", instance); +} + +static void mgmt_remove_advertising_rsp(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + + print_field("Instance: %u", instance); +} + +static void mgmt_get_advertising_size_info_cmd(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + uint32_t flags = get_le32(data + 1); + + print_field("Instance: %u", instance); + mgmt_print_adv_flags(flags); +} + +static void mgmt_get_advertising_size_info_rsp(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + uint32_t flags = get_le32(data + 1); + uint8_t adv_data_len = get_u8(data + 5); + uint8_t scan_rsp_len = get_u8(data + 6); + + print_field("Instance: %u", instance); + mgmt_print_adv_flags(flags); + print_field("Advertising data length: %u", adv_data_len); + print_field("Scan response length: %u", scan_rsp_len); +} + +static void mgmt_start_limited_discovery_cmd(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_start_limited_discovery_rsp(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + + mgmt_print_address_type(type); +} + +static void mgmt_read_ext_controller_info_rsp(const void *data, uint16_t size) +{ + uint8_t version = get_u8(data + 6); + uint16_t manufacturer = get_le16(data + 7); + uint32_t supported_settings = get_le32(data + 9); + uint32_t current_settings = get_le32(data + 13); + uint16_t data_len = get_le16(data + 17); + + print_addr_resolve("Address", data, 0x00, false); + mgmt_print_version(version); + mgmt_print_manufacturer(manufacturer); + mgmt_print_settings("Supported settings", supported_settings); + mgmt_print_settings("Current settings", current_settings); + print_field("Data length: %u", data_len); + print_eir(data + 19, size - 19, false); +} + +static void mgmt_set_apperance_cmd(const void *data, uint16_t size) +{ + uint16_t appearance = get_le16(data); + + print_appearance(appearance); +} + +struct mgmt_data { + uint16_t opcode; + const char *str; + void (*func) (const void *data, uint16_t size); + uint16_t size; + bool fixed; + void (*rsp_func) (const void *data, uint16_t size); + uint16_t rsp_size; + bool rsp_fixed; +}; + +static const struct mgmt_data mgmt_command_table[] = { + { 0x0001, "Read Management Version Information", + mgmt_null_cmd, 0, true, + mgmt_read_version_info_rsp, 3, true }, + { 0x0002, "Read Management Supported Commands", + mgmt_null_cmd, 0, true, + mgmt_read_supported_commands_rsp, 4, false }, + { 0x0003, "Read Controller Index List", + mgmt_null_cmd, 0, true, + mgmt_read_index_list_rsp, 2, false }, + { 0x0004, "Read Controller Information", + mgmt_null_cmd, 0, true, + mgmt_read_controller_info_rsp, 280, true }, + { 0x0005, "Set Powered", + mgmt_set_powered_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x0006, "Set Discoverable", + mgmt_set_discoverable_cmd, 3, true, + mgmt_new_settings_rsp, 4, true }, + { 0x0007, "Set Connectable", + mgmt_set_connectable_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x0008, "Set Fast Connectable", + mgmt_set_fast_connectable_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x0009, "Set Bondable", + mgmt_set_bondable_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x000a, "Set Link Security", + mgmt_set_link_security_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x000b, "Set Secure Simple Pairing", + mgmt_set_secure_simple_pairing_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x000c, "Set High Speed", + mgmt_set_high_speed_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x000d, "Set Low Energy", + mgmt_set_low_energy_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x000e, "Set Device Class", + mgmt_set_device_class_cmd, 2, true, + mgmt_set_device_class_rsp, 3, true }, + { 0x000f, "Set Local Name", + mgmt_set_local_name_cmd, 260, true, + mgmt_set_local_name_rsp, 260, true }, + { 0x0010, "Add UUID", + mgmt_add_uuid_cmd, 17, true, + mgmt_add_uuid_rsp, 3, true }, + { 0x0011, "Remove UUID", + mgmt_remove_uuid_cmd, 16, true, + mgmt_remove_uuid_rsp, 3, true }, + { 0x0012, "Load Link Keys", + mgmt_load_link_keys_cmd, 3, false, + mgmt_null_rsp, 0, true }, + { 0x0013, "Load Long Term Keys", + mgmt_load_long_term_keys_cmd, 2, false, + mgmt_null_rsp, 0, true }, + { 0x0014, "Disconnect", + mgmt_disconnect_cmd, 7, true, + mgmt_disconnect_rsp, 7, true }, + { 0x0015, "Get Connections", + mgmt_null_cmd, 0, true, + mgmt_get_connections_rsp, 2, false }, + { 0x0016, "PIN Code Reply", + mgmt_pin_code_reply_cmd, 24, true, + mgmt_pin_code_reply_rsp, 7, true }, + { 0x0017, "PIN Code Negative Reply", + mgmt_pin_code_neg_reply_cmd, 7, true, + mgmt_pin_code_neg_reply_rsp, 7, true }, + { 0x0018, "Set IO Capability", + mgmt_set_io_capability_cmd, 1, true, + mgmt_null_rsp, 0, true }, + { 0x0019, "Pair Device", + mgmt_pair_device_cmd, 8, true, + mgmt_pair_device_rsp, 7, true }, + { 0x001a, "Cancel Pair Device", + mgmt_cancel_pair_device_cmd, 7, true, + mgmt_cancel_pair_device_rsp, 7, true }, + { 0x001b, "Unpair Device", + mgmt_unpair_device_cmd, 8, true, + mgmt_unpair_device_rsp, 7, true }, + { 0x001c, "User Confirmation Reply", + mgmt_user_confirmation_reply_cmd, 7, true, + mgmt_user_confirmation_reply_rsp, 7, true }, + { 0x001d, "User Confirmation Negative Reply", + mgmt_user_confirmation_neg_reply_cmd, 7, true, + mgmt_user_confirmation_neg_reply_rsp, 7, true }, + { 0x001e, "User Passkey Reply", + mgmt_user_passkey_reply_cmd, 11, true, + mgmt_user_passkey_reply_rsp, 7, true }, + { 0x001f, "User Passkey Negative Reply", + mgmt_user_passkey_neg_reply_cmd, 7, true, + mgmt_user_passkey_neg_reply_rsp, 7, true }, + { 0x0020, "Read Local Out Of Band Data", + mgmt_null_cmd, 0, true, + mgmt_read_local_oob_data_rsp, 64, true }, + { 0x0021, "Add Remote Out Of Band Data", + mgmt_add_remote_oob_data_cmd, 71, true, + mgmt_add_remote_oob_data_rsp, 7, true }, + { 0x0022, "Remove Remote Out Of Band Data", + mgmt_remove_remote_oob_data_cmd, 7, true, + mgmt_remove_remote_oob_data_rsp, 7, true }, + { 0x0023, "Start Discovery", + mgmt_start_discovery_cmd, 1, true, + mgmt_start_discovery_rsp, 1, true }, + { 0x0024, "Stop Discovery", + mgmt_stop_discovery_cmd, 1, true, + mgmt_stop_discovery_rsp, 1, true }, + { 0x0025, "Confirm Name", + mgmt_confirm_name_cmd, 8, true, + mgmt_confirm_name_rsp, 7, true }, + { 0x0026, "Block Device", + mgmt_block_device_cmd, 7, true, + mgmt_block_device_rsp, 7, true }, + { 0x0027, "Unblock Device", + mgmt_unblock_device_cmd, 7, true, + mgmt_unblock_device_rsp, 7, true }, + { 0x0028, "Set Device ID", + mgmt_set_device_id_cmd, 8, true, + mgmt_null_rsp, 0, true }, + { 0x0029, "Set Advertising", + mgmt_set_advertising_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x002a, "Set BR/EDR", + mgmt_set_bredr_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x002b, "Set Static Address", + mgmt_set_static_address_cmd, 6, true, + mgmt_new_settings_rsp, 4, true }, + { 0x002c, "Set Scan Parameters", + mgmt_set_scan_parameters_cmd, 4, true, + mgmt_null_rsp, 0, true }, + { 0x002d, "Set Secure Connections", + mgmt_set_secure_connections_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x002e, "Set Debug Keys", + mgmt_set_debug_keys_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, + { 0x002f, "Set Privacy", + mgmt_set_privacy_cmd, 17, true, + mgmt_new_settings_rsp, 4, true }, + { 0x0030, "Load Identity Resolving Keys", + mgmt_load_identity_resolving_keys_cmd, 2, false, + mgmt_null_rsp, 0, true }, + { 0x0031, "Get Connection Information", + mgmt_get_connection_information_cmd, 7, true, + mgmt_get_connection_information_rsp, 10, true }, + { 0x0032, "Get Clock Information", + mgmt_get_clock_information_cmd, 7, true, + mgmt_get_clock_information_rsp, 17, true }, + { 0x0033, "Add Device", + mgmt_add_device_cmd, 8, true, + mgmt_add_device_rsp, 7, true }, + { 0x0034, "Remove Device", + mgmt_remove_device_cmd, 7, true, + mgmt_remove_device_rsp, 7, true }, + { 0x0035, "Load Connection Parameters", + mgmt_load_connection_parameters_cmd, 2, false, + mgmt_null_rsp, 0, true }, + { 0x0036, "Read Unconfigured Controller Index List", + mgmt_null_cmd, 0, true, + mgmt_read_unconf_index_list_rsp, 2, false }, + { 0x0037, "Read Controller Configuration Information", + mgmt_null_cmd, 0, true, + mgmt_read_controller_conf_info_rsp, 10, true }, + { 0x0038, "Set External Configuration", + mgmt_set_external_configuration_cmd, 1, true, + mgmt_new_options_rsp, 4, true }, + { 0x0039, "Set Public Address", + mgmt_set_public_address_cmd, 6, true, + mgmt_new_options_rsp, 4, true }, + { 0x003a, "Start Service Discovery", + mgmt_start_service_discovery_cmd, 3, false, + mgmt_start_service_discovery_rsp, 1, true }, + { 0x003b, "Read Local Out Of Band Extended Data", + mgmt_read_local_oob_ext_data_cmd, 1, true, + mgmt_read_local_oob_ext_data_rsp, 3, false }, + { 0x003c, "Read Extended Controller Index List", + mgmt_null_cmd, 0, true, + mgmt_read_ext_index_list_rsp, 2, false }, + { 0x003d, "Read Advertising Features", + mgmt_null_cmd, 0, true, + mgmt_read_advertising_features_rsp, 8, false }, + { 0x003e, "Add Advertising", + mgmt_add_advertising_cmd, 11, false, + mgmt_add_advertising_rsp, 1, true }, + { 0x003f, "Remove Advertising", + mgmt_remove_advertising_cmd, 1, true, + mgmt_remove_advertising_rsp, 1, true }, + { 0x0040, "Get Advertising Size Information", + mgmt_get_advertising_size_info_cmd, 5, true, + mgmt_get_advertising_size_info_rsp, 7, true }, + { 0x0041, "Start Limited Discovery", + mgmt_start_limited_discovery_cmd, 1, true, + mgmt_start_limited_discovery_rsp, 1, true }, + { 0x0042, "Read Extended Controller Information", + mgmt_null_cmd, 0, true, + mgmt_read_ext_controller_info_rsp, 19, false }, + { 0x0043, "Set Appearance", + mgmt_set_apperance_cmd, 2, true, + mgmt_null_rsp, 0, true }, + { } +}; + +static void mgmt_null_evt(const void *data, uint16_t size) +{ +} + +static void mgmt_command_complete_evt(const void *data, uint16_t size) +{ + uint16_t opcode; + uint8_t status; + const struct mgmt_data *mgmt_data = NULL; + const char *mgmt_color, *mgmt_str; + int i; + + opcode = get_le16(data); + status = get_u8(data + 2); + + data += 3; + size -= 3; + + for (i = 0; mgmt_command_table[i].str; i++) { + if (mgmt_command_table[i].opcode == opcode) { + mgmt_data = &mgmt_command_table[i]; + break; + } + } + + if (mgmt_data) { + if (mgmt_data->rsp_func) + mgmt_color = COLOR_CTRL_COMMAND; + else + mgmt_color = COLOR_CTRL_COMMAND_UNKNOWN; + mgmt_str = mgmt_data->str; + } else { + mgmt_color = COLOR_CTRL_COMMAND_UNKNOWN; + mgmt_str = "Unknown"; + } + + print_indent(6, mgmt_color, "", mgmt_str, COLOR_OFF, + " (0x%4.4x) plen %u", opcode, size); + + mgmt_print_status(status); + + if (!mgmt_data || !mgmt_data->rsp_func) { + packet_hexdump(data, size); + return; + } + + if (mgmt_data->rsp_fixed) { + if (size != mgmt_data->rsp_size) { + print_text(COLOR_ERROR, "invalid packet size"); + packet_hexdump(data, size); + return; + } + } else { + if (size < mgmt_data->rsp_size) { + print_text(COLOR_ERROR, "too short packet"); + packet_hexdump(data, size); + return; + } + } + + mgmt_data->rsp_func(data, size); +} + +static void mgmt_command_status_evt(const void *data, uint16_t size) +{ + uint16_t opcode; + uint8_t status; + const struct mgmt_data *mgmt_data = NULL; + const char *mgmt_color, *mgmt_str; + int i; + + opcode = get_le16(data); + status = get_u8(data + 2); + + for (i = 0; mgmt_command_table[i].str; i++) { + if (mgmt_command_table[i].opcode == opcode) { + mgmt_data = &mgmt_command_table[i]; + break; + } + } + + if (mgmt_data) { + mgmt_color = COLOR_CTRL_COMMAND; + mgmt_str = mgmt_data->str; + } else { + mgmt_color = COLOR_CTRL_COMMAND_UNKNOWN; + mgmt_str = "Unknown"; + } + + print_indent(6, mgmt_color, "", mgmt_str, COLOR_OFF, + " (0x%4.4x)", opcode); + + mgmt_print_status(status); +} + +static void mgmt_controller_error_evt(const void *data, uint16_t size) +{ + uint8_t error = get_u8(data); + + print_field("Error: 0x%2.2x", error); +} + +static void mgmt_new_settings_evt(const void *data, uint16_t size) +{ + uint32_t settings = get_le32(data); + + mgmt_print_settings("Current settings", settings); +} + +static void mgmt_class_of_dev_changed_evt(const void *data, uint16_t size) +{ + print_dev_class(data); +} + +static void mgmt_local_name_changed_evt(const void *data, uint16_t size) +{ + mgmt_print_name(data); +} + +static void mgmt_new_link_key_evt(const void *data, uint16_t size) +{ + uint8_t store_hint = get_u8(data); + + mgmt_print_store_hint(store_hint); + mgmt_print_link_key(data + 1); +} + +static void mgmt_new_long_term_key_evt(const void *data, uint16_t size) +{ + uint8_t store_hint = get_u8(data); + + mgmt_print_store_hint(store_hint); + mgmt_print_long_term_key(data + 1); +} + +static void mgmt_device_connected_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint32_t flags = get_le32(data + 7); + uint16_t data_len = get_le16(data + 11); + + mgmt_print_address(data, address_type); + mgmt_print_device_flags(flags); + print_field("Data length: %u", data_len); + print_eir(data + 13, size - 13, false); +} + +static void mgmt_device_disconnected_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t reason = get_u8(data + 7); + const char *str; + + mgmt_print_address(data, address_type); + + switch (reason) { + case 0x00: + str = "Unspecified"; + break; + case 0x01: + str = "Connection timeout"; + break; + case 0x02: + str = "Connection terminated by local host"; + break; + case 0x03: + str = "Connection terminated by remote host"; + break; + case 0x04: + str = "Connection terminated due to authentication failure"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Reason: %s (0x%2.2x)", str, reason); +} + +static void mgmt_connect_failed_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t status = get_u8(data + 7); + + mgmt_print_address(data, address_type); + mgmt_print_status(status); +} + +static void mgmt_pin_code_request_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t secure_pin = get_u8(data + 7); + + mgmt_print_address(data, address_type); + print_field("Secure PIN: 0x%2.2x", secure_pin); +} + +static void mgmt_user_confirmation_request_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t confirm_hint = get_u8(data + 7); + uint32_t value = get_le32(data + 8); + + mgmt_print_address(data, address_type); + print_field("Confirm hint: 0x%2.2x", confirm_hint); + print_field("Value: 0x%8.8x", value); +} + +static void mgmt_user_passkey_request_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_authentication_failed_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t status = get_u8(data + 7); + + mgmt_print_address(data, address_type); + mgmt_print_status(status); +} + +static void mgmt_device_found_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + int8_t rssi = get_s8(data + 7); + uint32_t flags = get_le32(data + 8); + uint16_t data_len = get_le16(data + 12); + + mgmt_print_address(data, address_type); + print_rssi(rssi); + mgmt_print_device_flags(flags); + print_field("Data length: %u", data_len); + print_eir(data + 14, size - 14, false); +} + +static void mgmt_discovering_evt(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + uint8_t enable = get_u8(data + 1); + + mgmt_print_address_type(type); + mgmt_print_enable("Discovery", enable); +} + +static void mgmt_device_blocked_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_device_unblocked_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_device_unpaired_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_passkey_notify_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint32_t passkey = get_le32(data + 7); + uint8_t entered = get_u8(data + 11); + + mgmt_print_address(data, address_type); + print_field("Passkey: 0x%8.8x", passkey); + print_field("Entered: %u", entered); +} + +static void mgmt_new_identity_resolving_key_evt(const void *data, uint16_t size) +{ + uint8_t store_hint = get_u8(data); + + mgmt_print_store_hint(store_hint); + print_addr_resolve("Random address", data + 1, 0x01, false); + mgmt_print_identity_resolving_key(data + 7); +} + +static void mgmt_new_signature_resolving_key_evt(const void *data, uint16_t size) +{ + uint8_t store_hint = get_u8(data); + + mgmt_print_store_hint(store_hint); + mgmt_print_signature_resolving_key(data + 1); +} + +static void mgmt_device_added_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + uint8_t action = get_u8(data + 7); + + mgmt_print_address(data, address_type); + mgmt_print_device_action(action); +} + +static void mgmt_device_removed_evt(const void *data, uint16_t size) +{ + uint8_t address_type = get_u8(data + 6); + + mgmt_print_address(data, address_type); +} + +static void mgmt_new_connection_parameter_evt(const void *data, uint16_t size) +{ + uint8_t store_hint = get_u8(data); + + mgmt_print_store_hint(store_hint); + mgmt_print_connection_parameter(data + 1); +} + +static void mgmt_new_conf_options_evt(const void *data, uint16_t size) +{ + uint32_t missing_options = get_le32(data); + + mgmt_print_options("Missing options", missing_options); +} + +static void mgmt_ext_index_added_evt(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + uint8_t bus = get_u8(data + 1); + + print_field("type 0x%2.2x - bus 0x%2.2x", type, bus); +} + +static void mgmt_ext_index_removed_evt(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + uint8_t bus = get_u8(data + 1); + + print_field("type 0x%2.2x - bus 0x%2.2x", type, bus); +} + +static void mgmt_local_oob_ext_data_updated_evt(const void *data, uint16_t size) +{ + uint8_t type = get_u8(data); + uint16_t data_len = get_le16(data + 1); + + mgmt_print_address_type(type); + print_field("Data length: %u", data_len); + print_eir(data + 3, size - 3, true); +} + +static void mgmt_advertising_added_evt(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + + print_field("Instance: %u", instance); +} + +static void mgmt_advertising_removed_evt(const void *data, uint16_t size) +{ + uint8_t instance = get_u8(data); + + print_field("Instance: %u", instance); +} + +static void mgmt_ext_controller_info_changed_evt(const void *data, uint16_t size) +{ + uint16_t data_len = get_le16(data); + + print_field("Data length: %u", data_len); + print_eir(data + 2, size - 2, false); +} + +static const struct mgmt_data mgmt_event_table[] = { + { 0x0001, "Command Complete", + mgmt_command_complete_evt, 3, false }, + { 0x0002, "Command Status", + mgmt_command_status_evt, 3, true }, + { 0x0003, "Controller Error", + mgmt_controller_error_evt, 1, true }, + { 0x0004, "Index Added", + mgmt_null_evt, 0, true }, + { 0x0005, "Index Removed", + mgmt_null_evt, 0, true }, + { 0x0006, "New Settings", + mgmt_new_settings_evt, 4, true }, + { 0x0007, "Class Of Device Changed", + mgmt_class_of_dev_changed_evt, 3, true }, + { 0x0008, "Local Name Changed", + mgmt_local_name_changed_evt, 260, true }, + { 0x0009, "New Link Key", + mgmt_new_link_key_evt, 26, true }, + { 0x000a, "New Long Term Key", + mgmt_new_long_term_key_evt, 37, true }, + { 0x000b, "Device Connected", + mgmt_device_connected_evt, 13, false }, + { 0x000c, "Device Disconnected", + mgmt_device_disconnected_evt, 8, true }, + { 0x000d, "Connect Failed", + mgmt_connect_failed_evt, 8, true }, + { 0x000e, "PIN Code Request", + mgmt_pin_code_request_evt, 8, true }, + { 0x000f, "User Confirmation Request", + mgmt_user_confirmation_request_evt, 12, true }, + { 0x0010, "User Passkey Request", + mgmt_user_passkey_request_evt, 7, true }, + { 0x0011, "Authentication Failed", + mgmt_authentication_failed_evt, 8, true }, + { 0x0012, "Device Found", + mgmt_device_found_evt, 14, false }, + { 0x0013, "Discovering", + mgmt_discovering_evt, 2, true }, + { 0x0014, "Device Blocked", + mgmt_device_blocked_evt, 7, true }, + { 0x0015, "Device Unblocked", + mgmt_device_unblocked_evt, 7, true }, + { 0x0016, "Device Unpaired", + mgmt_device_unpaired_evt, 7, true }, + { 0x0017, "Passkey Notify", + mgmt_passkey_notify_evt, 12, true }, + { 0x0018, "New Identity Resolving Key", + mgmt_new_identity_resolving_key_evt, 30, true }, + { 0x0019, "New Signature Resolving Key", + mgmt_new_signature_resolving_key_evt, 25, true }, + { 0x001a, "Device Added", + mgmt_device_added_evt, 8, true }, + { 0x001b, "Device Removed", + mgmt_device_removed_evt, 7, true }, + { 0x001c, "New Connection Parameter", + mgmt_new_connection_parameter_evt, 16, true }, + { 0x001d, "Unconfigured Index Added", + mgmt_null_evt, 0, true }, + { 0x001e, "Unconfigured Index Removed", + mgmt_null_evt, 0, true }, + { 0x001f, "New Configuration Options", + mgmt_new_conf_options_evt, 4, true }, + { 0x0020, "Extended Index Added", + mgmt_ext_index_added_evt, 2, true }, + { 0x0021, "Extended Index Removed", + mgmt_ext_index_removed_evt, 2, true }, + { 0x0022, "Local Out Of Band Extended Data Updated", + mgmt_local_oob_ext_data_updated_evt, 3, false }, + { 0x0023, "Advertising Added", + mgmt_advertising_added_evt, 1, true }, + { 0x0024, "Advertising Removed", + mgmt_advertising_removed_evt, 1, true }, + { 0x0025, "Extended Controller Information Changed", + mgmt_ext_controller_info_changed_evt, 2, false }, + { } +}; + +static void mgmt_print_commands(const void *data, uint16_t num) +{ + int i; + + print_field("Commands: %u", num); + + for (i = 0; i < num; i++) { + uint16_t opcode = get_le16(data + (i * 2)); + const char *str = NULL; + int n; + + for (n = 0; mgmt_command_table[n].str; n++) { + if (mgmt_command_table[n].opcode == opcode) { + str = mgmt_command_table[n].str; + break; + } + } + + print_field(" %s (0x%4.4x)", str ?: "Reserved", opcode); + } +} + +static void mgmt_print_events(const void *data, uint16_t num) +{ + int i; + + print_field("Events: %u", num); + + for (i = 0; i < num; i++) { + uint16_t opcode = get_le16(data + (i * 2)); + const char *str = NULL; + int n; + + for (n = 0; mgmt_event_table[n].str; n++) { + if (mgmt_event_table[n].opcode == opcode) { + str = mgmt_event_table[n].str; + break; + } + } + + print_field(" %s (0x%4.4x)", str ?: "Reserved", opcode); + } +} + +void packet_ctrl_command(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size) +{ + uint32_t cookie; + uint16_t format, opcode; + const struct mgmt_data *mgmt_data = NULL; + const char *mgmt_color, *mgmt_str; + char channel[11], extra_str[25]; + int i; + + if (size < 4) { + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, + "Malformed Control Command packet", NULL, NULL); + packet_hexdump(data, size); + return; + } + + cookie = get_le32(data); + + data += 4; + size -= 4; + + sprintf(channel, "0x%4.4x", cookie); + + format = get_format(cookie); + + if (format != CTRL_MGMT) { + char label[7]; + + sprintf(label, "0x%4.4x", format); + + print_packet(tv, cred, '@', index, channel, COLOR_CTRL_CLOSE, + "Control Command", label, NULL); + packet_hexdump(data, size); + return; + } + + if (size < 2) { + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, + "Malformed MGMT Command packet", NULL, NULL); + packet_hexdump(data, size); + return; + } + + opcode = get_le16(data); + + data += 2; + size -= 2; + + for (i = 0; mgmt_command_table[i].str; i++) { + if (mgmt_command_table[i].opcode == opcode) { + mgmt_data = &mgmt_command_table[i]; + break; + } + } + + if (mgmt_data) { + if (mgmt_data->func) + mgmt_color = COLOR_CTRL_COMMAND; + else + mgmt_color = COLOR_CTRL_COMMAND_UNKNOWN; + mgmt_str = mgmt_data->str; + } else { + mgmt_color = COLOR_CTRL_COMMAND_UNKNOWN; + mgmt_str = "Unknown"; + } + + sprintf(extra_str, "(0x%4.4x) plen %d", opcode, size); + + print_packet(tv, cred, '@', index, channel, mgmt_color, + "MGMT Command", mgmt_str, extra_str); + + if (!mgmt_data || !mgmt_data->func) { + packet_hexdump(data, size); + return; + } + + if (mgmt_data->fixed) { + if (size != mgmt_data->size) { + print_text(COLOR_ERROR, "invalid packet size"); + packet_hexdump(data, size); + return; + } + } else { + if (size < mgmt_data->size) { + print_text(COLOR_ERROR, "too short packet"); + packet_hexdump(data, size); + return; + } + } + + mgmt_data->func(data, size); +} + +void packet_ctrl_event(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size) +{ + uint32_t cookie; + uint16_t format, opcode; + const struct mgmt_data *mgmt_data = NULL; + const char *mgmt_color, *mgmt_str; + char channel[11], extra_str[25]; + int i; + + if (size < 4) { + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, + "Malformed Control Event packet", NULL, NULL); + packet_hexdump(data, size); + return; + } + + cookie = get_le32(data); + + data += 4; + size -= 4; + + sprintf(channel, "0x%4.4x", cookie); + + format = get_format(cookie); + + if (format != CTRL_MGMT) { + char label[7]; + + sprintf(label, "0x%4.4x", format); + + print_packet(tv, cred, '@', index, channel, COLOR_CTRL_CLOSE, + "Control Event", label, NULL); + packet_hexdump(data, size); + return; + } + + if (size < 2) { + print_packet(tv, cred, '*', index, NULL, COLOR_ERROR, + "Malformed MGMT Event packet", NULL, NULL); + packet_hexdump(data, size); + return; + } + + opcode = get_le16(data); + + data += 2; + size -= 2; + + for (i = 0; mgmt_event_table[i].str; i++) { + if (mgmt_event_table[i].opcode == opcode) { + mgmt_data = &mgmt_event_table[i]; + break; + } + } + + if (mgmt_data) { + if (mgmt_data->func) + mgmt_color = COLOR_CTRL_EVENT; + else + mgmt_color = COLOR_CTRL_EVENT_UNKNOWN; + mgmt_str = mgmt_data->str; + } else { + mgmt_color = COLOR_CTRL_EVENT_UNKNOWN; + mgmt_str = "Unknown"; + } + + sprintf(extra_str, "(0x%4.4x) plen %d", opcode, size); + + print_packet(tv, cred, '@', index, channel, mgmt_color, + "MGMT Event", mgmt_str, extra_str); + + if (!mgmt_data || !mgmt_data->func) { + packet_hexdump(data, size); + return; + } + + if (mgmt_data->fixed) { + if (size != mgmt_data->size) { + print_text(COLOR_ERROR, "invalid packet size"); + packet_hexdump(data, size); + return; + } + } else { + if (size < mgmt_data->size) { + print_text(COLOR_ERROR, "too short packet"); + packet_hexdump(data, size); + return; + } + } + + mgmt_data->func(data, size); +} + +void packet_todo(void) +{ + int i; + + printf("HCI commands with missing decodings:\n"); + + for (i = 0; opcode_table[i].str; i++) { + if (opcode_table[i].bit < 0) + continue; + + if (opcode_table[i].cmd_func) + continue; + + printf("\t%s\n", opcode_table[i].str); + } + + printf("HCI events with missing decodings:\n"); + + for (i = 0; event_table[i].str; i++) { + if (event_table[i].func) + continue; + + printf("\t%s\n", event_table[i].str); + } + + for (i = 0; le_meta_event_table[i].str; i++) { + if (le_meta_event_table[i].func) + continue; + + printf("\t%s\n", le_meta_event_table[i].str); + } } -#endif diff --git a/monitor/packet.h b/monitor/packet.h old mode 100644 new mode 100755 index 2bb4a63..354f4fe --- a/monitor/packet.h +++ b/monitor/packet.h @@ -89,12 +89,13 @@ void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index, void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index, bool in, const void *data, uint16_t size); -void packet_todo(void); +void packet_ctrl_open(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size); +void packet_ctrl_close(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size); +void packet_ctrl_command(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size); +void packet_ctrl_event(struct timeval *tv, struct ucred *cred, uint16_t index, + const void *data, uint16_t size); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void print_le_set_adv_parameters_cmd(const void *data, uint8_t size); -void print_le_set_random_address_cmd(const void *data, uint8_t size); -void print_le_set_adv_data_cmd(const void *data, uint8_t size); -void print_le_set_scan_rsp_data_cmd(const void *data, uint8_t size); -void print_le_set_adv_enable_cmd(const void *data, uint8_t size); -#endif +void packet_todo(void); diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c old mode 100644 new mode 100755 diff --git a/monitor/rfcomm.h b/monitor/rfcomm.h old mode 100644 new mode 100755 diff --git a/monitor/sdp.c b/monitor/sdp.c old mode 100644 new mode 100755 diff --git a/monitor/sdp.h b/monitor/sdp.h old mode 100644 new mode 100755 diff --git a/android/dis.h b/monitor/tty.h similarity index 61% rename from android/dis.h rename to monitor/tty.h index faf27b3..f0ba0c5 100755 --- a/android/dis.h +++ b/monitor/tty.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2014 Intel Corporation. All rights reserved. + * Copyright (C) 2016 Intel Corporation * * * This library is free software; you can redistribute it and/or @@ -21,19 +21,21 @@ * */ -struct bt_dis; +#include -struct bt_dis *bt_dis_new(void *primary); +struct tty_hdr { + uint16_t data_len; + uint16_t opcode; + uint8_t flags; + uint8_t hdr_len; + uint8_t ext_hdr[0]; +} __attribute__ ((packed)); -struct bt_dis *bt_dis_ref(struct bt_dis *dis); -void bt_dis_unref(struct bt_dis *dis); - -bool bt_dis_attach(struct bt_dis *dis, void *gatt); -void bt_dis_detach(struct bt_dis *dis); - -typedef void (*bt_dis_notify) (uint8_t source, uint16_t vendor, - uint16_t product, uint16_t version, - void *user_data); - -bool bt_dis_set_notification(struct bt_dis *dis, bt_dis_notify func, - void *user_data); +#define TTY_EXTHDR_COMMAND_DROPS 1 +#define TTY_EXTHDR_EVENT_DROPS 2 +#define TTY_EXTHDR_ACL_TX_DROPS 3 +#define TTY_EXTHDR_ACL_RX_DROPS 4 +#define TTY_EXTHDR_SCO_TX_DROPS 5 +#define TTY_EXTHDR_SCO_RX_DROPS 6 +#define TTY_EXTHDR_OTHER_DROPS 7 +#define TTY_EXTHDR_TS32 8 diff --git a/monitor/uuid.c b/monitor/uuid.c old mode 100644 new mode 100755 index 90e35e1..6660bc7 --- a/monitor/uuid.c +++ b/monitor/uuid.c @@ -31,7 +31,7 @@ #include "uuid.h" -static struct { +static const struct { uint16_t uuid; const char *str; } uuid16_table[] = { @@ -169,7 +169,7 @@ static struct { { 0x1823, "HTTP Proxy" }, { 0x1824, "Transport Discovery" }, { 0x1825, "Object Transfer" }, - /* 0x1826 to 0x27ff undefined */ + /* 0x1824 to 0x27ff undefined */ { 0x2800, "Primary Service" }, { 0x2801, "Secondary Service" }, { 0x2802, "Include" }, @@ -500,8 +500,8 @@ static struct { { 0xfe8a, "Apple, Inc." }, { 0xfe89, "B&O Play A/S" }, { 0xfe88, "SALTO SYSTEMS S.L." }, - { 0xfe87, "Qingdao Yeelink Information Technology Co., Ltd. ( ?’岛亿联客信?????œ‰?å…¬??)" }, - { 0xfe86, "HUAWEI Technologies Co., Ltd. ( ?Žä¸º?€??œ‰?å…¬??)" }, + { 0xfe87, "Qingdao Yeelink Information Technology Co., Ltd. ( 青岛亿联客信息技术有限公司 )" }, + { 0xfe86, "HUAWEI Technologies Co., Ltd. ( 华为技术有限公司 )" }, { 0xfe85, "RF Digital Corp" }, { 0xfe84, "RF Digital Corp" }, { 0xfe83, "Blue Bite" }, @@ -513,12 +513,58 @@ static struct { { 0xfe7d, "Aterica Health Inc." }, { 0xfe7c, "Stollmann E+V GmbH" }, { 0xfe7b, "Orion Labs, Inc." }, + { 0xfe7a, "Bragi GmbH" }, + { 0xfe79, "Zebra Technologies" }, + { 0xfe78, "Hewlett-Packard Company" }, + { 0xfe77, "Hewlett-Packard Company" }, + { 0xfe76, "TangoMe" }, + { 0xfe75, "TangoMe" }, + { 0xfe74, "unwire" }, + { 0xfe73, "St. Jude Medical, Inc." }, + { 0xfe72, "St. Jude Medical, Inc." }, + { 0xfe71, "Plume Design Inc" }, + { 0xfe70, "Beijing Jingdong Century Trading Co., Ltd." }, + { 0xfe6f, "LINE Corporation" }, + { 0xfe6e, "The University of Tokyo" }, + { 0xfe6d, "The University of Tokyo" }, + { 0xfe6c, "TASER International, Inc." }, + { 0xfe6b, "TASER International, Inc." }, + { 0xfe6a, "Kontakt Micro-Location Sp. z o.o." }, + { 0xfe69, "Qualcomm Life Inc" }, + { 0xfe68, "Qualcomm Life Inc" }, + { 0xfe67, "Lab Sensor Solutions" }, + { 0xfe66, "Intel Corporation" }, /* SDO defined */ { 0xfffe, "Alliance for Wireless Power (A4WP)" }, { 0xfffd, "Fast IDentity Online Alliance (FIDO)" }, { } }; +static const struct { + const char *uuid; + const char *str; +} uuid128_table[] = { + { "a3c87500-8ed3-4bdf-8a39-a01bebede295", + "Eddystone Configuration Service" }, + { "a3c87501-8ed3-4bdf-8a39-a01bebede295", "Capabilities" }, + { "a3c87502-8ed3-4bdf-8a39-a01bebede295", "Active Slot" }, + { "a3c87503-8ed3-4bdf-8a39-a01bebede295", + "Advertising Interval" }, + { "a3c87504-8ed3-4bdf-8a39-a01bebede295", "Radio Tx Power" }, + { "a3c87505-8ed3-4bdf-8a39-a01bebede295", + "(Advanced) Advertised Tx Power" }, + { "a3c87506-8ed3-4bdf-8a39-a01bebede295", "Lock State" }, + { "a3c87507-8ed3-4bdf-8a39-a01bebede295", "Unlock" }, + { "a3c87508-8ed3-4bdf-8a39-a01bebede295", "Public ECDH Key" }, + { "a3c87509-8ed3-4bdf-8a39-a01bebede295", "EID Identity Key" }, + { "a3c8750a-8ed3-4bdf-8a39-a01bebede295", "ADV Slot Data" }, + { "a3c8750b-8ed3-4bdf-8a39-a01bebede295", + "(Advanced) Factory reset" }, + { "a3c8750c-8ed3-4bdf-8a39-a01bebede295", + "(Advanced) Remain Connectable" }, + { } +}; + const char *uuid16_to_str(uint16_t uuid) { int i; @@ -539,14 +585,10 @@ const char *uuid32_to_str(uint32_t uuid) return "Unknown"; } -const char *uuid128_to_str(const unsigned char *uuid) -{ - return "Unknown"; -} - const char *uuidstr_to_str(const char *uuid) { uint32_t val; + int i; if (!uuid) return NULL; @@ -554,6 +596,11 @@ const char *uuidstr_to_str(const char *uuid) if (strlen(uuid) != 36) return NULL; + for (i = 0; uuid128_table[i].str; i++) { + if (strcasecmp(uuid128_table[i].uuid, uuid) == 0) + return uuid128_table[i].str; + } + if (strncasecmp(uuid + 8, "-0000-1000-8000-00805f9b34fb", 28)) return "Vendor specific"; diff --git a/monitor/uuid.h b/monitor/uuid.h old mode 100644 new mode 100755 index f467f51..22d2363 --- a/monitor/uuid.h +++ b/monitor/uuid.h @@ -24,8 +24,8 @@ #include +#define MAX_LEN_UUID_STR 37 + const char *uuid16_to_str(uint16_t uuid); const char *uuid32_to_str(uint32_t uuid); -const char *uuid128_to_str(const unsigned char *uuid); - const char *uuidstr_to_str(const char *uuid); diff --git a/monitor/vendor.c b/monitor/vendor.c old mode 100644 new mode 100755 diff --git a/monitor/vendor.h b/monitor/vendor.h old mode 100644 new mode 100755 diff --git a/obexd.manifest b/obexd.manifest deleted file mode 100644 index 371976f..0000000 --- a/obexd.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c old mode 100644 new mode 100755 index 20a4904..e35124a --- a/obexd/client/bluetooth.c +++ b/obexd/client/bluetooth.c @@ -186,21 +186,10 @@ static void search_callback(uint8_t type, uint16_t status, protos = NULL; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Use obex over l2cap only if obex over rfcomm is not there */ - if (ch == -1) { - data = sdp_data_get(rec, 0x0200); - /* PSM must be odd and lsb of upper byte must be 0 */ - if (data != NULL && (data->val.uint16 & 0x0101) == - 0x0001) - ch = data->val.uint16; - } -#else data = sdp_data_get(rec, 0x0200); /* PSM must be odd and lsb of upper byte must be 0 */ if (data != NULL && (data->val.uint16 & 0x0101) == 0x0001) ch = data->val.uint16; -#endif /* Cache the sdp record associated with the service that we * attempt to connect. This allows reading its application @@ -454,8 +443,8 @@ static int bluetooth_getpacketopt(GIOChannel *io, int *tx_mtu, int *rx_mtu) { int sk = g_io_channel_unix_get_fd(io); int type; - int omtu = -1; - int imtu = -1; + uint16_t omtu = BT_TX_MTU; + uint16_t imtu = BT_RX_MTU; socklen_t len = sizeof(int); DBG(""); diff --git a/obexd/client/bluetooth.h b/obexd/client/bluetooth.h old mode 100644 new mode 100755 diff --git a/obexd/client/dbus.c b/obexd/client/dbus.c old mode 100644 new mode 100755 diff --git a/obexd/client/dbus.h b/obexd/client/dbus.h old mode 100644 new mode 100755 diff --git a/obexd/client/driver.c b/obexd/client/driver.c old mode 100644 new mode 100755 diff --git a/obexd/client/driver.h b/obexd/client/driver.h old mode 100644 new mode 100755 diff --git a/obexd/client/ftp.c b/obexd/client/ftp.c old mode 100644 new mode 100755 diff --git a/obexd/client/ftp.h b/obexd/client/ftp.h old mode 100644 new mode 100755 diff --git a/obexd/client/manager.c b/obexd/client/manager.c old mode 100644 new mode 100755 index cc472e4..fbcad6d --- a/obexd/client/manager.c +++ b/obexd/client/manager.c @@ -46,9 +46,7 @@ #include "sync.h" #include "map.h" #include "manager.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "mns-tizen.h" -#endif + #define CLIENT_INTERFACE "org.bluez.obex.Client1" #define ERROR_INTERFACE "org.bluez.obex.Error" #define CLIENT_PATH "/org/bluez/obex" @@ -66,21 +64,11 @@ static void shutdown_session(struct obc_session *session) obc_session_unref(session); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void release_session(struct obc_session *session) -{ - DBG("+"); - sessions = g_slist_remove(sessions, session); - shutdown_session(session); - DBG("-"); -} -#else static void release_session(struct obc_session *session) { sessions = g_slist_remove(sessions, session); shutdown_session(session); } -#endif static void unregister_session(void *data) { @@ -166,10 +154,7 @@ static int parse_device_dict(DBusMessageIter *iter, static struct obc_session *find_session(const char *path) { GSList *l; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if(!path) - return NULL; -#endif + for (l = sessions; l; l = l->next) { struct obc_session *session = l->data; @@ -253,16 +238,9 @@ static DBusMessage *remove_session(DBusConnection *connection, ERROR_INTERFACE ".NotAuthorized", "Not Authorized"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - obc_session_update(session, message, connection); -#endif release_session(session); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - return NULL; -#else return dbus_message_new_method_return(message); -#endif } static const GDBusMethodTable client_methods[] = { @@ -287,9 +265,6 @@ static struct obc_module { { "pbap", pbap_init, pbap_exit }, { "sync", sync_init, sync_exit }, { "map", map_init, map_exit }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "mns", mns_init, mns_exit }, -#endif { } }; diff --git a/obexd/client/manager.h b/obexd/client/manager.h old mode 100644 new mode 100755 diff --git a/obexd/client/map-event.c b/obexd/client/map-event.c old mode 100644 new mode 100755 diff --git a/obexd/client/map-event.h b/obexd/client/map-event.h old mode 100644 new mode 100755 diff --git a/obexd/client/map.c b/obexd/client/map.c old mode 100644 new mode 100755 diff --git a/obexd/client/map.h b/obexd/client/map.h old mode 100644 new mode 100755 diff --git a/obexd/client/mns-tizen.c b/obexd/client/mns-tizen.c deleted file mode 100644 index c6da1eb..0000000 --- a/obexd/client/mns-tizen.c +++ /dev/null @@ -1,271 +0,0 @@ -/* - * - * OBEX Client - * - * Copyright (C) 2012 Samsung Electronics Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include "log.h" - -#include "transfer.h" -#include "session.h" -#include "driver.h" -#include "map_ap.h" -#include "mns-tizen.h" -#include "gobex/gobex-apparam.h" - -#define OBEX_MNS_UUID \ - "\xBB\x58\x2B\x41\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66" -#define OBEX_MNS_UUID_LEN 16 - -#define MNS_INTERFACE "org.openobex.MessageNotification" -#define ERROR_INF MNS_INTERFACE ".Error" -#define MNS_UUID "00001133-0000-1000-8000-00805f9b34fb" - -enum msg_event_type { - EVENT_TYPE_NEW_MESSAGE, - EVENT_TYPE_DELIVERY_SUCCESS, - EVENT_TYPE_SENDING_SUCCESS, - EVENT_TYPE_DELIVERY_FAILURE, - EVENT_TYPE_SENDING_FAILURE, - EVENT_TYPE_MEMORY_FULL, - EVENT_TYPE_MEMORY_AVAILABLE, - EVENT_TYPE_MESSAGE_DELETED, - EVENT_TYPE_MESSAGE_SHIFT, - EVENT_TYPE_UNKNOWN, -}; - -struct mns_data { - struct obc_session *session; - DBusMessage *msg; -}; - -static DBusConnection *conn = NULL; - -static int get_event_type(gchar *event_type) -{ - DBG("event_type = %s\n", event_type); - - if (!g_strcmp0(event_type, "NewMessage")) - return EVENT_TYPE_NEW_MESSAGE; - else if (!g_strcmp0(event_type, "DeliverySuccess")) - return EVENT_TYPE_DELIVERY_SUCCESS; - else if (!g_strcmp0(event_type, "SendingSuccess")) - return EVENT_TYPE_SENDING_SUCCESS; - else if (!g_strcmp0(event_type, "DeliveryFailure")) - return EVENT_TYPE_DELIVERY_FAILURE; - else if (!g_strcmp0(event_type, "SendingFailure")) - return EVENT_TYPE_SENDING_FAILURE; - else if (!g_strcmp0(event_type, "MemoryFull")) - return EVENT_TYPE_MEMORY_FULL; - else if (!g_strcmp0(event_type, "MemoryAvailable")) - return EVENT_TYPE_MEMORY_AVAILABLE; - else if (!g_strcmp0(event_type, "MessageDeleted")) - return EVENT_TYPE_MESSAGE_DELETED; - else if (!g_strcmp0(event_type, "MessageShift")) - return EVENT_TYPE_MESSAGE_SHIFT; - else - return EVENT_TYPE_UNKNOWN; - -} - -static gchar *generate_event_report(gchar *event_type, - guint64 handle, gchar *folder, - gchar *old_folder, gchar *msg_type) -{ - GString *buf; - int event; - - event = get_event_type(event_type); - if (event == EVENT_TYPE_UNKNOWN) - return NULL; - - buf = g_string_new(""); - g_string_append_printf(buf, ""); - - return g_string_free(buf, FALSE); -} - -static DBusMessage *send_event(DBusConnection *connection, - DBusMessage *message, void *user_data) -{ - struct mns_data *mns = user_data; - struct obc_transfer *transfer; - GObexApparam *apparam; - gchar *event_type; - gchar *folder; - gchar *old_folder; - gchar *msg_type; - gchar *buf; - guint64 handle; - GError *err; - DBusMessage *reply; - - if (dbus_message_get_args(message, NULL, - DBUS_TYPE_STRING, &event_type, - DBUS_TYPE_UINT64, &handle, - DBUS_TYPE_STRING, &folder, - DBUS_TYPE_STRING, &old_folder, - DBUS_TYPE_STRING, &msg_type, - DBUS_TYPE_INVALID) == FALSE) - return g_dbus_create_error(message, - "org.openobex.Error.InvalidArguments", - NULL); - - buf = generate_event_report(event_type, handle, folder, - old_folder, msg_type); - if (!buf) - return g_dbus_create_error(message, - "org.openobex.Error.InvalidArguments", NULL); - - transfer = obc_transfer_put("x-bt/MAP-event-report", NULL, NULL, - buf, strlen(buf), &err); - - g_free(buf); - - if (transfer == NULL) - goto fail; - - /* Obexd currently supports single SDP for MAS */ - apparam = g_obex_apparam_set_uint8(NULL, MAP_AP_MASINSTANCEID, 0); - - obc_transfer_set_apparam(transfer, apparam); - - if (obc_session_queue(mns->session, transfer, NULL, NULL, &err)) - return dbus_message_new_method_return(message); - -fail: - reply = g_dbus_create_error(message, ERROR_INF ".Failed", "%s", - err->message); - g_error_free(err); - return reply; -} - -static GDBusMethodTable mns_methods[] = { - { GDBUS_ASYNC_METHOD("SendEvent", - GDBUS_ARGS({ "event_type", "s" }, { "handle", "t" }, - { "folder", "s" }, { "old_folder", "s" }, - { "msg_type", "s" }), - NULL, - send_event) }, - { } -}; - -static void mns_free(void *data) -{ - struct mns_data *mns = data; - - obc_session_unref(mns->session); - g_free(mns); -} - -static int mns_probe(struct obc_session *session) -{ - struct mns_data *mns; - const char *path; - - path = obc_session_get_path(session); - - DBG("%s", path); - - mns = g_try_new0(struct mns_data, 1); - if (!mns) - return -ENOMEM; - - mns->session = obc_session_ref(session); - - if (!g_dbus_register_interface(conn, path, MNS_INTERFACE, mns_methods, - NULL, NULL, mns, mns_free)) { - mns_free(mns); - return -ENOMEM; - } - - return 0; -} - -static void mns_remove(struct obc_session *session) -{ - const char *path = obc_session_get_path(session); - - DBG("%s", path); - - g_dbus_unregister_interface(conn, path, MNS_INTERFACE); -} - -static struct obc_driver mns = { - .service = "MNS", - .uuid = MNS_UUID, - .target = OBEX_MNS_UUID, - .target_len = OBEX_MNS_UUID_LEN, - .probe = mns_probe, - .remove = mns_remove -}; - -int mns_init(void) -{ - int err; - - DBG(""); - - conn = dbus_bus_get(DBUS_BUS_SESSION, NULL); - if (!conn) - return -EIO; - - err = obc_driver_register(&mns); - if (err < 0) { - dbus_connection_unref(conn); - conn = NULL; - return err; - } - - return 0; -} - -void mns_exit(void) -{ - DBG(""); - - dbus_connection_unref(conn); - conn = NULL; - - obc_driver_unregister(&mns); -} diff --git a/obexd/client/mns-tizen.h b/obexd/client/mns-tizen.h deleted file mode 100644 index e4ee5e5..0000000 --- a/obexd/client/mns-tizen.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * - * OBEX Client - * - * Copyright (C) 2012 Samsung Electronics Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -int mns_init(void); -void mns_exit(void); diff --git a/obexd/client/mns.c b/obexd/client/mns.c old mode 100644 new mode 100755 diff --git a/obexd/client/opp.c b/obexd/client/opp.c old mode 100644 new mode 100755 index 99668ef..92785f6 --- a/obexd/client/opp.c +++ b/obexd/client/opp.c @@ -55,26 +55,16 @@ static DBusMessage *opp_send_file(DBusConnection *connection, char *filename; char *basename; GError *err = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *mimetype = NULL; -#endif if (dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &filename, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBUS_TYPE_STRING, &mimetype, -#endif DBUS_TYPE_INVALID) == FALSE) return g_dbus_create_error(message, ERROR_INTERFACE ".InvalidArguments", NULL); basename = g_path_get_basename(filename); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - transfer = obc_transfer_put(mimetype, basename, filename, NULL, 0, &err); -#else transfer = obc_transfer_put(NULL, basename, filename, NULL, 0, &err); -#endif g_free(basename); @@ -127,16 +117,13 @@ fail: static DBusMessage *opp_exchange_business_cards(DBusConnection *connection, DBusMessage *message, void *user_data) { - return g_dbus_create_error(message, ERROR_INTERFACE ".Failed", NULL); + return g_dbus_create_error(message, ERROR_INTERFACE ".Failed", + "Not Implemented"); } static const GDBusMethodTable opp_methods[] = { { GDBUS_METHOD("SendFile", -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - GDBUS_ARGS({ "sourcefile", "s" }, { "mimetype", "s" }), -#else GDBUS_ARGS({ "sourcefile", "s" }), -#endif GDBUS_ARGS({ "transfer", "o" }, { "properties", "a{sv}" }), opp_send_file) }, { GDBUS_METHOD("PullBusinessCard", diff --git a/obexd/client/opp.h b/obexd/client/opp.h old mode 100644 new mode 100755 diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c old mode 100644 new mode 100755 index db46a80..1ab34a7 --- a/obexd/client/pbap.c +++ b/obexd/client/pbap.c @@ -218,11 +218,7 @@ static char *build_phonebook_path(const char *location, const char *item) internal = TRUE; } else if (!g_ascii_strncasecmp(location, "sim", 3)) { if (strlen(location) == 3) -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - tmp = g_strdup("SIM1"); -#else tmp = g_strdup("sim1"); -#endif else tmp = g_ascii_strup(location, 4); @@ -231,11 +227,6 @@ static char *build_phonebook_path(const char *location, const char *item) } else return NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!g_ascii_strcasecmp(item, "nil")) - return path; -#endif - if (!g_ascii_strcasecmp(item, "pb") || !g_ascii_strcasecmp(item, "ich") || !g_ascii_strcasecmp(item, "och") || @@ -367,11 +358,7 @@ static void read_return_apparam(struct obc_transfer *transfer, g_obex_apparam_get_uint16(apparam, PHONEBOOKSIZE_TAG, phone_book_size); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - g_obex_apparam_get_uint16(apparam, NEWMISSEDCALLS_TAG, -#else g_obex_apparam_get_uint8(apparam, NEWMISSEDCALLS_TAG, -#endif new_missed_calls); read_version(pbap, apparam); @@ -506,14 +493,8 @@ static GObexApparam *parse_offset(GObexApparam *apparam, DBusMessageIter *iter) { guint16 num; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16 && - dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT32) - return NULL; -#else if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16) return NULL; -#endif dbus_message_iter_get_basic(iter, &num); @@ -525,14 +506,8 @@ static GObexApparam *parse_max_count(GObexApparam *apparam, { guint16 num; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16 && - dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT32) - return NULL; -#else if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16) return NULL; -#endif dbus_message_iter_get_basic(iter, &num); @@ -762,16 +737,9 @@ static DBusMessage *pbap_select(DBusConnection *connection, } request = pending_request_new(pbap, message); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (pbap->path == NULL || strlen(pbap->path) == 0) - obc_session_setpath(pbap->session, path + 1, pbap_setpath_cb, request, - &err); - else - obc_session_setpath(pbap->session, path, pbap_setpath_cb, request, - &err); -#else - obc_session_setpath(pbap->session, path, pbap_setpath_cb, request, &err); -#endif + + obc_session_setpath(pbap->session, path, pbap_setpath_cb, request, + &err); if (err != NULL) { DBusMessage *reply; reply = g_dbus_create_error(message, ERROR_INTERFACE ".Failed", @@ -902,9 +870,6 @@ static DBusMessage *pbap_list(DBusConnection *connection, struct pbap_data *pbap = user_data; GObexApparam *apparam; DBusMessageIter args; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - const char *pb_folder; -#endif if (!pbap->path) return g_dbus_create_error(message, @@ -913,15 +878,6 @@ static DBusMessage *pbap_list(DBusConnection *connection, dbus_message_iter_init(message, &args); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING) - return g_dbus_create_error(message, - ERROR_INTERFACE ".InvalidArguments", NULL); - - dbus_message_iter_get_basic(&args, &pb_folder); - dbus_message_iter_next(&args); -#endif - apparam = g_obex_apparam_set_uint16(NULL, MAXLISTCOUNT_TAG, DEFAULT_COUNT); apparam = g_obex_apparam_set_uint16(apparam, LISTSTARTOFFSET_TAG, @@ -933,11 +889,7 @@ static DBusMessage *pbap_list(DBusConnection *connection, ERROR_INTERFACE ".InvalidArguments", NULL); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - return pull_vcard_listing(pbap, message, pb_folder, apparam); -#else return pull_vcard_listing(pbap, message, "", apparam); -#endif } static GObexApparam *parse_attribute(GObexApparam *apparam, const char *field) @@ -1097,11 +1049,7 @@ static const GDBusMethodTable pbap_methods[] = { { "properties", "a{sv}" }), pbap_pull_vcard) }, { GDBUS_ASYNC_METHOD("List", -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - GDBUS_ARGS({ "folder", "s" }, {"filters", "a{sv}" }), -#else - GDBUS_ARGS({"filters", "a{sv}" }), -#endif + GDBUS_ARGS({ "filters", "a{sv}" }), GDBUS_ARGS({ "vcard_listing", "a(ss)" }), pbap_list) }, { GDBUS_ASYNC_METHOD("Search", diff --git a/obexd/client/pbap.h b/obexd/client/pbap.h old mode 100644 new mode 100755 diff --git a/obexd/client/session.c b/obexd/client/session.c old mode 100644 new mode 100755 index 88c308f..5f981bf --- a/obexd/client/session.c +++ b/obexd/client/session.c @@ -43,9 +43,6 @@ #include "dbus.h" #include "transfer.h" #include "session.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "manager.h" -#endif #include "driver.h" #include "transport.h" @@ -117,10 +114,6 @@ struct obc_session { guint process_id; char *folder; struct callback_data *callback; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBusMessage *message; - DBusConnection *connection; -#endif }; static GSList *sessions = NULL; @@ -146,17 +139,6 @@ struct obc_session *obc_session_ref(struct obc_session *session) return session; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void obc_session_update(struct obc_session *session, DBusMessage *message, - DBusConnection *connection) -{ - DBG("+"); - session->message = dbus_message_ref(message); - session->connection = dbus_connection_ref(connection); - DBG("-"); -} -#endif - static void session_unregistered(struct obc_session *session) { char *path; @@ -281,18 +263,6 @@ static void disconnect_complete(GObex *obex, GError *err, GObexPacket *rsp, if (err) error("%s", err->message); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (session->message) { - /* Dbus reply need to be done */ - DBG("Dbus reply for remove_session"); - g_dbus_send_reply(session->connection, session->message, - DBUS_TYPE_INVALID); - dbus_message_unref(session->message); - dbus_connection_unref(session->connection); - session->message = NULL; - session->connection = NULL; - } -#endif /* Disconnect transport */ if (session->id > 0 && session->transport != NULL) { session->transport->disconnect(session->id); @@ -380,11 +350,8 @@ static void session_disconnected(GObex *obex, GError *err, gpointer user_data) if (err) error("%s", err->message); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - release_session(session); -#else + obc_session_shutdown(session); -#endif } static void transport_func(GIOChannel *io, GError *err, gpointer user_data) @@ -1212,9 +1179,7 @@ guint obc_session_setpath(struct obc_session *session, const char *path, if (!data->remaining || !data->remaining[0]) { error("obc_session_setpath: invalid path %s", path); g_set_error(err, OBEX_IO_ERROR, -EINVAL, "Invalid argument"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY setpath_data_free(data); -#endif return 0; } diff --git a/obexd/client/session.h b/obexd/client/session.h old mode 100644 new mode 100755 index 2ce9f3f..b561b7e --- a/obexd/client/session.h +++ b/obexd/client/session.h @@ -80,8 +80,3 @@ guint obc_session_delete(struct obc_session *session, const char *file, GError **err); void obc_session_cancel(struct obc_session *session, guint id, gboolean remove); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void release_session(struct obc_session *session); -void obc_session_update(struct obc_session *session, DBusMessage *message, - DBusConnection *connection); -#endif diff --git a/obexd/client/sync.c b/obexd/client/sync.c old mode 100644 new mode 100755 diff --git a/obexd/client/sync.h b/obexd/client/sync.h old mode 100644 new mode 100755 diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c old mode 100644 new mode 100755 index a5ecd13..092e72f --- a/obexd/client/transfer.c +++ b/obexd/client/transfer.c @@ -787,26 +787,12 @@ static gboolean report_progress(gpointer data) if (transfer->transferred == transfer->progress) return TRUE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (transfer->transferred == transfer->size) { - transfer->progress_id = 0; - if(transfer->progress == 0) { - transfer->progress = transfer->transferred; - transfer_set_status(transfer, TRANSFER_STATUS_ACTIVE); - } - - return FALSE; - } - - transfer->progress = transfer->transferred; -#else transfer->progress = transfer->transferred; if (transfer->transferred == transfer->size) { transfer->progress_id = 0; return FALSE; } -#endif if (transfer->status != TRANSFER_STATUS_ACTIVE && transfer->status != TRANSFER_STATUS_SUSPENDED) @@ -898,13 +884,8 @@ static gboolean transfer_start_put(struct obc_transfer *transfer, GError **err) if (transfer->path == NULL) return TRUE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - transfer->progress_id = g_timeout_add(10, report_progress, - transfer); -#else transfer->progress_id = g_timeout_add_seconds(1, report_progress, transfer); -#endif return TRUE; } diff --git a/obexd/client/transfer.h b/obexd/client/transfer.h old mode 100644 new mode 100755 diff --git a/obexd/client/transport.c b/obexd/client/transport.c old mode 100644 new mode 100755 diff --git a/obexd/client/transport.h b/obexd/client/transport.h old mode 100644 new mode 100755 diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c old mode 100644 new mode 100755 index d8b872a..3ee5432 --- a/obexd/plugins/bluetooth.c +++ b/obexd/plugins/bluetooth.c @@ -75,8 +75,8 @@ static void connect_event(GIOChannel *io, GError *err, void *user_data) struct bluetooth_profile *profile = user_data; struct obex_server *server = profile->server; int type; - int omtu = BT_TX_MTU; - int imtu = BT_RX_MTU; + uint16_t omtu = BT_TX_MTU; + uint16_t imtu = BT_RX_MTU; gboolean stream = TRUE; socklen_t len = sizeof(int); diff --git a/obexd/plugins/filesystem.c b/obexd/plugins/filesystem.c old mode 100644 new mode 100755 diff --git a/obexd/plugins/filesystem.h b/obexd/plugins/filesystem.h old mode 100644 new mode 100755 diff --git a/obexd/plugins/ftp.c b/obexd/plugins/ftp.c old mode 100644 new mode 100755 index e979f51..3ee18a6 --- a/obexd/plugins/ftp.c +++ b/obexd/plugins/ftp.c @@ -170,13 +170,6 @@ int ftp_chkput(struct obex_session *os, void *user_data) { struct ftp_session *ftp = user_data; const char *name = obex_get_name(os); -#if 0 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *folder; - int32_t time; - int err; -#endif -#endif char *path; int ret; @@ -191,15 +184,6 @@ int ftp_chkput(struct obex_session *os, void *user_data) if (obex_get_size(os) == OBJECT_SIZE_DELETE) return 0; -#if 0 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - time = 0; - err = manager_request_authorization(os, time, &folder, &name); - if (err < 0) - return -EPERM; -#endif -#endif - path = g_build_filename(ftp->folder, name, NULL); ret = obex_put_stream_start(os, path); @@ -235,36 +219,6 @@ int ftp_put(struct obex_session *os, void *user_data) return 0; } -#if 0 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean is_valid_name(const char *name) -{ - char *forbid_chars = "[*\"<>;?|\\^:/]"; - int exp; - regex_t reg; - regmatch_t match[1]; - size_t size = 1; - - if (name[0] == '.') - return FALSE; - - exp = regcomp(®, forbid_chars, 0); - - if (exp != 0) - return FALSE; - - exp = regexec(®, name, size, match, 0); - - regfree(®); - - if (exp != REG_NOMATCH) - return FALSE; - - return TRUE; -} -#endif -#endif - int ftp_setpath(struct obex_session *os, void *user_data) { struct ftp_session *ftp = user_data; @@ -319,21 +273,13 @@ int ftp_setpath(struct obex_session *os, void *user_data) return -EPERM; } -#if 0 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Check if the folder name is valid or not */ - if (!is_valid_name(name)) { - error("Set path failed: Invalid folder name!"); - return -EINVAL; - } -#endif -#endif - fullname = g_build_filename(ftp->folder, name, NULL); DBG("Fullname: %s", fullname); err = verify_path(fullname); + if (err == -ENOENT) + goto not_found; if (err < 0) goto done; diff --git a/obexd/plugins/ftp.h b/obexd/plugins/ftp.h old mode 100644 new mode 100755 diff --git a/obexd/plugins/irmc.c b/obexd/plugins/irmc.c old mode 100644 new mode 100755 diff --git a/obexd/plugins/mas.c b/obexd/plugins/mas.c old mode 100644 new mode 100755 index 04b54d2..ef67ec5 --- a/obexd/plugins/mas.c +++ b/obexd/plugins/mas.c @@ -71,14 +71,7 @@ struct mas_session { GObexApparam *inparams; GObexApparam *outparams; gboolean ap_sent; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gboolean headers_sent; - int notification_status; - char *remote_addr; - char *response_handle; -#else uint8_t notification_status; -#endif }; static const uint8_t MAS_TARGET[TARGET_SIZE] = { @@ -123,28 +116,17 @@ static void reset_request(struct mas_session *mas) mas->nth_call = FALSE; mas->finished = FALSE; mas->ap_sent = FALSE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - mas->headers_sent = FALSE; - g_free(mas->response_handle); - mas->response_handle = NULL; -#endif } static void mas_clean(struct mas_session *mas) { reset_request(mas); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_free(mas->remote_addr); -#endif g_free(mas); } static void *mas_connect(struct obex_session *os, int *err) { struct mas_session *mas; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *address; -#endif DBG(""); @@ -156,13 +138,6 @@ static void *mas_connect(struct obex_session *os, int *err) manager_register_session(os); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (obex_getpeername(os, &address) == 0) { - mas->remote_addr = address; - DBG("mas->remote_addr = %s\n", mas->remote_addr); - } -#endif - return mas; failed: @@ -427,25 +402,6 @@ proceed: obex_object_set_io_flags(mas, G_IO_IN, 0); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void put_message_cb(void *session, int err, guint64 handle, - void *user_data) -{ - struct mas_session *mas = user_data; - - DBG(""); - - if (err < 0) { - obex_object_set_io_flags(mas, G_IO_ERR, err); - return; - } - mas->finished = FALSE; - mas->response_handle = g_strdup_printf("%llx", handle); - - obex_object_set_io_flags(mas, G_IO_OUT, 0); -} -#endif - static void get_message_cb(void *session, int err, gboolean fmore, const char *chunk, void *user_data) { @@ -496,10 +452,6 @@ static void get_folder_listing_cb(void *session, int err, uint16_t size, mas->finished = TRUE; goto proceed; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } else { - mas->ap_sent = TRUE; -#endif } if (!mas->nth_call) { @@ -665,57 +617,6 @@ static void *message_open(const char *name, int oflag, mode_t mode, DBG(""); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (oflag != O_RDONLY) { - DBG("Message pushing invoked \n"); - - DBG("name = %s", name); - uint8_t transparent = 0; - uint8_t retry = 1; - uint8_t charset; - - g_obex_apparam_get_uint8(mas->inparams, MAP_AP_TRANSPARENT, - &transparent); - DBG("transparent = %d \n", transparent); - g_obex_apparam_get_uint8(mas->inparams, MAP_AP_RETRY, &retry); - DBG("retry = %d \n", retry); - - if (!g_obex_apparam_get_uint8(mas->inparams, MAP_AP_CHARSET, - &charset)) { - *err = -EBADR; - return NULL; - } - mas->headers_sent = FALSE; - - *err = messages_push_message(mas->backend_data, name, - transparent, retry, charset, - put_message_cb, mas); - } else { - uint8_t fraction_request = 0; - uint8_t attachment; - uint8_t charset; - - if (!g_obex_apparam_get_uint8(mas->inparams, MAP_AP_ATTACHMENT, - &attachment)) { - *err = -EBADR; - return NULL; - } - - if (!g_obex_apparam_get_uint8(mas->inparams, MAP_AP_CHARSET, - &charset)) { - *err = -EBADR; - return NULL; - } - - if (!g_obex_apparam_get_uint8(mas->inparams, MAP_AP_FRACTIONREQUEST, - &fraction_request)) - mas->ap_sent = TRUE; - - *err = messages_get_message(mas->backend_data, name, attachment, - charset, fraction_request, - get_message_cb, mas); - } -#else if (oflag != O_RDONLY) { DBG("Message pushing unsupported"); *err = -ENOSYS; @@ -725,7 +626,6 @@ static void *message_open(const char *name, int oflag, mode_t mode, *err = messages_get_message(mas->backend_data, name, 0, get_message_cb, mas); -#endif mas->buffer = g_string_new(""); @@ -735,30 +635,6 @@ static void *message_open(const char *name, int oflag, mode_t mode, return mas; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static ssize_t message_write(void *object, const void *buf, size_t count) -{ - DBG(""); - struct mas_session *mas = object; - - if (mas->finished) - return 0; - - g_string_append_len(mas->buffer, buf, count); - - DBG("count = %d \n", count); - - if (g_strrstr(mas->buffer->str, "END:BMSG\r\n")) { - DBG("BMsg received. \n"); - - messages_push_message_data(mas->backend_data, - mas->buffer->str, NULL); - } - - return count; -} -#endif - static void *message_update_open(const char *name, int oflag, mode_t mode, void *driver_data, size_t *size, int *err) @@ -822,53 +698,6 @@ static void *message_set_status_open(const char *name, int oflag, mode_t mode, return mas; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int notification_registration_close(void *obj) -{ - struct mas_session *mas = obj; - - DBG(""); - - messages_set_notification_registration(mas->backend_data, - mas->remote_addr, mas->notification_status, - NULL); - - reset_request(mas); - - return 0; -} - -static ssize_t put_next_header(void *object, void *buf, size_t mtu, - uint8_t *hi) -{ - struct mas_session *mas = object; - size_t len; - - DBG(""); - if (mas->headers_sent) - return 0; - - if (mas->response_handle) - DBG("mas->response_handle %s\n", mas->response_handle); - else - return 0; - - *hi = G_OBEX_HDR_NAME; - - len = strlen(mas->response_handle); - - DBG("len %d\n", len); - DBG("mas->response_handle %s\n", mas->response_handle); - - memcpy(buf, mas->response_handle, len); - - mas->headers_sent = TRUE; - - return len; -} -#endif - - static ssize_t any_get_next_header(void *object, void *buf, size_t mtu, uint8_t *hi) { @@ -993,12 +822,7 @@ static struct obex_mime_type_driver mime_message = { .open = message_open, .close = any_close, .read = any_read, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - .write = message_write, - .get_next_header = put_next_header -#else .write = any_write, -#endif }; static struct obex_mime_type_driver mime_folder_listing = { @@ -1028,11 +852,7 @@ static struct obex_mime_type_driver mime_notification_registration = { .target_size = TARGET_SIZE, .mimetype = "x-bt/MAP-NotificationRegistration", .open = notification_registration_open, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - .close = notification_registration_close, -#else .close = any_close, -#endif .read = any_read, .write = any_write, }; diff --git a/obexd/plugins/messages-dummy.c b/obexd/plugins/messages-dummy.c old mode 100644 new mode 100755 diff --git a/obexd/plugins/messages-tizen.c b/obexd/plugins/messages-tizen.c deleted file mode 100644 index e59c37b..0000000 --- a/obexd/plugins/messages-tizen.c +++ /dev/null @@ -1,1547 +0,0 @@ -/* - * - * OBEX Server - * - * Copyright (C) 2012 Samsung Electronics Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include "log.h" -#include "messages.h" -#include "../../profile.h" - -#include - -#define QUERY_GET_FOLDER_TREE "GetFolderTree" -#define QUERY_GET_MSG_LIST "GetMessageList" -#define QUERY_GET_MESSAGE "GetMessage" -#define QUERY_PUSH_MESSAGE "PushMessage" -#define QUERY_PUSH_MESSAGE_DATA "PushMessageData" -#define QUERY_UPDATE_MESSAGE "UpdateMessage" -#define QUERY_SET_READ_STATUS "SetReadStatus" -#define QUERY_SET_DELETE_STATUS "SetDeleteStatus" -#define QUERY_NOTI_REGISTRATION "NotiRegistration" -#define QUERY_DESTROY_AGENT "DestroyAgent" - -#define BT_MAP_SERVICE_OBJECT_PATH "/org/bluez/map_agent" -#define BT_MAP_SERVICE_NAME "org.bluez.map_agent" -#define BT_MAP_SERVICE_INTERFACE "org.bluez.MapAgent" - -/* Added as per MAP specification */ -#define BT_MAP_LIST_ITEM_MAX_LEN 256 - -static DBusConnection *g_conn = NULL; - -struct mns_reg_data { - uint8_t notification_status; - char *remote_addr; -}; - -struct message_folder { - char *name; - GSList *subfolders; -}; - -struct session { - char *cwd; - struct message_folder *folder; - char *name; - uint16_t max; - uint16_t offset; - void *user_data; - struct messages_filter *filter; - struct messages_message *msg; - void (*folder_list_cb)(void *session, int err, uint16_t size, - const char *name, void *user_data); - void (*msg_list_cb)(void *session, int err, int size, gboolean newmsg, - const struct messages_message *entry, - void *user_data); - void (*push_msg_cb)(void *session, int err, guint64 handle, - void *user_data); - void (*get_msg_cb)(void *session, int err, gboolean fmore, - const char *chunk, void *user_data); - void (*msg_update_cb)(void *session, int err, void *user_data); - void (*msg_status_cb)(void *session, int err, void *user_data); -}; - -static struct message_folder *folder_tree = NULL; - -static void message_list_item_free(struct messages_message *data) -{ - DBG("+"); - g_free(data->handle); - data->handle = NULL; - - g_free(data->subject); - data->subject = NULL; - - g_free(data->datetime); - data->datetime = NULL; - - g_free(data->sender_name); - data->sender_name = NULL; - - g_free(data->sender_addressing); - data->sender_addressing = NULL; - - g_free(data->replyto_addressing); - data->replyto_addressing = NULL; - - g_free(data->recipient_name); - data->recipient_name = NULL; - - g_free(data->recipient_addressing); - data->recipient_addressing = NULL; - - g_free(data->type); - data->type = NULL; - - g_free(data->reception_status); - data->reception_status = NULL; - - g_free(data->size); - data->size = NULL; - - g_free(data->attachment_size); - data->attachment_size = NULL; - DBG("-"); -} - -static void session_filter_free(struct messages_filter *data) -{ - DBG("+"); - if (NULL == data) - return; - - g_free((gpointer)data->period_begin); - g_free((gpointer)data->period_end); - g_free((gpointer)data->recipient); - g_free((gpointer)data->originator); - g_free(data); - DBG("-"); -} - -static gboolean is_time_in_period(char *ref_time, char *period) -{ - guint64 ref_date_val; - guint64 date_val; - - guint64 ref_time_val; - guint64 time_val; - - char *start; - char *end = NULL; - - char temp[20]; - - start = strtok_r(ref_time, "T", &end); - if (NULL == start || NULL == end) - return FALSE; - - snprintf(temp, sizeof(temp), "%s", start); - ref_date_val = g_ascii_strtoull(temp, NULL, 16); - snprintf(temp, sizeof(temp), "%s", end); - ref_time_val = g_ascii_strtoull(temp, NULL, 16); - - start = strtok_r(period, "T", &end); - if (NULL == start || NULL == end) - return FALSE; - - snprintf(temp, sizeof(temp), "%s", start); - date_val = g_ascii_strtoull(temp, NULL, 16); - snprintf(temp, sizeof(temp), "%s", end); - time_val = g_ascii_strtoull(temp, NULL, 16); - - if (ref_date_val < date_val) { - return TRUE; - } else if (ref_date_val > date_val) { - return FALSE; - } else { - if (ref_time_val <= time_val) - return TRUE; - else - return FALSE; - } -} - -static gboolean __filter_timebased(char *begin, char *end, char *time) -{ - gboolean ret = 0; - - if (!begin && !end) { - /* If start and stop are not specified - do not filter. */ - - return TRUE; - } else if (!end && begin) { - /* If "FilterPeriodEnd" is not specified the returned - message listing shall include the messages from - "FilterPeriodBegin" to current time */ - - return is_time_in_period(begin, time); - } else if (!begin && end) { - /* If "FilterPeriodBegin" is not specified the returned - message listing shall include the messages older than - "FilterPeriodEnd" */ - - return is_time_in_period(time, end); - } else { - - if (TRUE == is_time_in_period(end, begin)) - return FALSE; - - ret = is_time_in_period(begin, time); - if (ret == TRUE) - return is_time_in_period(time, end); - else - return FALSE; - } -} - -static uint8_t get_type_val(const char *type) -{ - if (!g_strcmp0(type, "SMS_GSM")) - return 0x01; - else if (!g_strcmp0(type, "SMS_CDMA")) - return 0x02; - else if (!g_strcmp0(type, "EMAIL")) - return 0x04; - else if (!g_strcmp0(type, "MMS")) - return 0x08; - else - return 0x00; -} - -static uint8_t get_read_status_val(gboolean read) -{ - if (read) - return 0x02; /* Read messages */ - else - return 0x01; /* Unread messages */ -} - -static uint8_t get_priority_val(gboolean priority) -{ - if (priority) - return 0x01; /* High priority */ - else - return 0x02; /* Low priority */ -} - -static struct message_folder *get_folder(const char *folder) -{ - GSList *folders = folder_tree->subfolders; - struct message_folder *last = NULL; - char **path; - int i; - - if (g_strcmp0(folder, "/") == 0) - return folder_tree; - - path = g_strsplit(folder, "/", 0); - - for (i = 1; path[i] != NULL; i++) { - gboolean match_found = FALSE; - GSList *l; - - for (l = folders; l != NULL; l = g_slist_next(l)) { - struct message_folder *folder = l->data; - - if (g_ascii_strncasecmp(folder->name, path[i], - strlen(folder->name)) == 0) { - match_found = TRUE; - last = l->data; - folders = folder->subfolders; - break; - } - } - - if (!match_found) { - g_strfreev(path); - return NULL; - } - } - - g_strfreev(path); - - return last; -} - -static void destroy_folder_tree(void *root) -{ - struct message_folder *folder = root; - GSList *tmp, *next; - - if (folder == NULL) - return; - - g_free(folder->name); - - tmp = folder->subfolders; - while (tmp != NULL) { - next = g_slist_next(tmp); - destroy_folder_tree(tmp->data); - tmp = next; - } - g_slist_free(folder->subfolders); - g_free(folder); -} - -static struct message_folder *create_folder(const char *name) -{ - struct message_folder *folder = g_new0(struct message_folder, 1); - - folder->name = g_strdup(name); - return folder; -} - -static void create_folder_tree() -{ - - struct message_folder *parent, *child; - - folder_tree = create_folder("/"); - - parent = create_folder("telecom"); - folder_tree->subfolders = g_slist_append(folder_tree->subfolders, - parent); - - child = create_folder("msg"); - parent->subfolders = g_slist_append(parent->subfolders, child); -} - -int messages_init(void) -{ - g_conn = dbus_bus_get(DBUS_BUS_SESSION, NULL); - if (!g_conn) { - error("Can't get on session bus"); - return -1; - } - - return 0; -} - -void messages_exit(void) -{ - if (g_conn) { - dbus_connection_unref(g_conn); - g_conn = NULL; - } -} - -static void message_get_folder_list(DBusMessage *reply, void *user_data) -{ - DBusMessageIter iter; - DBusMessageIter iter_struct; - DBusMessageIter entry; - DBusError derr; - const char *name = NULL; - struct message_folder *parent = {0,}, *child = {0,}; - GSList *l; - - DBG("+\n"); - - for (l = folder_tree->subfolders; l != NULL; l = parent->subfolders) - parent = l->data; - - DBG("Last child folder = %s \n", parent->name); - dbus_error_init(&derr); - - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } else { - dbus_message_iter_init(reply, &iter); - dbus_message_iter_recurse(&iter, &iter_struct); - - while (dbus_message_iter_get_arg_type(&iter_struct) == - DBUS_TYPE_STRUCT) { - dbus_message_iter_recurse(&iter_struct, &entry); - - dbus_message_iter_get_basic(&entry, &name); - DBG("Folder name = %s \n", name); - child = create_folder(name); - parent->subfolders = g_slist_append(parent->subfolders, - child); - dbus_message_iter_next(&iter_struct); - } - } - dbus_message_unref(reply); - DBG("-\n"); -} - -static void message_get_msg_list(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - DBusMessageIter iter; - DBusMessageIter iter_struct; - DBusMessageIter entry; - DBusError derr; - const char *msg_handle; - const char *subject; - const char *datetime; - const char *sender_name; - const char *sender_addressing; - const char *replyto_addressing; - const char *recipient_name; - const char *recipient_addressing; - const char *type; - const char *reception_status; - const char *size; - const char *attachment_size; - gboolean text; - gboolean read; - gboolean sent; - gboolean protect; - gboolean priority; - gboolean newmessage; - guint64 count; - uint8_t type_val; - uint8_t read_val; - uint8_t priority_val; - uint32_t mask; - - struct session *session = user_data; - struct messages_message *data = g_new0(struct messages_message, 1); - - DBG("+\n"); - DBG("parameter_mask = %x; type = %d; period_begin = %s;" - "period_end = %s; read_status = %d; recipient = %s;" - "originator = %s; priority = %d", - session->filter->parameter_mask, session->filter->type, - session->filter->period_begin, session->filter->period_end, - session->filter->read_status, session->filter->recipient, - session->filter->originator, session->filter->priority); - - dbus_error_init(&derr); - - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - session->msg_list_cb(session, -ENOENT, 0, - FALSE, data, session->user_data); - - g_free(data); - g_free(session->name); - session_filter_free(session->filter); - dbus_message_unref(reply); - - return; - } - - dbus_message_iter_init(reply, &iter); - dbus_message_iter_get_basic(&iter, &newmessage); - dbus_message_iter_next(&iter); - dbus_message_iter_get_basic(&iter, &count); - dbus_message_iter_next(&iter); - - if (session->max == 0) - goto done; - - dbus_message_iter_recurse(&iter, &iter_struct); - - if (session->filter->parameter_mask == 0) - mask = ~session->filter->parameter_mask; - else - mask = session->filter->parameter_mask; - - while (dbus_message_iter_get_arg_type(&iter_struct) == - DBUS_TYPE_STRUCT) { - dbus_message_iter_recurse(&iter_struct, &entry); - dbus_message_iter_get_basic(&entry, &msg_handle); - - if (msg_handle == NULL) { - dbus_message_iter_next(&iter_struct); - continue; - } - - DBG("Msg handle = %s \n", msg_handle); - data->handle = g_strdup(msg_handle); - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &subject); - - if (mask & PMASK_SUBJECT) { - DBG("subject = %s\n", subject); - data->subject = g_strndup(subject, - BT_MAP_LIST_ITEM_MAX_LEN); - data->mask |= PMASK_SUBJECT; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &datetime); - - if ((mask & PMASK_DATETIME) && (NULL != datetime)) { - DBG("datetime = %s\n", datetime); - char *begin = g_strdup(session->filter->period_begin); - char *end = g_strdup(session->filter->period_end); - char *time = g_strdup(datetime); - gboolean filter; - - filter = __filter_timebased(begin, end, time); - - g_free(begin); - g_free(end); - g_free(time); - - if (TRUE == filter) { - data->datetime = g_strdup(datetime); - data->mask |= PMASK_DATETIME; - } else { - message_list_item_free(data); - dbus_message_iter_next(&iter_struct); - continue; - } - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &sender_name); - - if ((mask & PMASK_SENDER_NAME) && - (NULL != session->filter->originator)) { - DBG("sender_name = %s \n", sender_name); - - if (g_strstr_len(sender_name, -1, - session->filter->originator)) { - data->sender_name = g_strndup(sender_name, - BT_MAP_LIST_ITEM_MAX_LEN); - data->mask |= PMASK_SENDER_NAME; - } else { - message_list_item_free(data); - dbus_message_iter_next(&iter_struct); - continue; - } - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &sender_addressing); - - if ((mask & PMASK_SENDER_ADDRESSING) && - (NULL != sender_addressing)) { - DBG("sender_addressing = %s \n", sender_addressing); - - data->sender_addressing = g_strndup(sender_addressing, - BT_MAP_LIST_ITEM_MAX_LEN); - data->mask |= PMASK_SENDER_ADDRESSING; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &recipient_name); - - if ((mask & PMASK_RECIPIENT_NAME) && - (NULL != session->filter->recipient)) { - DBG("recipient_name = %s \n", recipient_name); - - if (g_strstr_len(recipient_name, -1, - session->filter->recipient)) { - data->recipient_name = - g_strndup(recipient_name, - BT_MAP_LIST_ITEM_MAX_LEN); - data->mask |= PMASK_RECIPIENT_NAME; - } else { - message_list_item_free(data); - dbus_message_iter_next(&iter_struct); - continue; - } - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &recipient_addressing); - - if ((mask & PMASK_RECIPIENT_ADDRESSING) && - (NULL != recipient_addressing)) { - DBG("recipient_addressing=%s\n", recipient_addressing); - - data->recipient_addressing = - g_strndup(recipient_addressing, - BT_MAP_LIST_ITEM_MAX_LEN); - data->mask |= PMASK_RECIPIENT_ADDRESSING; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &type); - - if ((mask & PMASK_TYPE) && (NULL != type)) { - DBG("type = %s \n", type); - - type_val = get_type_val(type); - if (!(session->filter->type & type_val)) { - data->type = g_strdup(type); - data->mask |= PMASK_TYPE; - } - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &size); - - if ((mask & PMASK_SIZE) && (NULL != size)) { - DBG("size = %s \n", size); - - data->size = g_strdup(size); - data->mask |= PMASK_SIZE; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &reception_status); - - if (mask & PMASK_RECEPTION_STATUS) { - DBG("reception_status = %s \n", reception_status); - - data->reception_status = g_strdup(reception_status); - data->mask |= PMASK_RECEPTION_STATUS; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &text); - - if (mask & PMASK_TEXT) { - DBG("text = %d \n", text); - data->text = text; - data->mask |= PMASK_TEXT; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &attachment_size); - - if (mask & PMASK_ATTACHMENT_SIZE) { - DBG("attachment_size = %s\n", attachment_size); - - data->attachment_size = g_strdup(attachment_size); - data->mask |= PMASK_ATTACHMENT_SIZE; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &priority); - - if (mask & PMASK_PRIORITY) { - DBG("priority = %d \n", priority); - - priority_val = get_priority_val(priority); - if ((session->filter->priority == 0) || - (session->filter->priority & priority_val)) { - data->priority = priority; - data->mask |= PMASK_PRIORITY; - } else { - message_list_item_free(data); - dbus_message_iter_next(&iter_struct); - continue; - } - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &read); - - if (mask & PMASK_READ) { - DBG("read = %d \n", read); - - read_val = get_read_status_val(read); - - if ((session->filter->read_status == 0) || - (session->filter->read_status & read_val)) { - data->read = read; - data->mask |= PMASK_READ; - } else { - message_list_item_free(data); - dbus_message_iter_next(&iter_struct); - continue; - } - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &sent); - - if (mask & PMASK_SENT) { - DBG("sent = %d \n", sent); - data->sent = sent; - data->mask |= PMASK_SENT; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &protect); - - if (mask & PMASK_PROTECTED) { - DBG("protect = %d \n", protect); - data->protect = protect; - data->mask |= PMASK_PROTECTED; - } - - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &replyto_addressing); - - if ((mask & PMASK_REPLYTO_ADDRESSING) && - (0x04 == get_type_val(type))) { - - DBG("replyto_addressing = %s \n", replyto_addressing); - if (replyto_addressing) - data->replyto_addressing = - g_strdup(replyto_addressing); - else - data->replyto_addressing = g_strdup(""); - - data->mask |= PMASK_REPLYTO_ADDRESSING; - } - - session->msg_list_cb(session, -EAGAIN, 1, newmessage, data, - session->user_data); - - message_list_item_free(data); - dbus_message_iter_next(&iter_struct); - } - -done: - session->msg_list_cb(session, 0, count, newmessage, NULL, - session->user_data); - - g_free(data); - g_free(session->name); - session_filter_free(session->filter); - dbus_message_unref(reply); - DBG("-\n"); -} - -static void message_get_msg(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - DBusMessageIter iter; - DBusError derr; - struct session *session = user_data; - char *msg_body; - gboolean fraction_deliver; - - DBG("+\n"); - - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } else { - dbus_message_iter_init(reply, &iter); - dbus_message_iter_get_basic(&iter, &fraction_deliver); - dbus_message_iter_next(&iter); - dbus_message_iter_get_basic(&iter, &msg_body); - DBG("msg_body %s\n", msg_body); - - session->get_msg_cb(session, -EAGAIN, fraction_deliver, - msg_body, session->user_data); - session->get_msg_cb(session, 0, fraction_deliver, - NULL, session->user_data); - } - dbus_message_unref(reply); - DBG("-\n"); -} - -int messages_connect(void **s) -{ - DBusMessage *message; - DBusMessage *reply; - DBusError err; - DBG("+\n"); - - struct session *session = g_new0(struct session, 1); - - create_folder_tree(); - - session->cwd = g_strdup("/"); - session->folder = folder_tree; - - *s = session; - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_GET_FOLDER_TREE); - if (!message) { - error("Can't allocate new message"); - return -1; - } - - dbus_error_init(&err); - - reply = dbus_connection_send_with_reply_and_block(g_conn, message, - DBUS_TIMEOUT_USE_DEFAULT, &err); - if (!reply) { - DBG(" Reply failed"); - if (dbus_error_is_set(&err)) { - DBG("%s", err.message); - dbus_error_free(&err); - } - - dbus_message_unref(message); - return -1; - } - - message_get_folder_list(reply, session); - - dbus_message_unref(message); - DBG("-\n"); - return 0; -} - -void messages_disconnect(void *s) -{ - DBusMessage *message; - struct session *session = s; - DBG("+\n"); - - destroy_folder_tree(folder_tree); - folder_tree = NULL; - g_free(session->cwd); - g_free(session); - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_DESTROY_AGENT); - - if (!message) { - error("Can't allocate new message"); - return; - } - - if (dbus_connection_send(g_conn, message, NULL) == FALSE) - error("Could not send dbus message"); - - dbus_message_unref(message); - - DBG("-\n"); -} - -static gboolean notification_registration(gpointer user_data) -{ - DBG("+\n"); - DBusMessage *message = NULL; - gboolean reg; - struct mns_reg_data *data = (struct mns_reg_data *)user_data; - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_NOTI_REGISTRATION); - if (!message) { - error("Can't allocate new message"); - goto done; - } - - DBG("data->notification_status = %d\n", data->notification_status); - - if (data->notification_status == 1) - reg = TRUE; - else - reg = FALSE; - - dbus_message_append_args(message, DBUS_TYPE_STRING, &data->remote_addr, - DBUS_TYPE_BOOLEAN, ®, - DBUS_TYPE_INVALID); - - if (dbus_connection_send(g_conn, message, NULL) == FALSE) - error("Could not send dbus message"); - - dbus_message_unref(message); - -done: - g_free(data->remote_addr); - g_free(data); - - DBG("-\n"); - return FALSE; -} - -int messages_set_notification_registration(void *session, - char *address, uint8_t status, - void *user_data) -{ - DBG("+\n"); - struct mns_reg_data *data = g_new0(struct mns_reg_data, 1); - data->notification_status = status; - data->remote_addr = g_strdup(address); - - DBG("status = %d\n", status); - - g_idle_add(notification_registration, data); - DBG("-\n"); - return 1; -} - -int messages_set_folder(void *s, const char *name, gboolean cdup) -{ - struct session *session = s; - char *newrel = NULL; - char *newabs; - char *tmp; - - if (name && (strchr(name, '/') || strcmp(name, "..") == 0)) - return -EBADR; - - if (cdup) { - if (session->cwd[0] == 0) - return -ENOENT; - - newrel = g_path_get_dirname(session->cwd); - - /* We use empty string for indication of the root directory */ - if (newrel[0] == '.' && newrel[1] == 0) - newrel[0] = 0; - } - - tmp = newrel; - if (!cdup && (!name || name[0] == 0)) - newrel = g_strdup(""); - else - newrel = g_build_filename(newrel ? newrel : session->cwd, name, - NULL); - g_free(tmp); - - if (newrel[0] != '/') - newabs = g_build_filename("/", newrel, NULL); - else - newabs = g_strdup(newrel); - - session->folder = get_folder(newabs); - if (session->folder == NULL) { - g_free(newrel); - g_free(newabs); - - return -ENOENT; - } - - g_free(newrel); - g_free(session->cwd); - session->cwd = newabs; - - return 0; -} - -static gboolean async_get_folder_listing(void *s) -{ - struct session *session = s; - int i; - uint16_t folder_list_size = 0; - char *path = NULL; - struct message_folder *folder; - GSList *dir; - - if (session->name && strchr(session->name, '/') != NULL) - goto done; - - path = g_build_filename(session->cwd, session->name, NULL); - - if (path == NULL || strlen(path) == 0) - goto done; - - folder = get_folder(path); - - if (folder == NULL) - goto done; - - if (session->max == 0) { - folder_list_size = g_slist_length(folder->subfolders); - goto done; - } - - dir = folder->subfolders; - - /* move to offset */ - for (i = 0; i < session->offset; i++) { - if (dir == NULL) - goto done; - - dir = g_slist_next(dir); - } - - for (i = 0; i < session->max; i++) { - struct message_folder *dir_data; - - if (dir == NULL) - goto done; - - dir_data = dir->data; - session->folder_list_cb(session, -EAGAIN, 0, - dir_data->name, session->user_data); - - dir = g_slist_next(dir); - } - - done: - session->folder_list_cb(session, 0, folder_list_size, - NULL, session->user_data); - - g_free(path); - g_free(session->name); - - return FALSE; -} - -int messages_get_folder_listing(void *s, const char *name, - uint16_t max, uint16_t offset, - messages_folder_listing_cb callback, - void *user_data) -{ - DBG("+\n"); - struct session *session = s; - session->name = g_strdup(name); - session->max = max; - session->offset = offset; - session->folder_list_cb = callback; - session->user_data = user_data; - - g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, async_get_folder_listing, - session, NULL); - - DBG("-\n"); - return 0; -} - - -static void append_variant(DBusMessageIter *iter, int type, void *val) -{ - DBusMessageIter value; - char sig[2] = { type, '\0' }; - - dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, sig, &value); - dbus_message_iter_append_basic(&value, type, val); - dbus_message_iter_close_container(iter, &value); -} - -static void dict_append_entry(DBusMessageIter *dict, const char *key, - int type, void *val) -{ - DBusMessageIter entry; - - dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key); - append_variant(&entry, type, val); - dbus_message_iter_close_container(dict, &entry); -} - -int messages_get_messages_listing(void *session, const char *name, - uint16_t max, uint16_t offset, - uint8_t subject_len, - const struct messages_filter *filter, - messages_get_messages_listing_cb callback, - void *user_data) -{ - DBusPendingCall *call; - DBusMessage *message; - struct session *s = session; - DBusMessageIter iter; - DBusMessageIter dict; - - if (name != NULL && strlen(name)) - s->name = g_strdup(name); - else - s->name = g_strdup(s->cwd); - - s->max = max; - s->offset = offset; - - s->filter = g_new0(struct messages_filter, 1); - s->filter->parameter_mask = filter->parameter_mask; - s->filter->type = filter->type; - s->filter->period_begin = g_strdup(filter->period_begin); - s->filter->period_end = g_strdup(filter->period_end); - s->filter->read_status = filter->read_status; - s->filter->recipient = g_strdup(filter->recipient); - s->filter->originator = g_strdup(filter->originator); - s->filter->priority = filter->priority; - - s->msg_list_cb = (void *)callback; - s->user_data = user_data; - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_GET_MSG_LIST); - if (!message) { - error("Can't allocate new message"); - g_free(s->name); - session_filter_free(s->filter); - return -1; - } - - dbus_message_append_args(message, DBUS_TYPE_STRING, &s->name, - DBUS_TYPE_UINT16, &s->max, - DBUS_TYPE_UINT16, &s->offset, - DBUS_TYPE_BYTE, &subject_len, - DBUS_TYPE_INVALID); - - dbus_message_iter_init_append(message, &iter); - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING - DBUS_TYPE_VARIANT_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - if (filter->parameter_mask) - dict_append_entry(&dict, "ParameterMask", DBUS_TYPE_UINT32, - &filter->parameter_mask); - if (filter->type) - dict_append_entry(&dict, "FilterMessageType", DBUS_TYPE_BYTE, - &filter->type); - if (filter->period_begin) - dict_append_entry(&dict, "FilterPeriodBegin", DBUS_TYPE_STRING, - &filter->period_begin); - if (filter->period_end) - dict_append_entry(&dict, "FilterPeriodEnd", DBUS_TYPE_STRING, - &filter->period_end); - if (filter->read_status) - dict_append_entry(&dict, "FilterReadStatus", DBUS_TYPE_BYTE, - &filter->read_status); - if (filter->recipient) - dict_append_entry(&dict, "FilterRecipient", DBUS_TYPE_STRING, - &filter->recipient); - if (filter->originator) - dict_append_entry(&dict, "FilterOriginator", DBUS_TYPE_STRING, - &filter->originator); - if (filter->priority) - dict_append_entry(&dict, "FilterPriority", DBUS_TYPE_BYTE, - &filter->priority); - - dbus_message_iter_close_container(&iter, &dict); - - if (dbus_connection_send_with_reply(g_conn, message, &call, - DBUS_TIMEOUT_INFINITE) == FALSE) { - error("Could not send dbus message"); - dbus_message_unref(message); - g_free(s->name); - session_filter_free(s->filter); - return -1; - } - dbus_pending_call_set_notify(call, message_get_msg_list, s, NULL); - dbus_message_unref(message); - DBG("-\n"); - return 1; -} - -int messages_push_message(void *session, const char *folder, - uint8_t transparent, uint8_t retry, - uint8_t charset, - messages_push_message_cb callback, - void *user_data) -{ - DBusMessage *message; - DBusMessage *reply; - DBusError err; - struct session *s = session; - - gboolean save_copy = FALSE; /* As per specs default value */ - gboolean retry_send = TRUE; /* As per specs default value */ - gboolean native = FALSE; - gchar *folder_path = NULL; - guint64 handle = 0; - - DBG("+\n"); - - DBG("session->cwd %s +\n", s->cwd); - - if (g_ascii_strncasecmp(s->cwd, "/telecom/msg", - strlen("/telecom/msg")) != 0) { - DBG("Path Not Set properly"); - return -1; - } - - if ((folder[0] == '\0') && (g_strcmp0(s->cwd, "/telecom/msg") == 0)) { - DBG("Invalid Folders"); - return -1; - } - - if ((folder[0] != '\0')) - folder_path = g_strconcat("/telecom/msg/", folder, NULL); - else - folder_path = g_strdup(s->cwd); - - s->push_msg_cb = callback; - s->user_data = user_data; - - if (transparent & 0x1) - save_copy = TRUE; - - if (!(retry & 0x1)) { - retry_send = FALSE; - DBG("Retry send %d\n", retry_send); - } - - if (charset & 0x1) { - native = TRUE; - DBG("native send %d\n", native); - } - - DBG("save_copy %d\n", save_copy); - DBG("retry_send %d\n", retry_send); - DBG("native %d\n", native); - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_PUSH_MESSAGE); - if (!message) { - error("Can't allocate new message"); - g_free(folder_path); - return -1; - } - - dbus_message_append_args(message, DBUS_TYPE_BOOLEAN, &save_copy, - DBUS_TYPE_BOOLEAN, &retry_send, - DBUS_TYPE_BOOLEAN, &native, - DBUS_TYPE_STRING, &folder_path, - DBUS_TYPE_INVALID); - - dbus_error_init(&err); - - reply = dbus_connection_send_with_reply_and_block( - g_conn, message, - DBUS_TIMEOUT_USE_DEFAULT, &err); - if (!reply) { - DBG(" Reply failed"); - - if (dbus_error_is_set(&err)) { - DBG("%s", err.message); - dbus_error_free(&err); - } - g_free(folder_path); - dbus_message_unref(message); - return -1; - } - - if (!dbus_message_get_args(reply, &err, DBUS_TYPE_UINT64, - &handle, DBUS_TYPE_INVALID)) { - if (dbus_error_is_set(&err)) { - error("err %s\n", err.message); - dbus_error_free(&err); - } - g_free(folder_path); - dbus_message_unref(message); - dbus_message_unref(reply); - return -1; - } - - DBG("uint64 handle %"G_GUINT64_FORMAT"\n", handle); - s->push_msg_cb(s, 0, handle, s->user_data); - - g_free(folder_path); - dbus_message_unref(message); - dbus_message_unref(reply); - - DBG("-\n"); - return 1; -} - -int messages_push_message_data(void *session, const char *bmsg, void *user_data) -{ - DBusMessage *message; - - DBG("+\n"); - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_PUSH_MESSAGE_DATA); - if (!message) { - error("Can't allocate new message"); - return -1; - } - - dbus_message_append_args(message, DBUS_TYPE_STRING, &bmsg, - DBUS_TYPE_INVALID); - - if (dbus_connection_send(g_conn, message, NULL) == FALSE) { - error("Could not send dbus message"); - dbus_message_unref(message); - return -1; - } - - dbus_message_unref(message); - DBG("-\n"); - return 1; -} - -int messages_get_message(void *session, - const char *handle, - uint8_t attachment, uint8_t charset, - uint8_t fraction_request, - messages_get_message_cb callback, - void *user_data) -{ - DBusPendingCall *call; - DBusMessage *message; - struct session *s = session; - char *message_name; - gboolean attach = FALSE; - gboolean transcode = FALSE; - gboolean first_request = TRUE; - - DBG("+\n"); - - if (NULL != handle) { - message_name = g_strdup(handle); - DBG("Message handle = %s\n", handle); - } else { - return -1; - } - s->get_msg_cb = callback; - s->user_data = user_data; - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_GET_MESSAGE); - if (!message) { - error("Can't allocate new message"); - g_free(message_name); - return -1; - } - - if (attachment & 0x1) - attach = TRUE; - - if (charset & 0x1) - transcode = TRUE; - - if (fraction_request & 0x1) - first_request = FALSE; - - dbus_message_append_args(message, DBUS_TYPE_STRING, &message_name, - DBUS_TYPE_BOOLEAN, &attach, - DBUS_TYPE_BOOLEAN, &transcode, - DBUS_TYPE_BOOLEAN, &first_request, - DBUS_TYPE_INVALID); - - if (dbus_connection_send_with_reply(g_conn, message, &call, -1) == - FALSE) { - error("Could not send dbus message"); - dbus_message_unref(message); - g_free(message_name); - return -1; - } - dbus_pending_call_set_notify(call, message_get_msg, s, NULL); - dbus_message_unref(message); - g_free(message_name); - DBG("-\n"); - return 1; -} - -static void message_update_msg(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - DBusMessageIter iter; - DBusError derr; - struct session *session = user_data; - int err; - DBG("+\n"); - - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } else { - dbus_message_iter_init(reply, &iter); - if (dbus_message_iter_get_arg_type(&iter) == - DBUS_TYPE_INT32) { - dbus_message_iter_get_basic(&iter, &err); - DBG("Error : %d\n", err); - session->msg_update_cb(session, err, - session->user_data); - } - } - dbus_message_unref(reply); - DBG("-\n"); -} - -int messages_update_inbox(void *session, - messages_status_cb callback, - void *user_data) -{ - if (TIZEN_FEATURE_BLUEZ_SMS_ONLY) { - /* MAP.TS.1.0.3 : TP/MMB/BV-16-I - Currently support is only for SMS, Since SMS service does not - allow the polling of its mailbox, it must return Not implemented */ - - return -ENOSYS; - } - - DBusPendingCall *call; - DBusMessage *message; - struct session *s = session; - - DBG("+\n"); - - s->msg_update_cb = callback; - s->user_data = user_data; - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_UPDATE_MESSAGE); - if (!message) { - error("Can't allocate new message"); - return -1; - } - - if (dbus_connection_send_with_reply(g_conn, message, &call, -1) == - FALSE) { - error("Could not send dbus message"); - dbus_message_unref(message); - return -1; - } - dbus_pending_call_set_notify(call, message_update_msg, s, NULL); - dbus_message_unref(message); - DBG("-\n"); - return 1; -} - -static void message_status_msg(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - DBusMessageIter iter; - DBusError derr; - struct session *session = user_data; - int err; - - DBG("+\n"); - - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } else { - dbus_message_iter_init(reply, &iter); - if (dbus_message_iter_get_arg_type(&iter) == - DBUS_TYPE_INT32) { - dbus_message_iter_get_basic(&iter, &err); - DBG("Error : %d\n", err); - session->msg_status_cb(session, err, - session->user_data); - } - } - dbus_message_unref(reply); - DBG("-\n"); -} - -int messages_set_read(void *session, const char *handle, uint8_t value, - messages_status_cb callback, void *user_data) -{ - DBusPendingCall *call; - DBusMessage *message; - struct session *s = session; - char *message_name; - gboolean read; - - DBG("+\n"); - - if (NULL == handle) - return -1; - - DBG("Message handle = %s\n", handle); - message_name = g_strdup(handle); - - s->msg_status_cb = callback; - s->user_data = user_data; - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_SET_READ_STATUS); - if (!message) { - error("Can't allocate new message"); - g_free(message_name); - return -1; - } - - read = value ? TRUE : FALSE; - - dbus_message_append_args(message, DBUS_TYPE_STRING, &message_name, - DBUS_TYPE_BOOLEAN, &read, - DBUS_TYPE_INVALID); - - if (dbus_connection_send_with_reply(g_conn, message, &call, -1) == - FALSE) { - error("Could not send dbus message"); - g_free(message_name); - dbus_message_unref(message); - return -1; - } - - dbus_pending_call_set_notify(call, message_status_msg, s, NULL); - dbus_message_unref(message); - g_free(message_name); - DBG("-\n"); - return 1; -} - -int messages_set_delete(void *session, const char *handle, - uint8_t value, - messages_status_cb callback, - void *user_data) -{ - DBusPendingCall *call; - DBusMessage *message; - struct session *s = session; - char *message_name; - gboolean del; - - DBG("+\n"); - - if (NULL == handle) - return -1; - - DBG("Message handle = %s\n", handle); - message_name = g_strdup(handle); - - s->msg_status_cb = callback; - s->user_data = user_data; - - message = dbus_message_new_method_call(BT_MAP_SERVICE_NAME, - BT_MAP_SERVICE_OBJECT_PATH, - BT_MAP_SERVICE_INTERFACE, - QUERY_SET_DELETE_STATUS); - if (!message) { - error("Can't allocate new message"); - g_free(message_name); - return -1; - } - - del = value ? TRUE : FALSE; - - dbus_message_append_args(message, DBUS_TYPE_STRING, &message_name, - DBUS_TYPE_BOOLEAN, &del, - DBUS_TYPE_INVALID); - - if (dbus_connection_send_with_reply(g_conn, message, &call, -1) == - FALSE) { - error("Could not send dbus message"); - g_free(message_name); - dbus_message_unref(message); - return -1; - } - - dbus_pending_call_set_notify(call, message_status_msg, s, NULL); - dbus_message_unref(message); - g_free(message_name); - DBG("-\n"); - return 1; -} - -void messages_abort(void *session) -{ -} diff --git a/obexd/plugins/messages-tracker.c b/obexd/plugins/messages-tracker.c deleted file mode 100644 index 60f3a80..0000000 --- a/obexd/plugins/messages-tracker.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - * - * OBEX Server - * - * Copyright (C) 2010-2011 Nokia Corporation - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "messages.h" - -struct message_folder { - char *name; - GSList *subfolders; - char *query; -}; - -struct session { - char *cwd; - struct message_folder *folder; - char *name; - uint16_t max; - uint16_t offset; - void *user_data; - void (*folder_list_cb)(void *session, int err, uint16_t size, - const char *name, void *user_data); -}; - -static struct message_folder *folder_tree = NULL; - -static struct message_folder *get_folder(const char *folder) -{ - GSList *folders = folder_tree->subfolders; - struct message_folder *last = NULL; - char **path; - int i; - - if (g_strcmp0(folder, "/") == 0) - return folder_tree; - - path = g_strsplit(folder, "/", 0); - - for (i = 1; path[i] != NULL; i++) { - gboolean match_found = FALSE; - GSList *l; - - for (l = folders; l != NULL; l = g_slist_next(l)) { - struct message_folder *folder = l->data; - - if (g_strcmp0(folder->name, path[i]) == 0) { - match_found = TRUE; - last = l->data; - folders = folder->subfolders; - break; - } - } - - if (!match_found) { - g_strfreev(path); - return NULL; - } - } - - g_strfreev(path); - - return last; -} - -static struct message_folder *create_folder(const char *name, const char *query) -{ - struct message_folder *folder = g_new0(struct message_folder, 1); - - folder->name = g_strdup(name); - folder->query = g_strdup(query); - - return folder; -} - -static void destroy_folder_tree(void *root) -{ - struct message_folder *folder = root; - GSList *tmp, *next; - - if (folder == NULL) - return; - - g_free(folder->name); - g_free(folder->query); - - tmp = folder->subfolders; - while (tmp != NULL) { - next = g_slist_next(tmp); - destroy_folder_tree(tmp->data); - tmp = next; - } - - g_slist_free(folder->subfolders); - g_free(folder); -} - -static void create_folder_tree(void) -{ - struct message_folder *parent, *child; - - folder_tree = create_folder("/", "FILTER (!BOUND(?msg))"); - - parent = create_folder("telecom", "FILTER (!BOUND(?msg))"); - folder_tree->subfolders = g_slist_append(folder_tree->subfolders, - parent); - - child = create_folder("msg", "FILTER (!BOUND(?msg))"); - parent->subfolders = g_slist_append(parent->subfolders, child); - - parent = child; - - child = create_folder("inbox", "?msg nmo:isSent \"false\" ; " - "nmo:isDeleted \"false\" ; " - "nmo:isDraft \"false\". "); - parent->subfolders = g_slist_append(parent->subfolders, child); - - child = create_folder("sent", "?msg nmo:isDeleted \"false\" ; " - "nmo:isSent \"true\" . "); - parent->subfolders = g_slist_append(parent->subfolders, child); - - child = create_folder("deleted", "?msg nmo:isDeleted \"true\" . "); - parent->subfolders = g_slist_append(parent->subfolders, child); -} - -int messages_init(void) -{ - create_folder_tree(); - - return 0; -} - -void messages_exit(void) -{ - destroy_folder_tree(folder_tree); -} - -int messages_connect(void **s) -{ - struct session *session = g_new0(struct session, 1); - - session->cwd = g_strdup("/"); - session->folder = folder_tree; - - *s = session; - - return 0; -} - -void messages_disconnect(void *s) -{ - struct session *session = s; - - g_free(session->cwd); - g_free(session); -} - -int messages_set_notification_registration(void *session, - void (*send_event)(void *session, - const struct messages_event *event, void *user_data), - void *user_data) -{ - return -ENOSYS; -} - -int messages_set_folder(void *s, const char *name, gboolean cdup) -{ - struct session *session = s; - char *newrel = NULL; - char *newabs; - char *tmp; - - if (name && (strchr(name, '/') || strcmp(name, "..") == 0)) - return -EBADR; - - if (cdup) { - if (session->cwd[0] == 0) - return -ENOENT; - - newrel = g_path_get_dirname(session->cwd); - - /* We use empty string for indication of the root directory */ - if (newrel[0] == '.' && newrel[1] == 0) - newrel[0] = 0; - } - - tmp = newrel; - if (!cdup && (!name || name[0] == 0)) - newrel = g_strdup(""); - else - newrel = g_build_filename(newrel ? newrel : session->cwd, name, - NULL); - g_free(tmp); - - if (newrel[0] != '/') - newabs = g_build_filename("/", newrel, NULL); - else - newabs = g_strdup(newrel); - - session->folder = get_folder(newabs); - if (session->folder == NULL) { - g_free(newrel); - g_free(newabs); - - return -ENOENT; - } - - g_free(newrel); - g_free(session->cwd); - session->cwd = newabs; - - return 0; -} - -static gboolean async_get_folder_listing(void *s) -{ - struct session *session = s; - gboolean count = FALSE; - int folder_count = 0; - char *path = NULL; - struct message_folder *folder; - GSList *dir; - - if (session->name && strchr(session->name, '/') != NULL) - goto done; - - path = g_build_filename(session->cwd, session->name, NULL); - - if (path == NULL || strlen(path) == 0) - goto done; - - folder = get_folder(path); - - if (folder == NULL) - goto done; - - if (session->max == 0) { - session->max = 0xffff; - session->offset = 0; - count = TRUE; - } - - for (dir = folder->subfolders; dir && - (folder_count - session->offset) < session->max; - folder_count++, dir = g_slist_next(dir)) { - struct message_folder *dir_data = dir->data; - - if (count == FALSE && session->offset <= folder_count) - session->folder_list_cb(session, -EAGAIN, 0, - dir_data->name, session->user_data); - } - - done: - session->folder_list_cb(session, 0, folder_count, NULL, - session->user_data); - - g_free(path); - g_free(session->name); - - return FALSE; -} - -int messages_get_folder_listing(void *s, const char *name, - uint16_t max, uint16_t offset, - messages_folder_listing_cb callback, - void *user_data) -{ - struct session *session = s; - session->name = g_strdup(name); - session->max = max; - session->offset = offset; - session->folder_list_cb = callback; - session->user_data = user_data; - - g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, async_get_folder_listing, - session, NULL); - - return 0; -} - -int messages_get_messages_listing(void *session, const char *name, - uint16_t max, uint16_t offset, - uint8_t subject_len, - const struct messages_filter *filter, - messages_get_messages_listing_cb callback, - void *user_data) -{ - return -ENOSYS; -} - -int messages_get_message(void *session, const char *handle, - unsigned long flags, - messages_get_message_cb callback, - void *user_data) -{ - return -ENOSYS; -} - -int messages_update_inbox(void *session, messages_status_cb callback, - void *user_data) -{ - return -ENOSYS; -} - -int messages_set_read(void *session, const char *handle, uint8_t value, - messages_status_cb callback, void *user_data) -{ - return -ENOSYS; -} - -int messages_set_delete(void *session, const char *handle, uint8_t value, - messages_status_cb callback, - void *user_data) -{ - return -ENOSYS; -} - -void messages_abort(void *session) -{ -} diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h old mode 100644 new mode 100755 index a3e0b81..00a16b1 --- a/obexd/plugins/messages.h +++ b/obexd/plugins/messages.h @@ -169,21 +169,6 @@ void messages_disconnect(void *session); * value is used to set the error code in OBEX response. ******************************************************************************/ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - -/* Registers Message Client for receiving message event reports. - * - * session: Backend session. - * address: Remote device address that request notification registration. - * status: To indicate message notification registraton status - * user_data: User data if any to be sent. - */ - -int messages_set_notification_registration(void *session, - char *address, uint8_t status, - void *user_data); -#else - /* Registers for messaging events notifications. * * session: Backend session. @@ -196,7 +181,6 @@ int messages_set_notification_registration(void *session, void (*send_event)(void *session, const struct messages_event *event, void *user_data), void *user_data); -#endif /* Changes current directory. * @@ -252,41 +236,6 @@ int messages_get_messages_listing(void *session, const char *name, messages_get_messages_listing_cb callback, void *user_data); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -/* Retrieves bMessage object (see MAP specification, ch. 3.1.3) of a given - * message. - * - * session: Backend session. - * handle: Handle of the message to retrieve. - * attachment: Indicates to return attachment in bMessage object. - * charset: Indicates the transcoding of the textual parts of delivered - * bMessage-content. - * fraction_request: Indicates message is a fractioned email as applied for - * some push-email services. - * fmore: Indicates whether next fraction is available. - * chunk: chunk of bMessage body - * - * Callback allows for returning bMessage in chunks. - */ -typedef void (*messages_get_message_cb)(void *session, int err, gboolean fmore, - const char *chunk, void *user_data); - -int messages_get_message(void *session, const char *handle, - uint8_t attachment, uint8_t charset, - uint8_t fraction_request, - messages_get_message_cb callback, - void *user_data); - -typedef void (*messages_push_message_cb)(void *session, int err, guint64 handle, - void *user_data); -int messages_push_message(void *session, const char *folder, - uint8_t transparent, uint8_t retry, - uint8_t charset, - messages_push_message_cb callback, - void *user_data); -int messages_push_message_data(void *session, const char *bmsg, - void *user_data); -#else #define MESSAGES_ATTACHMENT (1 << 0) #define MESSAGES_UTF8 (1 << 1) #define MESSAGES_FRACTION (1 << 2) @@ -318,7 +267,6 @@ int messages_get_message(void *session, const char *handle, unsigned long flags, messages_get_message_cb callback, void *user_data); -#endif typedef void (*messages_status_cb)(void *session, int err, void *user_data); @@ -354,25 +302,6 @@ int messages_set_read(void *session, const char *handle, uint8_t value, int messages_set_delete(void *session, const char *handle, uint8_t value, messages_status_cb callback, void *user_data); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - -/* Informs Message Server to modify status of the message. - * - * session: Backend session. - * address: Remote device address that request notification registraton. - * status: To indicate message notification service - * Callback shall be called for every notification registration request. - * user_data: User data if any to be sent. - */ -typedef void (*messages_notification_registration_cb)(void *session, int err, - void *user_data); - -int messages_notification_registration(void *session, - char *address, int status, - messages_notification_registration_cb callback, - void *user_data); -#endif - /* Aborts currently pending request. * * session: Backend session. diff --git a/obexd/plugins/opp.c b/obexd/plugins/opp.c old mode 100644 new mode 100755 diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c old mode 100644 new mode 100755 index 0949b6a..ad93208 --- a/obexd/plugins/pbap.c +++ b/obexd/plugins/pbap.c @@ -65,10 +65,6 @@ #define PHONEBOOKSIZE_TAG 0X08 #define NEWMISSEDCALLS_TAG 0X09 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define PBAP_MAXLISTCOUNT_MAX_VALUE 65535 -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - struct cache { gboolean valid; uint32_t index; @@ -89,9 +85,6 @@ struct pbap_session { uint32_t find_handle; struct cache cache; struct pbap_object *obj; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - void *backend_data; -#endif }; struct pbap_object { @@ -201,18 +194,11 @@ static void phonebook_size_result(const char *buffer, size_t bufsize, phonebooksize); pbap->obj->firstpacket = TRUE; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + if (missed > 0) { -#else - if (pbap->params->required_missedcall_call_header == TRUE) { -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ DBG("missed %d", missed); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY pbap->obj->apparam = g_obex_apparam_set_uint16( -#else - pbap->obj->apparam = g_obex_apparam_set_uint8( -#endif pbap->obj->apparam, NEWMISSEDCALLS_TAG, missed); @@ -245,20 +231,13 @@ static void query_result(const char *buffer, size_t bufsize, int vcards, else pbap->obj->buffer = g_string_append_len(pbap->obj->buffer, buffer, bufsize); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + if (missed > 0) { -#else - if (pbap->params->required_missedcall_call_header == TRUE) { -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ DBG("missed %d", missed); pbap->obj->firstpacket = TRUE; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY pbap->obj->apparam = g_obex_apparam_set_uint16( -#else - pbap->obj->apparam = g_obex_apparam_set_uint8( -#endif pbap->obj->apparam, NEWMISSEDCALLS_TAG, missed); @@ -394,27 +373,9 @@ static int generate_response(void *user_data) pbap->obj->apparam, PHONEBOOKSIZE_TAG, size); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (pbap->params->required_missedcall_call_header == TRUE) { - //DBG("missed %d", missed); - pbap->obj->apparam = g_obex_apparam_set_uint8( - pbap->obj->apparam, - NEWMISSEDCALLS_TAG, - pbap->params->new_missed_calls); - } -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ return 0; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (pbap->params->required_missedcall_call_header == TRUE) { - pbap->obj->firstpacket = TRUE; - pbap->obj->apparam = g_obex_apparam_set_uint8( - pbap->obj->apparam, - NEWMISSEDCALLS_TAG, - pbap->params->new_missed_calls); - } -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ /* * Don't free the sorted list content: this list contains @@ -445,18 +406,12 @@ static int generate_response(void *user_data) return 0; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY static void cache_ready_notify(void *user_data) -#else -static void cache_ready_notify(void *user_data, unsigned int new_missed_call) -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ { struct pbap_session *pbap = user_data; DBG(""); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - pbap->params->new_missed_calls = new_missed_call; -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ + phonebook_req_finalize(pbap->obj->request); pbap->obj->request = NULL; @@ -490,27 +445,10 @@ static void cache_entry_done(void *user_data) obex_object_set_io_flags(pbap->obj, G_IO_ERR, ret); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void cache_clear_notify(void *user_data) -{ - struct pbap_session *pbap = user_data; - - if (pbap == NULL) - return; - - pbap->cache.valid = FALSE; - pbap->cache.index = 0; - cache_clear(&pbap->cache); -} -#endif - static struct apparam_field *parse_aparam(const uint8_t *buffer, uint32_t hlen) { GObexApparam *apparam; struct apparam_field *param; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gboolean bmaxlistCount = FALSE; -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ apparam = g_obex_apparam_decode(buffer, hlen); if (apparam == NULL) @@ -528,27 +466,13 @@ static struct apparam_field *parse_aparam(const uint8_t *buffer, uint32_t hlen) g_obex_apparam_get_uint8(apparam, SEARCHATTRIB_TAG, ¶m->searchattrib); g_obex_apparam_get_uint8(apparam, FORMAT_TAG, ¶m->format); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bmaxlistCount = g_obex_apparam_get_uint16(apparam, MAXLISTCOUNT_TAG, - ¶m->maxlistcount); -#else g_obex_apparam_get_uint16(apparam, MAXLISTCOUNT_TAG, ¶m->maxlistcount); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ g_obex_apparam_get_uint16(apparam, LISTSTARTOFFSET_TAG, ¶m->liststartoffset); g_obex_apparam_get_uint64(apparam, FILTER_TAG, ¶m->filter); param->searchval = g_obex_apparam_get_string(apparam, SEARCHVALUE_TAG); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if(bmaxlistCount == FALSE) { - param->maxlistcount = PBAP_MAXLISTCOUNT_MAX_VALUE; - } - else { - /* Keep the MaxlistCount value as send in request from client */ - } -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - DBG("o %x sa %x sv %s fil %" G_GINT64_MODIFIER "x for %x max %x off %x", param->order, param->searchattrib, param->searchval, param->filter, param->format, param->maxlistcount, @@ -569,28 +493,10 @@ static void *pbap_connect(struct obex_session *os, int *err) pbap->folder = g_strdup("/"); pbap->find_handle = PHONEBOOK_INVALID_HANDLE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - int error; - - error = phonebook_connect(&pbap->backend_data); - if (error < 0) { - if (err) - *err = error; - goto failed; - } -#endif - if (err) *err = 0; return pbap; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -failed: - g_free(pbap); - - return NULL; -#endif } static int pbap_get(struct obex_session *os, void *user_data) @@ -637,13 +543,18 @@ static int pbap_get(struct obex_session *os, void *user_data) } else if (g_ascii_strcasecmp(type, VCARDLISTING_TYPE) == 0) { /* Always relative */ - if (!name || strlen(name) == 0) + if (!name || strlen(name) == 0) { /* Current folder */ path = g_strdup(pbap->folder); - else + } else { /* Current folder + relative path */ path = g_build_filename(pbap->folder, name, NULL); + /* clear cache */ + pbap->cache.valid = FALSE; + pbap->cache.index = 0; + cache_clear(&pbap->cache); + } } else if (g_ascii_strcasecmp(type, VCARDENTRY_TYPE) == 0) { /* File name only */ path = g_strdup(name); @@ -701,13 +612,6 @@ static void pbap_disconnect(struct obex_session *os, void *user_data) manager_unregister_session(os); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!pbap) - return; - - phonebook_disconnect(pbap->backend_data); -#endif - if (pbap->obj) pbap->obj->session = NULL; @@ -772,13 +676,6 @@ static void *vobject_pull_open(const char *name, int oflag, mode_t mode, ret = -EBADR; goto fail; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (strcmp(name, "/telecom/mch.vcf") == 0) - pbap->params->required_missedcall_call_header = TRUE; - - DBG("[%s] - required_missedcall_call_header [%d] ", - name,pbap->params->required_missedcall_call_header); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ if (pbap->params->maxlistcount == 0) cb = phonebook_size_result; @@ -849,13 +746,6 @@ static void *vobject_list_open(const char *name, int oflag, mode_t mode, ret = -EPERM; goto fail; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (strcmp(name, "/telecom/mch") == 0) - pbap->params->required_missedcall_call_header = TRUE; - - DBG("[%s] - required_missedcall_call_header [%d] ", - name,pbap->params->required_missedcall_call_header); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ /* PullvCardListing always get the contacts from the cache */ @@ -867,10 +757,6 @@ static void *vobject_list_open(const char *name, int oflag, mode_t mode, cache_ready_notify, pbap, &ret); if (ret == 0) obj = vobject_create(pbap, request); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - phonebook_set_cache_notification(pbap->backend_data, - cache_clear_notify, pbap); -#endif } if (ret < 0) goto fail; @@ -896,11 +782,7 @@ static void *vobject_vcard_open(const char *name, int oflag, mode_t mode, struct pbap_session *pbap = context; const char *id; uint32_t handle; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - int ret = 0; -#else int ret; -#endif void *request; DBG("name %s context %p valid %d", name, context, pbap->cache.valid); @@ -917,18 +799,8 @@ static void *vobject_vcard_open(const char *name, int oflag, mode_t mode, if (pbap->cache.valid == FALSE) { pbap->find_handle = handle; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - request = phonebook_create_cache(pbap->folder, - (phonebook_entry_cb)cache_entry_notify, - (phonebook_cache_ready_cb)cache_entry_done, pbap, &ret); -#else request = phonebook_create_cache(pbap->folder, cache_entry_notify, cache_entry_done, pbap, &ret); -#endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - phonebook_set_cache_notification(pbap->backend_data, - cache_clear_notify, pbap); -#endif goto done; } @@ -969,15 +841,8 @@ static ssize_t vobject_pull_get_next_header(void *object, void *buf, size_t mtu, if (obj->firstpacket) { obj->firstpacket = FALSE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gsize count = 0; - count = g_obex_apparam_encode(obj->apparam, buf, mtu); - DBG("APPARAM Processed remove tags"); - g_obex_apparam_remove_all(obj->apparam); - return count; -#else + return g_obex_apparam_encode(obj->apparam, buf, mtu); -#endif } return 0; @@ -1026,22 +891,11 @@ static ssize_t vobject_list_get_next_header(void *object, void *buf, size_t mtu, return -EAGAIN; *hi = G_OBEX_HDR_APPARAM; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + if (pbap->params->maxlistcount == 0) return g_obex_apparam_encode(obj->apparam, buf, mtu); return 0; -#else - if (obj->apparam != NULL) { - gsize count = 0; - count = g_obex_apparam_encode(obj->apparam, buf, mtu); - DBG("APPARAM Processed remove tags"); - g_obex_apparam_remove_all(obj->apparam); - return count; - } - else - return 0; -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ } static ssize_t vobject_list_read(void *object, void *buf, size_t count) diff --git a/obexd/plugins/pcsuite.c b/obexd/plugins/pcsuite.c old mode 100644 new mode 100755 diff --git a/obexd/plugins/phonebook-dummy.c b/obexd/plugins/phonebook-dummy.c old mode 100644 new mode 100755 index d30fa32..29ae889 --- a/obexd/plugins/phonebook-dummy.c +++ b/obexd/plugins/phonebook-dummy.c @@ -520,16 +520,10 @@ void *phonebook_get_entry(const char *folder, const char *id, struct dummy_data *dummy; char *filename; int fd; - guint ret; filename = g_build_filename(root_folder, folder, id, NULL); fd = open(filename, O_RDONLY); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_free(filename); -#endif - if (fd < 0) { DBG("open(): %s(%d)", strerror(errno), errno); if (err) @@ -543,13 +537,13 @@ void *phonebook_get_entry(const char *folder, const char *id, dummy->apparams = params; dummy->fd = fd; - ret = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, read_entry, dummy, + dummy->id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, read_entry, dummy, dummy_free); if (err) *err = 0; - return GINT_TO_POINTER(ret); + return dummy; } void *phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb, @@ -558,7 +552,7 @@ void *phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb, struct cache_query *query; char *foldername; DIR *dp; - guint ret; + struct dummy_data *dummy; foldername = g_build_filename(root_folder, name, NULL); dp = opendir(foldername); @@ -577,11 +571,13 @@ void *phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb, query->user_data = user_data; query->dp = dp; - ret = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, create_cache, query, - query_free); + dummy = g_new0(struct dummy_data, 1); + + dummy->id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, create_cache, + query, query_free); if (err) *err = 0; - return GINT_TO_POINTER(ret); + return dummy; } diff --git a/obexd/plugins/phonebook-ebook.c b/obexd/plugins/phonebook-ebook.c deleted file mode 100644 index c422585..0000000 --- a/obexd/plugins/phonebook-ebook.c +++ /dev/null @@ -1,708 +0,0 @@ -/* - * - * OBEX Server - * - * Copyright (C) 2009-2010 Intel Corporation - * Copyright (C) 2007-2010 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include -#include - -#include "lib/bluetooth.h" - -#include "obexd/src/log.h" -#include "obexd/src/obex.h" -#include "obexd/src/service.h" -#include "phonebook.h" - -#define QUERY_FN "(contains \"family_name\" \"%s\")" -#define QUERY_NAME "(contains \"given_name\" \"%s\")" -#define QUERY_PHONE "(contains \"phone\" \"%s\")" - -struct query_context { - const struct apparam_field *params; - phonebook_cb contacts_cb; - phonebook_entry_cb entry_cb; - phonebook_cache_ready_cb ready_cb; - EBookQuery *query; - unsigned int count; - GString *buf; - char *id; - unsigned queued_calls; - void *user_data; - GSList *ebooks; - gboolean canceled; -}; - -static char *attribute_mask[] = { -/* 0 */ "VERSION", - "FN", - "N", - "PHOTO", - "BDAY", - "ADR", - "LABEL", - "TEL", -/* 8 */ "EMAIL", - "MAILER", - "TZ", - "GEO", - "TITLE", - "ROLE", - "LOGO", - "AGENT", -/* 16 */ "ORG", - "NOTE", - "REV", - "SOUND", - "URL", - "UID", - "KEY", - "NICKNAME", -/* 24 */ "CATEGORIES", - "PROID", - "CLASS", - "SORT-STRING", -/* 28 */ "X-IRMC-CALL-DATETIME", - NULL - -}; - -static void close_ebooks(GSList *ebooks) -{ - g_slist_free_full(ebooks, g_object_unref); -} - -static void free_query_context(struct query_context *data) -{ - g_free(data->id); - - if (data->buf != NULL) - g_string_free(data->buf, TRUE); - - if (data->query != NULL) - e_book_query_unref(data->query); - - close_ebooks(data->ebooks); - - g_free(data); -} - -static char *evcard_to_string(EVCard *evcard, unsigned int format, - uint64_t filter) -{ - EVCard *evcard2; - GList *l; - char *vcard; - - if (!filter) - return e_vcard_to_string(evcard, EVC_FORMAT_VCARD_30); - /* XXX There is no support for VCARD 2.1 at this time */ - - /* - * Mandatory attributes for vCard 2.1 are VERSION ,N and TEL. - * Mandatory attributes for vCard 3.0 are VERSION, N, FN and TEL - */ - filter = format == EVC_FORMAT_VCARD_30 ? filter | 0x87: filter | 0x85; - - l = e_vcard_get_attributes(evcard); - evcard2 = e_vcard_new(); - for (; l; l = g_list_next(l)) { - EVCardAttribute *attrib = l->data; - const char *name; - int i; - - if (!attrib) - continue; - - name = e_vcard_attribute_get_name(attrib); - - for (i = 0; attribute_mask[i] != NULL; i++) { - if (!(filter & (1 << i))) - continue; - if (g_strcmp0(name, attribute_mask[i]) != 0) - continue; - - e_vcard_add_attribute(evcard2, - e_vcard_attribute_copy(attrib)); - } - } - - vcard = e_vcard_to_string(evcard2, format); - g_object_unref(evcard2); - - return vcard; -} - -static void ebookpull_cb(EBook *book, const GError *gerr, GList *contacts, - void *user_data) -{ - struct query_context *data = user_data; - GList *l; - unsigned int count, maxcount; - - data->queued_calls--; - - if (data->canceled) - goto canceled; - - if (gerr != NULL) { - error("E-Book query failed: %s", gerr->message); - goto done; - } - - DBG(""); - - /* - * When MaxListCount is zero, PCE wants to know the number of used - * indexes in the phonebook of interest. All other parameters that - * may be present in the request shall be ignored. - */ - maxcount = data->params->maxlistcount; - if (maxcount == 0) { - data->count += g_list_length(contacts); - goto done; - } - - l = g_list_nth(contacts, data->params->liststartoffset); - - for (count = 0; l && count + data->count < maxcount; l = g_list_next(l), - count++) { - EContact *contact = E_CONTACT(l->data); - EVCard *evcard = E_VCARD(contact); - char *vcard; - - vcard = evcard_to_string(evcard, EVC_FORMAT_VCARD_30, - data->params->filter); - - data->buf = g_string_append(data->buf, vcard); - data->buf = g_string_append(data->buf, "\r\n"); - g_free(vcard); - } - - DBG("collected %d vcards", count); - - data->count += count; - - g_list_free_full(contacts, g_object_unref); - -done: - if (data->queued_calls == 0) { - GString *buf = data->buf; - data->buf = NULL; - - data->contacts_cb(buf->str, buf->len, data->count, - 0, TRUE, data->user_data); - - g_string_free(buf, TRUE); - - } - - return; - -canceled: - if (data->queued_calls == 0) - free_query_context(data); -} - -static void ebook_entry_cb(EBook *book, const GError *gerr, - EContact *contact, void *user_data) -{ - struct query_context *data = user_data; - EVCard *evcard; - char *vcard; - size_t len; - - data->queued_calls--; - - if (data->canceled) - goto done; - - if (gerr != NULL) { - error("E-Book query failed: %s", gerr->message); - goto done; - } - - DBG(""); - - evcard = E_VCARD(contact); - - vcard = evcard_to_string(evcard, EVC_FORMAT_VCARD_30, - data->params->filter); - - len = vcard ? strlen(vcard) : 0; - - data->count++; - data->contacts_cb(vcard, len, 1, 0, TRUE, data->user_data); - - g_free(vcard); - g_object_unref(contact); - - return; - -done: - if (data->queued_calls == 0) { - if (data->count == 0) - data->contacts_cb(NULL, 0, 1, 0, TRUE, - data->user_data); - else if (data->canceled) - free_query_context(data); - } -} - -static char *evcard_name_attribute_to_string(EVCard *evcard) -{ - EVCardAttribute *attrib; - GList *l; - GString *name = NULL; - - attrib = e_vcard_get_attribute(evcard, EVC_N); - if (!attrib) - return NULL; - - for (l = e_vcard_attribute_get_values(attrib); l; l = l->next) { - const char *value = l->data; - - if (!strlen(value)) - continue; - - if (!name) - name = g_string_new(value); - else { - name = g_string_append(name, ";"); - name = g_string_append(name, l->data); - } - } - - if (!name) - return NULL; - - return g_string_free(name, FALSE); -} - -static void cache_cb(EBook *book, const GError *gerr, GList *contacts, - void *user_data) -{ - struct query_context *data = user_data; - GList *l; - - data->queued_calls--; - - if (data->canceled) - goto canceled; - - if (gerr != NULL) { - error("E-Book operation failed: %s", gerr->message); - goto done; - } - - DBG(""); - - for (l = contacts; l; l = g_list_next(l)) { - EContact *contact = E_CONTACT(l->data); - EVCard *evcard = E_VCARD(contact); - EVCardAttribute *attrib; - char *uid, *tel, *name; - - name = evcard_name_attribute_to_string(evcard); - if (!name) - continue; - - attrib = e_vcard_get_attribute(evcard, EVC_UID); - if (!attrib) - continue; - - uid = e_vcard_attribute_get_value(attrib); - if (!uid) - continue; - - attrib = e_vcard_get_attribute(evcard, EVC_TEL); - if (attrib) - tel = e_vcard_attribute_get_value(attrib); - else - tel = g_strdup(""); - - data->entry_cb(uid, PHONEBOOK_INVALID_HANDLE, name, NULL, - tel, data->user_data); - - g_free(name); - g_free(uid); - g_free(tel); - } - - g_list_free_full(contacts, g_object_unref); - -done: - if (data->queued_calls == 0) - data->ready_cb(data->user_data); - - return; - -canceled: - if (data->queued_calls == 0) - free_query_context(data); -} - -static GSList *traverse_sources(GSList *ebooks, GSList *sources, - char **default_src) { - GError *gerr = NULL; - - for (; sources != NULL; sources = g_slist_next(sources)) { - char *uri; - ESource *source = E_SOURCE(sources->data); - EBook *ebook = e_book_new(source, &gerr); - - if (ebook == NULL) { - error("Can't create user's address book: %s", - gerr->message); - g_clear_error(&gerr); - continue; - } - - uri = e_source_get_uri(source); - if (g_strcmp0(*default_src, uri) == 0) { - g_free(uri); - continue; - } - g_free(uri); - - if (e_book_open(ebook, FALSE, &gerr) == FALSE) { - error("Can't open e-book address book: %s", - gerr->message); - g_object_unref(ebook); - g_clear_error(&gerr); - continue; - } - - if (*default_src == NULL) - *default_src = e_source_get_uri(source); - - DBG("%s address book opened", e_source_peek_name(source)); - - ebooks = g_slist_append(ebooks, ebook); - } - - return ebooks; -} - -int phonebook_init(void) -{ - g_type_init(); - - return 0; -} - -static GSList *open_ebooks(void) -{ - GError *gerr = NULL; - ESourceList *src_list; - GSList *list; - char *default_src = NULL; - GSList *ebooks = NULL; - - if (e_book_get_addressbooks(&src_list, &gerr) == FALSE) { - error("Can't list user's address books: %s", gerr->message); - g_error_free(gerr); - return NULL; - } - - list = e_source_list_peek_groups(src_list); - while (list != NULL) { - ESourceGroup *group = E_SOURCE_GROUP(list->data); - GSList *sources = e_source_group_peek_sources(group); - - ebooks = traverse_sources(ebooks, sources, &default_src); - - list = list->next; - } - - g_free(default_src); - g_object_unref(src_list); - - return ebooks; -} - -void phonebook_exit(void) -{ -} - -char *phonebook_set_folder(const char *current_folder, - const char *new_folder, uint8_t flags, int *err) -{ - gboolean root, child; - char *fullname = NULL, *tmp1, *tmp2, *base; - int ret = 0, len; - - root = (g_strcmp0("/", current_folder) == 0); - child = (new_folder && strlen(new_folder) != 0); - - /* Evolution back-end will support /telecom/pb folder only */ - - switch (flags) { - case 0x02: - /* Go back to root */ - if (!child) { - fullname = g_strdup("/"); - goto done; - } - - /* Go down 1 level */ - fullname = g_build_filename(current_folder, new_folder, NULL); - if (strcmp(PB_TELECOM_FOLDER, fullname) != 0 && - strcmp(PB_CONTACTS_FOLDER, fullname) != 0) { - g_free(fullname); - fullname = NULL; - ret = -ENOENT; - } - - break; - case 0x03: - /* Go up 1 level */ - if (root) { - /* Already root */ - ret = -EBADR; - goto done; - } - - /* - * Removing one level of the current folder. Current folder - * contains AT LEAST one level since it is not at root folder. - * Use glib utility functions to handle invalid chars in the - * folder path properly. - */ - tmp1 = g_path_get_basename(current_folder); - tmp2 = g_strrstr(current_folder, tmp1); - len = tmp2 - (current_folder + 1); - - g_free(tmp1); - - if (len == 0) - base = g_strdup("/"); - else - base = g_strndup(current_folder, len); - - /* Return one level only */ - if (!child) { - fullname = base; - goto done; - } - - fullname = g_build_filename(base, new_folder, NULL); - if (strcmp(fullname, PB_TELECOM_FOLDER) != 0 && - strcmp(fullname, PB_CONTACTS_FOLDER) != 0) { - g_free(fullname); - fullname = NULL; - ret = -ENOENT; - } - - g_free(base); - - break; - default: - ret = -EBADR; - break; - } - -done: - if (err) - *err = ret; - - return fullname; -} - -void phonebook_req_finalize(void *request) -{ - struct query_context *data = request; - - if (data->queued_calls == 0) - free_query_context(data); - else - data->canceled = TRUE; -} - -void *phonebook_pull(const char *name, const struct apparam_field *params, - phonebook_cb cb, void *user_data, int *err) -{ - struct query_context *data; - - if (g_strcmp0(PB_CONTACTS, name) != 0) { - if (err) - *err = -ENOENT; - - return NULL; - } - - data = g_new0(struct query_context, 1); - data->contacts_cb = cb; - data->params = params; - data->user_data = user_data; - data->buf = g_string_new(""); - data->query = e_book_query_any_field_contains(""); - data->ebooks = open_ebooks(); - - if (err) - *err = data->ebooks == NULL ? -EIO : 0; - - return data; -} - -int phonebook_pull_read(void *request) -{ - struct query_context *data = request; - GSList *l; - - if (!data) - return -ENOENT; - - for (l = data->ebooks; l != NULL; l = g_slist_next(l)) { - EBook *ebook = l->data; - - if (e_book_is_opened(ebook) == FALSE) - continue; - - if (e_book_get_contacts_async(ebook, data->query, - ebookpull_cb, data) == TRUE) - data->queued_calls++; - } - - if (data->queued_calls == 0) - return -ENOENT; - - return 0; -} - -void *phonebook_get_entry(const char *folder, const char *id, - const struct apparam_field *params, - phonebook_cb cb, void *user_data, int *err) -{ - struct query_context *data; - GSList *l; - - data = g_new0(struct query_context, 1); - data->contacts_cb = cb; - data->params = params; - data->user_data = user_data; - data->id = g_strdup(id); - data->ebooks = open_ebooks(); - - for (l = data->ebooks; l != NULL; l = g_slist_next(l)) { - EBook *ebook = l->data; - - if (e_book_is_opened(ebook) == FALSE) - continue; - - if (e_book_get_contact_async(ebook, data->id, - ebook_entry_cb, data) == TRUE) - data->queued_calls++; - } - - if (err) - *err = (data->queued_calls == 0 ? -ENOENT : 0); - - return data; -} - -void *phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb, - phonebook_cache_ready_cb ready_cb, void *user_data, int *err) -{ - struct query_context *data; - EBookQuery *query; - GSList *l; - EContact *me; - EVCard *evcard; - GError *gerr = NULL; - EBook *eb; - EVCardAttribute *attrib; - char *uid, *tel, *cname; - - if (g_strcmp0(PB_CONTACTS_FOLDER, name) != 0) { - if (err) - *err = -ENOENT; - - return NULL; - } - - DBG(""); - - query = e_book_query_any_field_contains(""); - - data = g_new0(struct query_context, 1); - data->entry_cb = entry_cb; - data->ready_cb = ready_cb; - data->user_data = user_data; - data->query = query; - data->ebooks = open_ebooks(); - - /* Add 0.vcf */ - if (e_book_get_self(&me, &eb, &gerr) == FALSE) { - g_error_free(gerr); - goto next; - } - - evcard = E_VCARD(me); - - cname = evcard_name_attribute_to_string(evcard); - if (!cname) - cname = g_strdup(""); - - attrib = e_vcard_get_attribute(evcard, EVC_UID); - uid = e_vcard_attribute_get_value(attrib); - if (!uid) - uid = g_strdup(""); - - attrib = e_vcard_get_attribute(evcard, EVC_TEL); - if (attrib) - tel = e_vcard_attribute_get_value(attrib); - else - tel = g_strdup(""); - - data->entry_cb(uid, 0, cname, NULL, tel, data->user_data); - - data->count++; - - g_free(cname); - g_free(uid); - g_free(tel); - g_object_unref(eb); - -next: - for (l = data->ebooks; l != NULL; l = g_slist_next(l)) { - EBook *ebook = l->data; - - if (e_book_is_opened(ebook) == FALSE) - continue; - - if (e_book_get_contacts_async(ebook, query, - cache_cb, data) == TRUE) - data->queued_calls++; - } - - if (err) - *err = (data->queued_calls == 0 ? -ENOENT : 0); - - return data; -} diff --git a/obexd/plugins/phonebook-tizen.c b/obexd/plugins/phonebook-tizen.c deleted file mode 100755 index dcb6179..0000000 --- a/obexd/plugins/phonebook-tizen.c +++ /dev/null @@ -1,813 +0,0 @@ -/* - * - * OBEX Server - * - * Copyright (c) 2000-2016 Samsung Electronics Co., Ltd. All rights reserved. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "log.h" -#include "phonebook.h" - -#include -#include - -#define PHONEBOOK_DESTINATION "org.bluez.pb_agent" -#define PHONEBOOK_PATH "/org/bluez/pb_agent" -#define PHONEBOOK_INTERFACE "org.bluez.PbAgent" - -#define QUERY_GET_PHONEBOOK_FOLDER_LIST "GetPhonebookFolderList" -#define QUERY_GET_PHONEBOOK_SIZE "GetPhonebookSize" -#define QUERY_GET_PHONEBOOK "GetPhonebook" -#define QUERY_GET_PHONEBOOK_LIST "GetPhonebookList" -#define QUERY_GET_PHONEBOOK_ENTRY "GetPhonebookEntry" -#define QUERY_DESTROY_AGENT "DestroyAgent" - -static GPtrArray *folder_list = NULL; - -struct phonebook_data { - phonebook_cb cb; - DBusPendingCallNotifyFunction reply_cb; - DBusPendingCall *call; - void *user_data; - const struct apparam_field *params; - - phonebook_entry_cb entry_cb; - phonebook_cache_ready_cb ready_cb; - - char *req_name; -}; - -struct phonebook_session { - DBusConnection *connection; - phonebook_cache_clear_cb clear_cb; - unsigned int clear_id; - - void *user_data; -}; - -static gboolean folder_is_valid(const gchar *folder, - gboolean leaf_only) -{ - int i; - int folder_len; - - if (folder_list == NULL || folder == NULL) - return FALSE; - - folder_len = strlen(folder); - - for (i = 0 ; i < folder_list->len; i++) { - char *str = (char *)g_ptr_array_index(folder_list, i); - - if (folder_len > strlen(str)) - continue; - - if (g_strcmp0(str, folder) == 0) - return TRUE; - - if (leaf_only == TRUE) - continue; - - if (strncmp(str, folder, folder_len) == 0) { - - if (*(folder + folder_len - 1) == '/') - return TRUE; /* folder is ended with '/' */ - - if (*(str + folder_len) == '/') - return TRUE; /* folder is matched */ - } - } - - return FALSE; -} - -static DBusPendingCall* phonebook_request(struct phonebook_data *data, - const gchar *method, - DBusPendingCallNotifyFunction function, - int first_arg_type, - ...) -{ - DBusConnection *connection; - DBusPendingCall *call; - DBusMessage *message; - - va_list args; - - DBG("%s\n", method); - - if (!method) { - error("Can't get method name"); - return NULL; - } - - connection = g_dbus_setup_bus(DBUS_BUS_SYSTEM, NULL, NULL); - if (!connection) { - error("Can't get on session bus"); - return NULL; - } - - message = dbus_message_new_method_call(PHONEBOOK_DESTINATION, - PHONEBOOK_PATH, - PHONEBOOK_INTERFACE, - method); - if (!message) { - dbus_connection_unref(connection); - error("Can't Allocate new message"); - return NULL; - } - - va_start(args, first_arg_type); - dbus_message_append_args_valist(message, first_arg_type, args); - va_end(args); - - if (dbus_connection_send_with_reply(connection, message, &call, -1) == FALSE) { - dbus_message_unref(message); - dbus_connection_unref(connection); - DBG("-"); - return NULL; - } - dbus_pending_call_set_notify(call, function, data, NULL); - - dbus_message_unref(message); - dbus_connection_unref(connection); - - DBG("-"); - return call; -} - -static void get_phonebook_size_reply(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - struct phonebook_data *s_data = user_data; - DBusError derr; - uint32_t phonebook_size; - - unsigned int new_missed_call = 0; - - DBG(""); - dbus_pending_call_unref(s_data->call); - s_data->call = NULL; - - if (!reply) { - DBG("Reply Error\n"); - return; - } - - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - phonebook_size = 0; - } else { - dbus_message_get_args(reply, NULL, - DBUS_TYPE_UINT32, &phonebook_size, - DBUS_TYPE_UINT32, &new_missed_call, - DBUS_TYPE_INVALID); - DBG("phonebooksize:%d\n", phonebook_size); - } - - s_data->cb(NULL, 0, phonebook_size, new_missed_call, TRUE, s_data->user_data); - - dbus_message_unref(reply); -} - -static void get_phonebook_reply(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - struct phonebook_data *s_data = user_data; - DBusError derr; - GString *buffer; - - unsigned int new_missed_call = 0; - - uint32_t count = 0; - - DBG(""); - dbus_pending_call_unref(s_data->call); - s_data->call = NULL; - - if (!reply) { - DBG("Reply Error\n"); - return; - } - - buffer = g_string_new(""); - - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } else { - DBusMessageIter iter; - - dbus_message_iter_init(reply, &iter); - - if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY) { - DBusMessageIter recurse_iter; - - dbus_message_iter_recurse(&iter, &recurse_iter); - while (dbus_message_iter_get_arg_type(&recurse_iter) == DBUS_TYPE_STRING) { - gchar *str; - - dbus_message_iter_get_basic(&recurse_iter, &str); - dbus_message_iter_next(&recurse_iter); - - g_string_append(buffer, str); - - DBG("str:\n%s\n", str); - - count++; - } - dbus_message_iter_next(&iter); - } - - if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT32) - dbus_message_iter_get_basic(&iter, &new_missed_call); - - DBG("new_missed_call %d\n", new_missed_call); - } - - s_data->cb(buffer->str, buffer->len, count, new_missed_call, 1, s_data->user_data); - - g_string_free(buffer, TRUE); - dbus_message_unref(reply); -} - - -static void get_phonebook_list_reply(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - DBusMessageIter iter, iter_struct, entry; - struct phonebook_data *data = user_data; - DBusError derr; - uint32_t handle = 0; - const char *name = NULL; - const char *tel = NULL; - char id[10]; - unsigned int new_missed_call = 0; - - dbus_pending_call_unref(data->call); - data->call = NULL; - if (!reply) { - DBG("Reply Error\n"); - return; - } - - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } else { - - dbus_message_iter_init(reply, &iter); - - dbus_message_iter_recurse(&iter, &iter_struct); - - while (dbus_message_iter_get_arg_type(&iter_struct) == - DBUS_TYPE_STRUCT) { - dbus_message_iter_recurse(&iter_struct, &entry); - - dbus_message_iter_get_basic(&entry, &name); - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &tel); - dbus_message_iter_next(&entry); - dbus_message_iter_get_basic(&entry, &handle); - - /* - DBG("[handle:%d name:%s tel:%s]\n", handle, name, tel); - */ - - snprintf(id, sizeof(id), "%d.vcf", handle); - - data->entry_cb(id, handle, name, NULL, tel, - data->user_data); - - dbus_message_iter_next(&iter_struct); - } - - dbus_message_iter_next(&iter); - if (dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT32) { - dbus_message_iter_get_basic(&iter, &new_missed_call); - } - - DBG("new_missed_call %d\n", new_missed_call); - } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - data->ready_cb(data->user_data, new_missed_call); -#else - data->ready_cb(data->user_data); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - - dbus_message_unref(reply); -} - -static void get_phonebook_entry_reply(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply = dbus_pending_call_steal_reply(call); - struct phonebook_data *s_data = user_data; - DBusError derr; - const char *phonebook_entry; - - DBG(""); - dbus_pending_call_unref(s_data->call); - s_data->call = NULL; - - if (!reply) { - DBG("Reply Error\n"); - return; - } - - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("Replied with an error: %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } else { - dbus_message_get_args(reply, NULL, DBUS_TYPE_STRING, - &phonebook_entry, DBUS_TYPE_INVALID); - DBG("phonebook_entry:[%s]\n", phonebook_entry); - } - - s_data->cb(phonebook_entry, strlen(phonebook_entry), 1, 0, TRUE, - s_data->user_data); - - dbus_message_unref(reply); -} - -static gboolean clear_signal(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct phonebook_session *session; - - if (user_data == NULL) - return FALSE; - - DBG(""); - session = user_data; - - session->clear_cb(session->user_data); - - g_dbus_remove_watch(session->connection, session->clear_id); - session->clear_id = 0; - - return TRUE; -} - -static gboolean phonebook_folder_list_init(struct phonebook_session *session) -{ - DBusMessage *message; - DBusMessage *reply; - - DBusMessageIter iter; - DBusMessageIter recurse_iter; - - DBusError error; - - if (session->connection == NULL) { - session->connection = g_dbus_setup_bus(DBUS_BUS_SYSTEM, - NULL, NULL); - } - - if (session->connection == NULL) { - DBG("Can't get on s bus"); - return FALSE; - } - - message = dbus_message_new_method_call(PHONEBOOK_DESTINATION, - PHONEBOOK_PATH, - PHONEBOOK_INTERFACE, - QUERY_GET_PHONEBOOK_FOLDER_LIST); - - if (message == NULL) { - DBG("Can't allocate dbus message"); - return FALSE; - } - - dbus_error_init(&error); - - reply = dbus_connection_send_with_reply_and_block(session->connection, - message, -1, &error); - - if (!reply) { - if (dbus_error_is_set(&error) == TRUE) { - DBG("%s", error.message); - dbus_error_free(&error); - } else { - DBG("Failed to get contacts"); - } - dbus_message_unref(message); - return FALSE; - } - - dbus_message_iter_init(reply, &iter); - - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) { - dbus_message_unref(message); - dbus_message_unref(reply); - return FALSE; - } - - if (folder_list) { - g_ptr_array_free(folder_list, TRUE); - folder_list = NULL; - } - - folder_list = g_ptr_array_new(); - - dbus_message_iter_recurse(&iter, &recurse_iter); - - while (dbus_message_iter_get_arg_type(&recurse_iter) - == DBUS_TYPE_STRING) { - gchar *str; - - dbus_message_iter_get_basic(&recurse_iter, &str); - DBG("folder list %s\n", str); - g_ptr_array_add(folder_list, g_strdup(str)); - - dbus_message_iter_next(&recurse_iter); - } - - dbus_message_unref(message); - dbus_message_unref(reply); - return TRUE; -} - -int phonebook_init(void) -{ - return 0; -} - -void phonebook_exit(void) -{ -} - -int phonebook_connect(void **user_data) -{ - struct phonebook_session *session; - gboolean ret; - - DBG(""); - - session = g_new0(struct phonebook_session, 1); - - *user_data = session; - - ret = phonebook_folder_list_init(session); - - if (ret) - return 0; - - return -1; -} - -void phonebook_disconnect(void *user_data) -{ - struct phonebook_session *session; - DBusMessage *message; - DBG(""); - session = user_data; - - if (folder_list) { - g_ptr_array_free(folder_list, TRUE); - folder_list = NULL; - } - - if (!session->connection) { - g_free(session); - return; - } - - - if (session->clear_id) - g_dbus_remove_watch(session->connection, session->clear_id); - - message = dbus_message_new_method_call(PHONEBOOK_DESTINATION, - PHONEBOOK_PATH, - PHONEBOOK_INTERFACE, - QUERY_DESTROY_AGENT); - - if (message) { - if (dbus_connection_send(session->connection, message, - NULL) == FALSE) - error("Could not send dbus message"); - - dbus_message_unref(message); - } - - dbus_connection_unref(session->connection); - g_free(session); -} - -char *phonebook_set_folder(const char *current_folder, - const char *new_folder, uint8_t flags, int *err) -{ - char *tmp1, *tmp2, *base, *path = NULL; - gboolean root, child; - int ret = 0; - int len; - - root = (g_strcmp0("/", current_folder) == 0); - child = (new_folder && strlen(new_folder) != 0); - - switch (flags) { - case 0x02: - /* Go back to root */ - if (!child) { - path = g_strdup("/"); - goto done; - } - - path = g_build_filename(current_folder, new_folder, NULL); - break; - case 0x03: - /* Go up 1 level */ - if (root) { - /* Already root */ - path = g_strdup("/"); - goto done; - } - - /* - * Removing one level of the current folder. Current folder - * contains AT LEAST one level since it is not at root folder. - * Use glib utility functions to handle invalid chars in the - * folder path properly. - */ - tmp1 = g_path_get_basename(current_folder); - tmp2 = g_strrstr(current_folder, tmp1); - len = tmp2 - (current_folder + 1); - - g_free(tmp1); - - if (len == 0) - base = g_strdup("/"); - else - base = g_strndup(current_folder, len); - - /* Return: one level only */ - if (!child) { - path = base; - goto done; - } - - path = g_build_filename(base, new_folder, NULL); - g_free(base); - - break; - default: - ret = -EBADR; - break; - } - -done: - if (path && !folder_is_valid(path, FALSE)) - ret = -ENOENT; - - if (ret < 0) { - g_free(path); - path = NULL; - } - - if (err) - *err = ret; - - DBG("path : %s\n", path); - - return path; -} - -void phonebook_req_finalize(void *request) -{ - struct phonebook_data *data = request; - - DBG(""); - - if (!data) - return; - - if (data->call) { - dbus_pending_call_cancel(data->call); - dbus_pending_call_unref(data->call); - } - g_free(data->req_name); - g_free(data); -} - -void *phonebook_pull(const char *name, const struct apparam_field *params, - phonebook_cb cb, void *user_data, int *err) -{ - struct phonebook_data *data; - char *folder; - - DBG("name %s", name); - - if (!g_str_has_suffix(name, ".vcf")) { - if (err) - *err = -ENOENT; - - return NULL; - } - - folder = g_strndup(name, strlen(name) - 4); - - if (!folder_is_valid(folder, TRUE)) { - if (err) - *err = -ENOENT; - - g_free(folder); - return NULL; - } - - g_free(folder); - - data = g_new0(struct phonebook_data, 1); - data->params = params; - data->user_data = user_data; - data->cb = cb; - data->req_name = g_strdup(name); - - if (err) - *err = 0; - - return data; -} - -int phonebook_pull_read(void *request) -{ - struct phonebook_data *data = request; - - DBG("name %s", data->req_name); - - if (data->params->maxlistcount == 0) { - data->call = phonebook_request(data, - QUERY_GET_PHONEBOOK_SIZE, - get_phonebook_size_reply, - DBUS_TYPE_STRING, &data->req_name, - DBUS_TYPE_INVALID); - return 0; - } - - data->call = phonebook_request(data, - QUERY_GET_PHONEBOOK, - get_phonebook_reply, - DBUS_TYPE_STRING, &data->req_name, - DBUS_TYPE_UINT64, &data->params->filter, - DBUS_TYPE_BYTE, &data->params->format, - DBUS_TYPE_UINT16, &data->params->maxlistcount, - DBUS_TYPE_UINT16, &data->params->liststartoffset, - DBUS_TYPE_INVALID); - - return 0; -} - -void *phonebook_get_entry(const char *folder, const char *id, - const struct apparam_field *params, phonebook_cb cb, - void *user_data, int *err) -{ - struct phonebook_data *data; - - DBG(""); - if (!g_str_has_suffix(id, ".vcf")) { - if (err) - *err = -ENOENT; - - return NULL; - } - - if (!folder_is_valid(folder, TRUE)) { - if (err) - *err = - ENOENT; - - return NULL; - } - - DBG("folder %s id %s", folder, id); - - data = g_new0(struct phonebook_data, 1); - data->params = params; - data->user_data = user_data; - data->cb = cb; - - data->call = phonebook_request(data, - QUERY_GET_PHONEBOOK_ENTRY, - get_phonebook_entry_reply, - DBUS_TYPE_STRING, &folder, - DBUS_TYPE_STRING, &id, - DBUS_TYPE_UINT64, &data->params->filter, - DBUS_TYPE_BYTE, &data->params->format, - DBUS_TYPE_INVALID); - - if (*err) { - if (data->call) - *err = 0; - else { - *err = -ENOENT; - g_free(data); - data = NULL; - } - } - - return data; -} - -void *phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb, - phonebook_cache_ready_cb ready_cb, void *user_data, int *err) -{ - struct phonebook_data *data; - - if (!folder_is_valid(name, TRUE)) { - if (err) - *err = - ENOENT; - - return NULL; - } - - DBG("name %s", name); - - data = g_new0(struct phonebook_data, 1); - data->user_data = user_data; - data->entry_cb = entry_cb; - data->ready_cb = ready_cb; - - data->call = phonebook_request(data, - QUERY_GET_PHONEBOOK_LIST, - get_phonebook_list_reply, - DBUS_TYPE_STRING, &name, - DBUS_TYPE_INVALID); - - if (*err) { - if (data->call) - *err = 0; - else { - *err = -ENOENT; - g_free(data); - data = NULL; - } - } - - return data; -} - -void phonebook_set_cache_notification(void *session, - phonebook_cache_clear_cb clear_cb, - void *user_data) -{ - struct phonebook_session *s = session; - - DBG(""); - s->clear_cb = clear_cb; - - if (s->connection == NULL) { - s->connection = g_dbus_setup_bus(DBUS_BUS_SYSTEM, - NULL, NULL); - - if (s->connection == NULL) { - error("Can't get on s bus"); - return; - } - } - - s->user_data = user_data; - - if (s->clear_id) { - g_dbus_remove_watch(s->connection, s->clear_id); - s->clear_id = 0; - } - - s->clear_id = g_dbus_add_signal_watch(s->connection, - NULL, PHONEBOOK_PATH, PHONEBOOK_INTERFACE, - "clear", clear_signal, - s, NULL); -} diff --git a/obexd/plugins/phonebook-tracker.c b/obexd/plugins/phonebook-tracker.c deleted file mode 100644 index 0743629..0000000 --- a/obexd/plugins/phonebook-tracker.c +++ /dev/null @@ -1,1718 +0,0 @@ -/* - * Phonebook access through D-Bus vCard and call history service - * - * Copyright (C) 2010 Nokia Corporation - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "obexd/src/log.h" -#include "obexd/src/obex.h" -#include "obexd/src/service.h" -#include "obexd/src/mimetype.h" -#include "phonebook.h" -#include "vcard.h" - -#define TRACKER_SERVICE "org.freedesktop.Tracker1" -#define TRACKER_RESOURCES_PATH "/org/freedesktop/Tracker1/Resources" -#define TRACKER_RESOURCES_INTERFACE "org.freedesktop.Tracker1.Resources" - -#define TRACKER_DEFAULT_CONTACT_ME "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me" -#define AFFILATION_HOME "Home" -#define AFFILATION_WORK "Work" -#define ADDR_FIELD_AMOUNT 7 -#define PULL_QUERY_COL_AMOUNT 23 -#define COUNT_QUERY_COL_AMOUNT 1 - -#define COL_PHONE_AFF 0 /* work/home phone numbers */ -#define COL_FULL_NAME 1 -#define COL_FAMILY_NAME 2 -#define COL_GIVEN_NAME 3 -#define COL_ADDITIONAL_NAME 4 -#define COL_NAME_PREFIX 5 -#define COL_NAME_SUFFIX 6 -#define COL_ADDR_AFF 7 /* addresses from affilation */ -#define COL_BIRTH_DATE 8 -#define COL_NICKNAME 9 -#define COL_URL 10 -#define COL_PHOTO 11 -#define COL_ORG_ROLE 12 -#define COL_UID 13 -#define COL_TITLE 14 -#define COL_AFF_TYPE 15 -#define COL_ORG_NAME 16 -#define COL_ORG_DEPARTMENT 17 -#define COL_EMAIL_AFF 18 /* email's from affilation (work/home) */ -#define COL_DATE 19 -#define COL_SENT 20 -#define COL_ANSWERED 21 -#define CONTACTS_ID_COL 22 -#define CONTACT_ID_PREFIX "urn:uuid:" -#define CALL_ID_PREFIX "message:" - -#define FAX_NUM_TYPE "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#FaxNumber" -#define MOBILE_NUM_TYPE "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#CellPhoneNumber" - -#define MAIN_DELIM "\30" /* Main delimiter between phones, addresses, emails*/ -#define SUB_DELIM "\31" /* Delimiter used in telephone number strings*/ -#define ADDR_DELIM "\37" /* Delimiter used for address data fields */ -#define MAX_FIELDS 100 /* Max amount of fields to be concatenated at once*/ -#define VCARDS_PART_COUNT 50 /* amount of vcards sent at once to PBAP core */ -#define QUERY_OFFSET_FORMAT "%s OFFSET %d" - -#define CONTACTS_QUERY_ALL \ -"SELECT " \ -"(SELECT GROUP_CONCAT(fn:concat(rdf:type(?aff_number)," \ -"\"\31\", nco:phoneNumber(?aff_number)), \"\30\")" \ -"WHERE {" \ -" ?_role nco:hasPhoneNumber ?aff_number" \ -"}) " \ -"nco:fullname(?_contact) " \ -"nco:nameFamily(?_contact) " \ -"nco:nameGiven(?_contact) " \ -"nco:nameAdditional(?_contact) " \ -"nco:nameHonorificPrefix(?_contact) " \ -"nco:nameHonorificSuffix(?_contact) " \ -"(SELECT GROUP_CONCAT(fn:concat(" \ -"tracker:coalesce(nco:pobox(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:extendedAddress(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:streetAddress(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:locality(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:region(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:postalcode(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:country(?aff_addr), \"\"), " \ -"\"\31\", rdfs:label(?_role) ), " \ -"\"\30\") " \ -"WHERE {" \ -"?_role nco:hasPostalAddress ?aff_addr" \ -"}) " \ -"nco:birthDate(?_contact) " \ -"(SELECT " \ -" ?nick " \ -" WHERE { " \ -" { " \ -" ?_contact nco:nickname ?nick " \ -" } UNION { " \ -" ?_contact nco:hasAffiliation ?role . " \ -" ?role nco:hasIMAddress ?im . " \ -" ?im nco:imNickname ?nick " \ -" } " \ -" } " \ -") " \ -"(SELECT GROUP_CONCAT(fn:concat( " \ - "?url_val, \"\31\", tracker:coalesce(rdfs:label(?_role), \"\") "\ - "), \"\30\") " \ - "WHERE {" \ - "?_role nco:url ?url_val . " \ -"})" \ -"nie:url(nco:photo(?_contact)) " \ -"nco:role(?_role) " \ -"nco:contactUID(?_contact) " \ -"nco:title(?_role) " \ -"rdfs:label(?_role) " \ -"nco:fullname(nco:org(?_role))" \ -"nco:department(?_role) " \ -"(SELECT GROUP_CONCAT(fn:concat(?emailaddress,\"\31\"," \ - "tracker:coalesce(rdfs:label(?_role), \"\"))," \ - "\"\30\") " \ - "WHERE { " \ - "?_role nco:hasEmailAddress " \ - " [ nco:emailAddress ?emailaddress ] " \ - "}) " \ -"\"NOTACALL\" \"false\" \"false\" " \ -"?_contact " \ -"WHERE {" \ -" ?_contact a nco:PersonContact ." \ -" OPTIONAL {?_contact nco:hasAffiliation ?_role .}" \ -"}" \ -"ORDER BY tracker:id(?_contact)" - -#define CONTACTS_QUERY_ALL_LIST \ - "SELECT ?c nco:nameFamily(?c) " \ - "nco:nameGiven(?c) nco:nameAdditional(?c) " \ - "nco:nameHonorificPrefix(?c) nco:nameHonorificSuffix(?c) " \ - "(SELECT " \ - "?nick " \ - "WHERE { " \ - "{ " \ - "?c nco:nickname ?nick " \ - "} UNION { " \ - "?c nco:hasAffiliation ?role . " \ - "?role nco:hasIMAddress ?im . " \ - "?im nco:imNickname ?nick " \ - "} " \ - "} " \ - ") " \ - "nco:phoneNumber(?h) " \ - "WHERE { " \ - "?c a nco:PersonContact . " \ - "OPTIONAL { ?c nco:hasPhoneNumber ?h . } " \ - "OPTIONAL { " \ - "?c nco:hasAffiliation ?a . " \ - "?a nco:hasPhoneNumber ?h . " \ - "} " \ - "} GROUP BY ?c" - -#define CALLS_CONSTRAINTS(CONSTRAINT) \ -" WHERE { " \ - "?_call a nmo:Call . " \ - "?_unb_contact a nco:Contact . " \ - "?_unb_contact nco:hasPhoneNumber ?_cpn . " \ -CONSTRAINT \ - "OPTIONAL { " \ - "{ SELECT ?_contact ?_no ?_role ?_number " \ - "count(?_contact) as ?cnt " \ - "WHERE { " \ - "?_contact a nco:PersonContact . " \ - "{ " \ - "?_contact nco:hasAffiliation ?_role . "\ - "?_role nco:hasPhoneNumber ?_number . " \ - "} UNION { " \ - "?_contact nco:hasPhoneNumber ?_number" \ - "} " \ - "?_number maemo:localPhoneNumber ?_no . " \ - "} GROUP BY ?_no } " \ - "FILTER(?cnt = 1) " \ - "?_cpn maemo:localPhoneNumber ?_no . " \ - "} " \ -"} " - -#define CALLS_LIST(CONSTRAINT) \ -"SELECT ?_call nco:nameFamily(?_contact) " \ - "nco:nameGiven(?_contact) nco:nameAdditional(?_contact) " \ - "nco:nameHonorificPrefix(?_contact) " \ - "nco:nameHonorificSuffix(?_contact) " \ - "(SELECT " \ - "?nick " \ - "WHERE { " \ - "{ " \ - "?_contact nco:nickname ?nick " \ - "} UNION { " \ - "?_contact nco:hasAffiliation ?role . " \ - "?role nco:hasIMAddress ?im . " \ - "?im nco:imNickname ?nick " \ - "} " \ - "} " \ - ") " \ - "nco:phoneNumber(?_cpn) " \ -CALLS_CONSTRAINTS(CONSTRAINT) \ -"ORDER BY DESC(nmo:sentDate(?_call)) " - -#define CALLS_QUERY(CONSTRAINT) \ -"SELECT " \ -"(SELECT fn:concat(rdf:type(?role_number)," \ - "\"\31\", nco:phoneNumber(?role_number))" \ - "WHERE {" \ - "{" \ - " ?_role nco:hasPhoneNumber ?role_number " \ - " FILTER (?role_number = ?_number)" \ - "} UNION { " \ - "?_unb_contact nco:hasPhoneNumber ?role_number . " \ - " FILTER (!bound(?_role)) " \ - "}" \ -"} GROUP BY nco:phoneNumber(?role_number) ) " \ - "nco:fullname(?_contact) " \ - "nco:nameFamily(?_contact) " \ - "nco:nameGiven(?_contact) " \ - "nco:nameAdditional(?_contact) " \ - "nco:nameHonorificPrefix(?_contact) " \ - "nco:nameHonorificSuffix(?_contact) " \ -"(SELECT GROUP_CONCAT(fn:concat(" \ - "tracker:coalesce(nco:pobox(?aff_addr), \"\"), \"\37\"," \ - "tracker:coalesce(nco:extendedAddress(?aff_addr), \"\"), \"\37\","\ - "tracker:coalesce(nco:streetAddress(?aff_addr), \"\"), \"\37\","\ - "tracker:coalesce(nco:locality(?aff_addr), \"\"), \"\37\"," \ - "tracker:coalesce(nco:region(?aff_addr), \"\"), \"\37\"," \ - "tracker:coalesce(nco:postalcode(?aff_addr), \"\"), \"\37\"," \ - "tracker:coalesce(nco:country(?aff_addr), \"\"), " \ - "\"\31\", rdfs:label(?c_role) ), " \ - "\"\30\") " \ - "WHERE {" \ - "?_contact nco:hasAffiliation ?c_role . " \ - "?c_role nco:hasPostalAddress ?aff_addr" \ - "}) " \ - "nco:birthDate(?_contact) " \ -"(SELECT " \ - "?nick " \ - "WHERE { " \ - " { " \ - " ?_contact nco:nickname ?nick " \ - " } UNION { " \ - " ?_contact nco:hasAffiliation ?role . " \ - " ?role nco:hasIMAddress ?im . " \ - " ?im nco:imNickname ?nick " \ - " } " \ - " } " \ - ") " \ -"(SELECT GROUP_CONCAT(fn:concat(?url_value, \"\31\", " \ - "tracker:coalesce(rdfs:label(?c_role), \"\")), \"\30\") " \ - "WHERE {" \ - "?_contact nco:hasAffiliation ?c_role . " \ - "?c_role nco:url ?url_value . " \ -"})" \ - "nie:url(nco:photo(?_contact)) " \ - "nco:role(?_role) " \ - "nco:contactUID(?_contact) " \ - "nco:title(?_role) " \ - "rdfs:label(?_role) " \ - "nco:fullname(nco:org(?_role)) " \ - "nco:department(?_role) " \ -"(SELECT GROUP_CONCAT(fn:concat(?emailaddress,\"\31\"," \ - "tracker:coalesce(rdfs:label(?c_role), \"\"))," \ - "\"\30\") " \ - "WHERE { " \ - "?_contact nco:hasAffiliation ?c_role . " \ - "?c_role nco:hasEmailAddress " \ - " [ nco:emailAddress ?emailaddress ] " \ - "}) " \ - "nmo:receivedDate(?_call) " \ - "nmo:isSent(?_call) " \ - "nmo:isAnswered(?_call) " \ - "?_call " \ -CALLS_CONSTRAINTS(CONSTRAINT) \ -"ORDER BY DESC(nmo:sentDate(?_call)) " - -#define MISSED_CONSTRAINT \ -"?_call nmo:from ?_unb_contact . " \ -"?_call nmo:isSent false . " \ -"?_call nmo:isAnswered false . " - -#define INCOMING_CONSTRAINT \ -"?_call nmo:from ?_unb_contact . " \ -"?_call nmo:isSent false . " \ -"?_call nmo:isAnswered true . " - -#define OUTGOING_CONSTRAINT \ -"?_call nmo:to ?_unb_contact . " \ -"?_call nmo:isSent true . " - -#define COMBINED_CONSTRAINT \ -"{ " \ -" ?_call nmo:from ?_unb_contact . " \ -" ?_call nmo:isSent false " \ -"} UNION { " \ -" ?_call nmo:to ?_unb_contact . " \ -" ?_call nmo:isSent true " \ -"} " - -#define CALL_URI_CONSTRAINT \ -COMBINED_CONSTRAINT \ -"FILTER (?_call = <%s>) " - -#define MISSED_CALLS_QUERY CALLS_QUERY(MISSED_CONSTRAINT) -#define MISSED_CALLS_LIST CALLS_LIST(MISSED_CONSTRAINT) -#define INCOMING_CALLS_QUERY CALLS_QUERY(INCOMING_CONSTRAINT) -#define INCOMING_CALLS_LIST CALLS_LIST(INCOMING_CONSTRAINT) -#define OUTGOING_CALLS_QUERY CALLS_QUERY(OUTGOING_CONSTRAINT) -#define OUTGOING_CALLS_LIST CALLS_LIST(OUTGOING_CONSTRAINT) -#define COMBINED_CALLS_QUERY CALLS_QUERY(COMBINED_CONSTRAINT) -#define COMBINED_CALLS_LIST CALLS_LIST(COMBINED_CONSTRAINT) -#define CONTACT_FROM_CALL_QUERY CALLS_QUERY(CALL_URI_CONSTRAINT) - -#define CONTACTS_QUERY_FROM_URI \ -"SELECT " \ -"(SELECT GROUP_CONCAT(fn:concat(rdf:type(?aff_number)," \ -"\"\31\", nco:phoneNumber(?aff_number)), \"\30\")" \ -"WHERE {" \ -" ?_role nco:hasPhoneNumber ?aff_number" \ -"}) " \ -"nco:fullname(<%s>) " \ -"nco:nameFamily(<%s>) " \ -"nco:nameGiven(<%s>) " \ -"nco:nameAdditional(<%s>) " \ -"nco:nameHonorificPrefix(<%s>) " \ -"nco:nameHonorificSuffix(<%s>) " \ -"(SELECT GROUP_CONCAT(fn:concat(" \ -"tracker:coalesce(nco:pobox(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:extendedAddress(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:streetAddress(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:locality(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:region(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:postalcode(?aff_addr), \"\"), \"\37\"," \ -"tracker:coalesce(nco:country(?aff_addr), \"\"), " \ -"\"\31\", rdfs:label(?_role) ), " \ -"\"\30\") " \ -"WHERE {" \ -"?_role nco:hasPostalAddress ?aff_addr" \ -"}) " \ -"nco:birthDate(<%s>) " \ -"(SELECT " \ -" ?nick " \ -" WHERE { " \ -" { " \ -" ?_contact nco:nickname ?nick " \ -" } UNION { " \ -" ?_contact nco:hasAffiliation ?role . " \ -" ?role nco:hasIMAddress ?im . " \ -" ?im nco:imNickname ?nick " \ -" } " \ -" FILTER (?_contact = <%s>)" \ -" } " \ -") " \ -"(SELECT GROUP_CONCAT(fn:concat( " \ - "?url_val, \"\31\", tracker:coalesce(rdfs:label(?_role), \"\") "\ - "), \"\30\") " \ - "WHERE {" \ - "?_role nco:url ?url_val . " \ -"})" \ -"nie:url(nco:photo(<%s>)) " \ -"nco:role(?_role) " \ -"nco:contactUID(<%s>) " \ -"nco:title(?_role) " \ -"rdfs:label(?_role) " \ -"nco:fullname(nco:org(?_role))" \ -"nco:department(?_role) " \ -"(SELECT GROUP_CONCAT(fn:concat(?emailaddress,\"\31\"," \ - "tracker:coalesce(rdfs:label(?_role), \"\"))," \ - "\"\30\") " \ - "WHERE { " \ - "?_role nco:hasEmailAddress " \ - " [ nco:emailAddress ?emailaddress ] " \ - "}) " \ -"\"NOTACALL\" \"false\" \"false\" " \ -"<%s> " \ -"WHERE {" \ -" <%s> a nco:PersonContact ." \ -" OPTIONAL {<%s> nco:hasAffiliation ?_role .}" \ -"}" - -#define CONTACTS_OTHER_QUERY_FROM_URI \ - "SELECT fn:concat(\"TYPE_OTHER\", \"\31\", nco:phoneNumber(?t))"\ - "\"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" " \ - "\"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" " \ - " \"NOTACALL\" \"false\" \"false\" <%s> " \ - "WHERE { " \ - "<%s> a nco:Contact . " \ - "OPTIONAL { <%s> nco:hasPhoneNumber ?t . } " \ - "} " - -#define CONTACTS_COUNT_QUERY \ - "SELECT COUNT(?c) " \ - "WHERE {" \ - "?c a nco:PersonContact ." \ - "}" - -#define MISSED_CALLS_COUNT_QUERY \ - "SELECT COUNT(?call) WHERE {" \ - "?c a nco:Contact ;" \ - "nco:hasPhoneNumber ?h ." \ - "?call a nmo:Call ;" \ - "nmo:isSent false ;" \ - "nmo:from ?c ;" \ - "nmo:isAnswered false ." \ - "}" - -#define INCOMING_CALLS_COUNT_QUERY \ - "SELECT COUNT(?call) WHERE {" \ - "?c a nco:Contact ;" \ - "nco:hasPhoneNumber ?h ." \ - "?call a nmo:Call ;" \ - "nmo:isSent false ;" \ - "nmo:from ?c ;" \ - "nmo:isAnswered true ." \ - "}" - -#define OUTGOING_CALLS_COUNT_QUERY \ - "SELECT COUNT(?call) WHERE {" \ - "?c a nco:Contact ;" \ - "nco:hasPhoneNumber ?h ." \ - "?call a nmo:Call ;" \ - "nmo:isSent true ;" \ - "nmo:to ?c ." \ - "}" - -#define COMBINED_CALLS_COUNT_QUERY \ - "SELECT COUNT(?call) WHERE {" \ - "{" \ - "?c a nco:Contact ;" \ - "nco:hasPhoneNumber ?h ." \ - "?call a nmo:Call ;" \ - "nmo:isSent true ;" \ - "nmo:to ?c ." \ - "}UNION {" \ - "?c a nco:Contact ;" \ - "nco:hasPhoneNumber ?h ." \ - "?call a nmo:Call ;" \ - "nmo:from ?c ." \ - "}" \ - "}" - -#define NEW_MISSED_CALLS_COUNT_QUERY \ - "SELECT COUNT(?call) WHERE {" \ - "?c a nco:Contact ;" \ - "nco:hasPhoneNumber ?h ." \ - "?call a nmo:Call ;" \ - "nmo:isSent false ;" \ - "nmo:from ?c ;" \ - "nmo:isAnswered false ;" \ - "nmo:isRead false ." \ - "}" - -typedef int (*reply_list_foreach_t) (const char **reply, int num_fields, - void *user_data); - -typedef void (*add_field_t) (struct phonebook_contact *contact, - const char *value, int type); - -struct pending_reply { - reply_list_foreach_t callback; - void *user_data; - int num_fields; -}; - -struct contact_data { - char *id; - struct phonebook_contact *contact; -}; - -struct phonebook_data { - phonebook_cb cb; - void *user_data; - int index; - gboolean vcardentry; - const struct apparam_field *params; - GSList *contacts; - phonebook_cache_ready_cb ready_cb; - phonebook_entry_cb entry_cb; - int newmissedcalls; - GCancellable *query_canc; - char *req_name; - int vcard_part_count; - int tracker_index; -}; - -struct phonebook_index { - GArray *phonebook; - int index; -}; - -static TrackerSparqlConnection *connection = NULL; - -static const char *name2query(const char *name) -{ - if (g_str_equal(name, PB_CONTACTS)) - return CONTACTS_QUERY_ALL; - else if (g_str_equal(name, PB_CALLS_INCOMING)) - return INCOMING_CALLS_QUERY; - else if (g_str_equal(name, PB_CALLS_OUTGOING)) - return OUTGOING_CALLS_QUERY; - else if (g_str_equal(name, PB_CALLS_MISSED)) - return MISSED_CALLS_QUERY; - else if (g_str_equal(name, PB_CALLS_COMBINED)) - return COMBINED_CALLS_QUERY; - - return NULL; -} - -static const char *name2count_query(const char *name) -{ - if (g_str_equal(name, PB_CONTACTS)) - return CONTACTS_COUNT_QUERY; - else if (g_str_equal(name, PB_CALLS_INCOMING)) - return INCOMING_CALLS_COUNT_QUERY; - else if (g_str_equal(name, PB_CALLS_OUTGOING)) - return OUTGOING_CALLS_COUNT_QUERY; - else if (g_str_equal(name, PB_CALLS_MISSED)) - return MISSED_CALLS_COUNT_QUERY; - else if (g_str_equal(name, PB_CALLS_COMBINED)) - return COMBINED_CALLS_COUNT_QUERY; - - return NULL; -} - -static gboolean folder_is_valid(const char *folder) -{ - if (folder == NULL) - return FALSE; - - if (g_str_equal(folder, "/")) - return TRUE; - else if (g_str_equal(folder, PB_TELECOM_FOLDER)) - return TRUE; - else if (g_str_equal(folder, PB_CONTACTS_FOLDER)) - return TRUE; - else if (g_str_equal(folder, PB_CALLS_INCOMING_FOLDER)) - return TRUE; - else if (g_str_equal(folder, PB_CALLS_OUTGOING_FOLDER)) - return TRUE; - else if (g_str_equal(folder, PB_CALLS_MISSED_FOLDER)) - return TRUE; - else if (g_str_equal(folder, PB_CALLS_COMBINED_FOLDER)) - return TRUE; - - return FALSE; -} - -static const char *folder2query(const char *folder) -{ - if (g_str_equal(folder, PB_CONTACTS_FOLDER)) - return CONTACTS_QUERY_ALL_LIST; - else if (g_str_equal(folder, PB_CALLS_INCOMING_FOLDER)) - return INCOMING_CALLS_LIST; - else if (g_str_equal(folder, PB_CALLS_OUTGOING_FOLDER)) - return OUTGOING_CALLS_LIST; - else if (g_str_equal(folder, PB_CALLS_MISSED_FOLDER)) - return MISSED_CALLS_LIST; - else if (g_str_equal(folder, PB_CALLS_COMBINED_FOLDER)) - return COMBINED_CALLS_LIST; - - return NULL; -} - -static const char **string_array_from_cursor(TrackerSparqlCursor *cursor, - int array_len) -{ - const char **result; - int i; - - result = g_new0(const char *, array_len); - - for (i = 0; i < array_len; ++i) { - TrackerSparqlValueType type; - - type = tracker_sparql_cursor_get_value_type(cursor, i); - - if (type == TRACKER_SPARQL_VALUE_TYPE_BLANK_NODE || - type == TRACKER_SPARQL_VALUE_TYPE_UNBOUND) - /* For null/unbound type filling result part with ""*/ - result[i] = ""; - else - /* Filling with string representation of content*/ - result[i] = tracker_sparql_cursor_get_string(cursor, i, - NULL); - } - - return result; -} - -static void update_cancellable(struct phonebook_data *pdata, - GCancellable *canc) -{ - if (pdata->query_canc) - g_object_unref(pdata->query_canc); - - pdata->query_canc = canc; -} - -static void async_query_cursor_next_cb(GObject *source, GAsyncResult *result, - gpointer user_data) -{ - struct pending_reply *pending = user_data; - TrackerSparqlCursor *cursor = TRACKER_SPARQL_CURSOR(source); - GCancellable *cancellable; - GError *error = NULL; - gboolean success; - const char **node; - int err; - - success = tracker_sparql_cursor_next_finish( - TRACKER_SPARQL_CURSOR(source), - result, &error); - - if (!success) { - if (error) { - DBG("cursor_next error: %s", error->message); - g_error_free(error); - } else - /* When tracker_sparql_cursor_next_finish ends with - * failure and no error is set, that means end of - * results returned by query */ - pending->callback(NULL, 0, pending->user_data); - - goto failed; - } - - node = string_array_from_cursor(cursor, pending->num_fields); - err = pending->callback(node, pending->num_fields, pending->user_data); - g_free(node); - - /* Fetch next result only if processing current chunk ended with - * success. Sometimes during processing data, we are able to determine - * if there is no need to get more data from tracker - by example - * stored amount of data parts is big enough for sending and we might - * want to suspend processing or just some error occurred. */ - if (!err) { - cancellable = g_cancellable_new(); - update_cancellable(pending->user_data, cancellable); - tracker_sparql_cursor_next_async(cursor, cancellable, - async_query_cursor_next_cb, - pending); - return; - } - -failed: - g_object_unref(cursor); - g_free(pending); -} - -static int query_tracker(const char *query, int num_fields, - reply_list_foreach_t callback, void *user_data) -{ - struct pending_reply *pending; - GCancellable *cancellable; - TrackerSparqlCursor *cursor; - GError *error = NULL; - - DBG(""); - - if (connection == NULL) - connection = tracker_sparql_connection_get_direct( - NULL, &error); - - if (!connection) { - if (error) { - DBG("direct-connection error: %s", error->message); - g_error_free(error); - } - - return -EINTR; - } - - cancellable = g_cancellable_new(); - update_cancellable(user_data, cancellable); - cursor = tracker_sparql_connection_query(connection, query, - cancellable, &error); - - if (cursor == NULL) { - if (error) { - DBG("connection_query error: %s", error->message); - g_error_free(error); - } - - g_object_unref(cancellable); - - return -EINTR; - } - - pending = g_new0(struct pending_reply, 1); - pending->callback = callback; - pending->user_data = user_data; - pending->num_fields = num_fields; - - /* Now asynchronously going through each row of results - callback - * async_query_cursor_next_cb will be called ALWAYS, even if async - * request was canceled */ - tracker_sparql_cursor_next_async(cursor, cancellable, - async_query_cursor_next_cb, - pending); - - return 0; -} - -static char *iso8601_utc_to_localtime(const char *datetime) -{ - time_t time; - struct tm tm, *local; - char localdate[32]; - int nr; - - memset(&tm, 0, sizeof(tm)); - - nr = sscanf(datetime, "%04u-%02u-%02uT%02u:%02u:%02u", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday, - &tm.tm_hour, &tm.tm_min, &tm.tm_sec); - if (nr < 6) { - /* Invalid time format */ - error("sscanf(): %s (%d)", strerror(errno), errno); - return g_strdup(""); - } - - /* Time already in localtime */ - if (!g_str_has_suffix(datetime, "Z")) { - strftime(localdate, sizeof(localdate), "%Y%m%dT%H%M%S", &tm); - return g_strdup(localdate); - } - - tm.tm_year -= 1900; /* Year since 1900 */ - tm.tm_mon--; /* Months since January, values 0-11 */ - - time = mktime(&tm); - time -= timezone; - - local = localtime(&time); - - strftime(localdate, sizeof(localdate), "%Y%m%dT%H%M%S", local); - - return g_strdup(localdate); -} - -static void set_call_type(struct phonebook_contact *contact, - const char *datetime, const char *is_sent, - const char *is_answered) -{ - gboolean sent, answered; - - if (g_strcmp0(datetime, "NOTACALL") == 0) { - contact->calltype = CALL_TYPE_NOT_A_CALL; - return; - } - - sent = g_str_equal(is_sent, "true"); - answered = g_str_equal(is_answered, "true"); - - if (sent == FALSE) { - if (answered == FALSE) - contact->calltype = CALL_TYPE_MISSED; - else - contact->calltype = CALL_TYPE_INCOMING; - } else - contact->calltype = CALL_TYPE_OUTGOING; - - /* Tracker gives time in the ISO 8601 format, UTC time */ - contact->datetime = iso8601_utc_to_localtime(datetime); -} - -static gboolean contact_matches(struct contact_data *c_data, const char *id, - const char *datetime) -{ - char *localtime; - int cmp_ret; - - if (g_strcmp0(c_data->id, id) != 0) - return FALSE; - - /* id is equal and not call history entry => contact matches */ - if (c_data->contact->calltype == CALL_TYPE_NOT_A_CALL) - return TRUE; - - /* for call history entries have to compare also timestamps of calls */ - localtime = iso8601_utc_to_localtime(datetime); - cmp_ret = g_strcmp0(c_data->contact->datetime, localtime); - g_free(localtime); - - return (cmp_ret == 0) ? TRUE : FALSE; -} - -static struct phonebook_contact *find_contact(GSList *contacts, const char *id, - const char *datetime) -{ - GSList *l; - - for (l = contacts; l; l = l->next) { - struct contact_data *c_data = l->data; - - if (contact_matches(c_data, id, datetime)) - return c_data->contact; - } - - return NULL; -} - -static struct phonebook_field *find_field(GSList *fields, const char *value, - int type) -{ - GSList *l; - - for (l = fields; l; l = l->next) { - struct phonebook_field *field = l->data; - /* Returning phonebook number if phone values and type values - * are equal */ - if (g_strcmp0(field->text, value) == 0 && field->type == type) - return field; - } - - return NULL; -} - -static void add_phone_number(struct phonebook_contact *contact, - const char *phone, int type) -{ - struct phonebook_field *number; - - if (phone == NULL || strlen(phone) == 0) - return; - - /* Not adding number if there is already added with the same value */ - if (find_field(contact->numbers, phone, type)) - return; - - number = g_new0(struct phonebook_field, 1); - number->text = g_strdup(phone); - number->type = type; - - contact->numbers = g_slist_append(contact->numbers, number); -} - -static void add_email(struct phonebook_contact *contact, const char *address, - int type) -{ - struct phonebook_field *email; - - if (address == NULL || strlen(address) == 0) - return; - - /* Not adding email if there is already added with the same value */ - if (find_field(contact->emails, address, type)) - return; - - email = g_new0(struct phonebook_field, 1); - email->text = g_strdup(address); - email->type = type; - - contact->emails = g_slist_append(contact->emails, email); -} - -static gboolean addr_matches(struct phonebook_addr *a, struct phonebook_addr *b) -{ - GSList *la, *lb; - - if (a->type != b->type) - return FALSE; - - for (la = a->fields, lb = b->fields; la && lb; - la = la->next, lb = lb->next) { - char *field_a = la->data; - char *field_b = lb->data; - - if (g_strcmp0(field_a, field_b) != 0) - return FALSE; - } - - return TRUE; -} - -/* generates phonebook_addr struct from tracker address data string. */ -static struct phonebook_addr *gen_addr(const char *address, int type) -{ - struct phonebook_addr *addr; - GSList *fields = NULL; - char **addr_parts; - int i; - - /* This test handles cases when address points to empty string - * (or address is NULL pointer) or string containing only six - * separators. It indicates that none of address fields is present - * and there is no sense to create dummy phonebook_addr struct */ - if (address == NULL || strlen(address) < ADDR_FIELD_AMOUNT) - return NULL; - - addr_parts = g_strsplit(address, ADDR_DELIM, ADDR_FIELD_AMOUNT); - - for (i = 0; i < ADDR_FIELD_AMOUNT; ++i) - fields = g_slist_append(fields, g_strdup(addr_parts[i])); - - g_strfreev(addr_parts); - - addr = g_new0(struct phonebook_addr, 1); - addr->fields = fields; - addr->type = type; - - return addr; -} - -static void add_address(struct phonebook_contact *contact, - const char *address, int type) -{ - struct phonebook_addr *addr; - GSList *l; - - addr = gen_addr(address, type); - if (addr == NULL) - return; - - /* Not adding address if there is already added with the same value. - * These type of checks have to be done because sometimes tracker - * returns results for contact data in more than 1 row - then the same - * address may be returned more than once in query results */ - for (l = contact->addresses; l; l = l->next) { - struct phonebook_addr *tmp = l->data; - - if (addr_matches(tmp, addr)) { - phonebook_addr_free(addr); - return; - } - } - - contact->addresses = g_slist_append(contact->addresses, addr); -} - -static void add_url(struct phonebook_contact *contact, const char *url_val, - int type) -{ - struct phonebook_field *url; - - if (url_val == NULL || strlen(url_val) == 0) - return; - - /* Not adding url if there is already added with the same value */ - if (find_field(contact->urls, url_val, type)) - return; - - url = g_new0(struct phonebook_field, 1); - - url->text = g_strdup(url_val); - url->type = type; - - contact->urls = g_slist_append(contact->urls, url); -} - -static GString *gen_vcards(GSList *contacts, - const struct apparam_field *params) -{ - GSList *l; - GString *vcards; - - vcards = g_string_new(NULL); - - /* Generating VCARD string from contacts and freeing used contacts */ - for (l = contacts; l; l = l->next) { - struct contact_data *c_data = l->data; - phonebook_add_contact(vcards, c_data->contact, - params->filter, params->format); - } - - return vcards; -} - -static int pull_contacts_size(const char **reply, int num_fields, - void *user_data) -{ - struct phonebook_data *data = user_data; - - if (num_fields < 0) { - data->cb(NULL, 0, num_fields, 0, TRUE, data->user_data); - return -EINTR; - } - - if (reply != NULL) { - data->index = atoi(reply[0]); - return 0; - } - - data->cb(NULL, 0, data->index, data->newmissedcalls, TRUE, - data->user_data); - - return 0; - /* - * phonebook_data is freed in phonebook_req_finalize. Useful in - * cases when call is terminated. - */ -} - -static void add_affiliation(char **field, const char *value) -{ - if (strlen(*field) > 0 || value == NULL || strlen(value) == 0) - return; - - g_free(*field); - - *field = g_strdup(value); -} - -static void contact_init(struct phonebook_contact *contact, - const char **reply) -{ - if (reply[COL_FAMILY_NAME][0] == '\0' && - reply[COL_GIVEN_NAME][0] == '\0' && - reply[COL_ADDITIONAL_NAME][0] == '\0' && - reply[COL_NAME_PREFIX][0] == '\0' && - reply[COL_NAME_SUFFIX][0] == '\0') { - if (reply[COL_FULL_NAME][0] != '\0') - contact->family = g_strdup(reply[COL_FULL_NAME]); - else - contact->family = g_strdup(reply[COL_NICKNAME]); - } else { - contact->family = g_strdup(reply[COL_FAMILY_NAME]); - contact->given = g_strdup(reply[COL_GIVEN_NAME]); - contact->additional = g_strdup(reply[COL_ADDITIONAL_NAME]); - contact->prefix = g_strdup(reply[COL_NAME_PREFIX]); - contact->suffix = g_strdup(reply[COL_NAME_SUFFIX]); - } - contact->fullname = g_strdup(reply[COL_FULL_NAME]); - contact->birthday = g_strdup(reply[COL_BIRTH_DATE]); - contact->nickname = g_strdup(reply[COL_NICKNAME]); - contact->photo = g_strdup(reply[COL_PHOTO]); - contact->company = g_strdup(reply[COL_ORG_NAME]); - contact->department = g_strdup(reply[COL_ORG_DEPARTMENT]); - contact->role = g_strdup(reply[COL_ORG_ROLE]); - contact->uid = g_strdup(reply[COL_UID]); - contact->title = g_strdup(reply[COL_TITLE]); - - set_call_type(contact, reply[COL_DATE], reply[COL_SENT], - reply[COL_ANSWERED]); -} - -static enum phonebook_number_type get_phone_type(const char *affilation) -{ - if (g_strcmp0(AFFILATION_HOME, affilation) == 0) - return TEL_TYPE_HOME; - else if (g_strcmp0(AFFILATION_WORK, affilation) == 0) - return TEL_TYPE_WORK; - - return TEL_TYPE_OTHER; -} - -static void add_aff_number(struct phonebook_contact *contact, - const char *pnumber, const char *aff_type) -{ - char **num_parts; - char *type, *number; - - /* For phone taken directly from contacts data, phone number string - * is represented as number type and number string - those strings are - * separated by SUB_DELIM string */ - num_parts = g_strsplit(pnumber, SUB_DELIM, 2); - - if (!num_parts) - return; - - if (num_parts[0]) - type = num_parts[0]; - else - goto failed; - - if (num_parts[1]) - number = num_parts[1]; - else - goto failed; - - if (g_strrstr(type, FAX_NUM_TYPE)) - add_phone_number(contact, number, TEL_TYPE_FAX); - else if (g_strrstr(type, MOBILE_NUM_TYPE)) - add_phone_number(contact, number, TEL_TYPE_MOBILE); - else - /* if this is no fax/mobile phone, then adding phone number - * type based on type of the affilation field */ - add_phone_number(contact, number, get_phone_type(aff_type)); - -failed: - g_strfreev(num_parts); -} - -static void contact_add_numbers(struct phonebook_contact *contact, - const char **reply) -{ - char **aff_numbers; - int i; - - /* Filling phone numbers from contact's affilation */ - aff_numbers = g_strsplit(reply[COL_PHONE_AFF], MAIN_DELIM, MAX_FIELDS); - - if (aff_numbers) - for (i = 0; aff_numbers[i]; ++i) - add_aff_number(contact, aff_numbers[i], - reply[COL_AFF_TYPE]); - - g_strfreev(aff_numbers); -} - -static enum phonebook_field_type get_field_type(const char *affilation) -{ - if (g_strcmp0(AFFILATION_HOME, affilation) == 0) - return FIELD_TYPE_HOME; - else if (g_strcmp0(AFFILATION_WORK, affilation) == 0) - return FIELD_TYPE_WORK; - - return FIELD_TYPE_OTHER; -} - -static void add_aff_field(struct phonebook_contact *contact, - const char *aff_email, add_field_t add_field_cb) -{ - char **email_parts; - char *type, *email; - - /* Emails from affilation data, are represented as real email - * string and affilation type - those strings are separated by - * SUB_DELIM string */ - email_parts = g_strsplit(aff_email, SUB_DELIM, 2); - - if (!email_parts) - return; - - if (email_parts[0]) - email = email_parts[0]; - else - goto failed; - - if (email_parts[1]) - type = email_parts[1]; - else - goto failed; - - add_field_cb(contact, email, get_field_type(type)); - -failed: - g_strfreev(email_parts); -} - -static void contact_add_emails(struct phonebook_contact *contact, - const char **reply) -{ - char **aff_emails; - int i; - - /* Emails from affilation */ - aff_emails = g_strsplit(reply[COL_EMAIL_AFF], MAIN_DELIM, MAX_FIELDS); - - if (aff_emails) - for (i = 0; aff_emails[i] != NULL; ++i) - add_aff_field(contact, aff_emails[i], add_email); - - g_strfreev(aff_emails); -} - -static void contact_add_addresses(struct phonebook_contact *contact, - const char **reply) -{ - char **aff_addr; - int i; - - /* Addresses from affilation */ - aff_addr = g_strsplit(reply[COL_ADDR_AFF], MAIN_DELIM, MAX_FIELDS); - - if (aff_addr) - for (i = 0; aff_addr[i] != NULL; ++i) - add_aff_field(contact, aff_addr[i], add_address); - - g_strfreev(aff_addr); -} - -static void contact_add_urls(struct phonebook_contact *contact, - const char **reply) -{ - char **aff_url; - int i; - - /* Addresses from affilation */ - aff_url = g_strsplit(reply[COL_URL], MAIN_DELIM, MAX_FIELDS); - - if (aff_url) - for (i = 0; aff_url[i] != NULL; ++i) - add_aff_field(contact, aff_url[i], add_url); - - g_strfreev(aff_url); -} - -static void contact_add_organization(struct phonebook_contact *contact, - const char **reply) -{ - /* Adding fields connected by nco:hasAffiliation - they may be in - * separate replies */ - add_affiliation(&contact->title, reply[COL_TITLE]); - add_affiliation(&contact->company, reply[COL_ORG_NAME]); - add_affiliation(&contact->department, reply[COL_ORG_DEPARTMENT]); - add_affiliation(&contact->role, reply[COL_ORG_ROLE]); -} - -static void free_data_contacts(struct phonebook_data *data) -{ - GSList *l; - - /* freeing contacts */ - for (l = data->contacts; l; l = l->next) { - struct contact_data *c_data = l->data; - - g_free(c_data->id); - phonebook_contact_free(c_data->contact); - g_free(c_data); - } - - g_slist_free(data->contacts); - data->contacts = NULL; -} - -static void send_pull_part(struct phonebook_data *data, - const struct apparam_field *params, gboolean lastpart) -{ - GString *vcards; - - DBG(""); - vcards = gen_vcards(data->contacts, params); - data->cb(vcards->str, vcards->len, g_slist_length(data->contacts), - data->newmissedcalls, lastpart, data->user_data); - - if (!lastpart) - free_data_contacts(data); - g_string_free(vcards, TRUE); -} - -static int pull_contacts(const char **reply, int num_fields, void *user_data) -{ - struct phonebook_data *data = user_data; - const struct apparam_field *params = data->params; - struct phonebook_contact *contact; - struct contact_data *contact_data; - int last_index, i; - gboolean cdata_present = FALSE, part_sent = FALSE; - static char *temp_id = NULL; - - if (num_fields < 0) { - data->cb(NULL, 0, num_fields, 0, TRUE, data->user_data); - goto fail; - } - - DBG("reply %p", reply); - data->tracker_index++; - - if (reply == NULL) - goto done; - - /* Trying to find contact in recently added contacts. It is needed for - * contacts that have more than one telephone number filled */ - contact = find_contact(data->contacts, reply[CONTACTS_ID_COL], - reply[COL_DATE]); - - /* If contact is already created then adding only new phone numbers */ - if (contact) { - cdata_present = TRUE; - goto add_numbers; - } - - /* We are doing a PullvCardEntry, no need for those checks */ - if (data->vcardentry) - goto add_entry; - - /* Last four fields are always present, ignoring them */ - for (i = 0; i < num_fields - 4; i++) { - if (reply[i][0] != '\0') - break; - } - - if (i == num_fields - 4 && !g_str_equal(reply[CONTACTS_ID_COL], - TRACKER_DEFAULT_CONTACT_ME)) - return 0; - - if (g_strcmp0(temp_id, reply[CONTACTS_ID_COL])) { - data->index++; - g_free(temp_id); - temp_id = g_strdup(reply[CONTACTS_ID_COL]); - - /* Incrementing counter for vcards in current part of data, - * but only if liststartoffset has been already reached */ - if (data->index > params->liststartoffset) - data->vcard_part_count++; - } - - if (data->vcard_part_count > VCARDS_PART_COUNT) { - DBG("Part of vcard data ready for sending..."); - data->vcard_part_count = 0; - /* Sending part of data to PBAP core - more data can be still - * fetched, so marking lastpart as FALSE */ - send_pull_part(data, params, FALSE); - - /* Later, after adding contact data, need to return -EINTR to - * stop fetching more data for this request. Data will be - * downloaded again from this point, when phonebook_pull_read - * will be called again with current request as a parameter*/ - part_sent = TRUE; - } - - last_index = params->liststartoffset + params->maxlistcount; - - if (data->index <= params->liststartoffset) - return 0; - - /* max number of results achieved - need send vcards data that was - * already collected and stop further data processing (these operations - * will be invoked in "done" section) */ - if (data->index > last_index && params->maxlistcount > 0) { - DBG("Maxlistcount achieved"); - goto done; - } - -add_entry: - contact = g_new0(struct phonebook_contact, 1); - contact_init(contact, reply); - -add_numbers: - contact_add_numbers(contact, reply); - contact_add_emails(contact, reply); - contact_add_addresses(contact, reply); - contact_add_urls(contact, reply); - contact_add_organization(contact, reply); - - DBG("contact %p", contact); - - /* Adding contacts data to wrapper struct - this data will be used to - * generate vcard list */ - if (!cdata_present) { - contact_data = g_new0(struct contact_data, 1); - contact_data->contact = contact; - contact_data->id = g_strdup(reply[CONTACTS_ID_COL]); - data->contacts = g_slist_append(data->contacts, contact_data); - } - - if (part_sent) - return -EINTR; - - return 0; - -done: - /* Processing is end, this is definitely last part of transmission - * (marking lastpart as TRUE) */ - send_pull_part(data, params, TRUE); - -fail: - g_free(temp_id); - temp_id = NULL; - - return -EINTR; - /* - * phonebook_data is freed in phonebook_req_finalize. Useful in - * cases when call is terminated. - */ -} - -static int add_to_cache(const char **reply, int num_fields, void *user_data) -{ - struct phonebook_data *data = user_data; - char *formatted; - int i; - - if (reply == NULL || num_fields < 0) - goto done; - - /* the first element is the URI, always not empty */ - for (i = 1; i < num_fields; i++) { - if (reply[i][0] != '\0') - break; - } - - if (i == num_fields && - !g_str_equal(reply[0], TRACKER_DEFAULT_CONTACT_ME)) - return 0; - - if (i == 7) - formatted = g_strdup(reply[7]); - else if (i == 6) - formatted = g_strdup(reply[6]); - else - formatted = g_strdup_printf("%s;%s;%s;%s;%s", - reply[1], reply[2], reply[3], reply[4], - reply[5]); - - /* The owner vCard must have the 0 handle */ - if (strcmp(reply[0], TRACKER_DEFAULT_CONTACT_ME) == 0) - data->entry_cb(reply[0], 0, formatted, "", - reply[6], data->user_data); - else - data->entry_cb(reply[0], PHONEBOOK_INVALID_HANDLE, formatted, - "", reply[6], data->user_data); - - g_free(formatted); - - return 0; - -done: - if (num_fields <= 0) - data->ready_cb(data->user_data); - - return -EINTR; - /* - * phonebook_data is freed in phonebook_req_finalize. Useful in - * cases when call is terminated. - */ -} - -int phonebook_init(void) -{ - g_thread_init(NULL); - g_type_init(); - - return 0; -} - -void phonebook_exit(void) -{ -} - -char *phonebook_set_folder(const char *current_folder, const char *new_folder, - uint8_t flags, int *err) -{ - char *tmp1, *tmp2, *base, *path = NULL; - gboolean root, child; - int ret = 0; - int len; - - root = (g_strcmp0("/", current_folder) == 0); - child = (new_folder && strlen(new_folder) != 0); - - switch (flags) { - case 0x02: - /* Go back to root */ - if (!child) { - path = g_strdup("/"); - goto done; - } - - path = g_build_filename(current_folder, new_folder, NULL); - break; - case 0x03: - /* Go up 1 level */ - if (root) { - /* Already root */ - path = g_strdup("/"); - goto done; - } - - /* - * Removing one level of the current folder. Current folder - * contains AT LEAST one level since it is not at root folder. - * Use glib utility functions to handle invalid chars in the - * folder path properly. - */ - tmp1 = g_path_get_basename(current_folder); - tmp2 = g_strrstr(current_folder, tmp1); - len = tmp2 - (current_folder + 1); - - g_free(tmp1); - - if (len == 0) - base = g_strdup("/"); - else - base = g_strndup(current_folder, len); - - /* Return: one level only */ - if (!child) { - path = base; - goto done; - } - - path = g_build_filename(base, new_folder, NULL); - g_free(base); - - break; - default: - ret = -EBADR; - break; - } - -done: - if (path && !folder_is_valid(path)) - ret = -ENOENT; - - if (ret < 0) { - g_free(path); - path = NULL; - } - - if (err) - *err = ret; - - return path; -} - -static int pull_newmissedcalls(const char **reply, int num_fields, - void *user_data) -{ - struct phonebook_data *data = user_data; - reply_list_foreach_t pull_cb; - int col_amount, err; - const char *query; - int nmissed; - - if (num_fields < 0) { - data->cb(NULL, 0, num_fields, 0, TRUE, data->user_data); - - return -EINTR; - } - - if (reply != NULL) { - nmissed = atoi(reply[0]); - data->newmissedcalls = - nmissed <= UINT8_MAX ? nmissed : UINT8_MAX; - DBG("newmissedcalls %d", data->newmissedcalls); - - return 0; - } - - if (data->params->maxlistcount == 0) { - query = name2count_query(PB_CALLS_MISSED); - col_amount = COUNT_QUERY_COL_AMOUNT; - pull_cb = pull_contacts_size; - } else { - query = name2query(PB_CALLS_MISSED); - col_amount = PULL_QUERY_COL_AMOUNT; - pull_cb = pull_contacts; - } - - err = query_tracker(query, col_amount, pull_cb, data); - if (err < 0) { - data->cb(NULL, 0, err, 0, TRUE, data->user_data); - - return -EINTR; - } - - return 0; -} - -void phonebook_req_finalize(void *request) -{ - struct phonebook_data *data = request; - - DBG(""); - - if (!data) - return; - - /* canceling asynchronous operation on tracker if any is active */ - if (data->query_canc) { - g_cancellable_cancel(data->query_canc); - g_object_unref(data->query_canc); - } - - free_data_contacts(data); - g_free(data->req_name); - g_free(data); -} - -void *phonebook_pull(const char *name, const struct apparam_field *params, - phonebook_cb cb, void *user_data, int *err) -{ - struct phonebook_data *data; - - DBG("name %s", name); - - data = g_new0(struct phonebook_data, 1); - data->params = params; - data->user_data = user_data; - data->cb = cb; - data->req_name = g_strdup(name); - - if (err) - *err = 0; - - return data; -} - -int phonebook_pull_read(void *request) -{ - struct phonebook_data *data = request; - reply_list_foreach_t pull_cb; - const char *query; - char *offset_query; - int col_amount; - int ret; - - if (!data) - return -ENOENT; - - data->newmissedcalls = 0; - - if (g_strcmp0(data->req_name, PB_CALLS_MISSED) == 0 && - data->tracker_index == 0) { - /* new missed calls amount should be counted only once - it - * will be done during generating first part of results of - * missed calls history */ - query = NEW_MISSED_CALLS_COUNT_QUERY; - col_amount = COUNT_QUERY_COL_AMOUNT; - pull_cb = pull_newmissedcalls; - } else if (data->params->maxlistcount == 0) { - query = name2count_query(data->req_name); - col_amount = COUNT_QUERY_COL_AMOUNT; - pull_cb = pull_contacts_size; - } else { - query = name2query(data->req_name); - col_amount = PULL_QUERY_COL_AMOUNT; - pull_cb = pull_contacts; - } - - if (query == NULL) - return -ENOENT; - - if (pull_cb == pull_contacts && data->tracker_index > 0) { - /* Adding offset to pull query to download next parts of data - * from tracker (phonebook_pull_read may be called many times - * from PBAP core to fetch data partially) */ - offset_query = g_strdup_printf(QUERY_OFFSET_FORMAT, query, - data->tracker_index); - ret = query_tracker(offset_query, col_amount, pull_cb, data); - - g_free(offset_query); - - return ret; - } - - return query_tracker(query, col_amount, pull_cb, data); -} - -void *phonebook_get_entry(const char *folder, const char *id, - const struct apparam_field *params, - phonebook_cb cb, void *user_data, int *err) -{ - struct phonebook_data *data; - char *query; - int ret; - - DBG("folder %s id %s", folder, id); - - data = g_new0(struct phonebook_data, 1); - data->user_data = user_data; - data->params = params; - data->cb = cb; - data->vcardentry = TRUE; - - if (g_str_has_prefix(id, CONTACT_ID_PREFIX) == TRUE || - g_strcmp0(id, TRACKER_DEFAULT_CONTACT_ME) == 0) - query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id, id, id, id, - id, id, id, id, id, id, id, id, id); - else if (g_str_has_prefix(id, CALL_ID_PREFIX) == TRUE) - query = g_strdup_printf(CONTACT_FROM_CALL_QUERY, id); - else - query = g_strdup_printf(CONTACTS_OTHER_QUERY_FROM_URI, - id, id, id); - - ret = query_tracker(query, PULL_QUERY_COL_AMOUNT, pull_contacts, data); - if (err) - *err = ret; - - g_free(query); - - return data; -} - -void *phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb, - phonebook_cache_ready_cb ready_cb, void *user_data, int *err) -{ - struct phonebook_data *data; - const char *query; - int ret; - - DBG("name %s", name); - - query = folder2query(name); - if (query == NULL) { - if (err) - *err = -ENOENT; - return NULL; - } - - data = g_new0(struct phonebook_data, 1); - data->entry_cb = entry_cb; - data->ready_cb = ready_cb; - data->user_data = user_data; - - ret = query_tracker(query, 8, add_to_cache, data); - if (err) - *err = ret; - - return data; -} diff --git a/obexd/plugins/phonebook.h b/obexd/plugins/phonebook.h old mode 100644 new mode 100755 index 364ee9b..70a9cb7 --- a/obexd/plugins/phonebook.h +++ b/obexd/plugins/phonebook.h @@ -66,10 +66,6 @@ struct apparam_field { uint8_t order; uint8_t searchattrib; char *searchval; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gboolean required_missedcall_call_header; - uint16_t new_missed_calls; -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ }; /* @@ -89,29 +85,16 @@ typedef void (*phonebook_entry_cb) (const char *id, uint32_t handle, const char *name, const char *sound, const char *tel, void *user_data); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef void (*phonebook_cache_clear_cb) (void *user_data); -#endif - /* * After notify all entries to PBAP core, the backend * needs to notify that the operation has finished. */ -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY typedef void (*phonebook_cache_ready_cb) (void *user_data); -#else -typedef void (*phonebook_cache_ready_cb) (void *user_data, unsigned int new_missed_calls); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ int phonebook_init(void); void phonebook_exit(void); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int phonebook_connect(void **user_data); -void phonebook_disconnect(void *user_data); -#endif - /* * Changes the current folder in the phonebook back-end. The PBAP core * doesn't validate or restrict the possible values for the folders, @@ -181,9 +164,3 @@ void *phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb, * phonebook_get_entry, and phonebook_create_cache. */ void phonebook_req_finalize(void *request); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void phonebook_set_cache_notification(void *session, - phonebook_cache_clear_cb cache_cb, - void *user_data); -#endif diff --git a/obexd/plugins/syncevolution.c b/obexd/plugins/syncevolution.c deleted file mode 100644 index 854505a..0000000 --- a/obexd/plugins/syncevolution.c +++ /dev/null @@ -1,483 +0,0 @@ -/* - * - * OBEX Server - * - * Copyright (C) 2007-2010 Intel Corporation - * Copyright (C) 2007-2010 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include -#include - -#include "lib/bluetooth.h" - -#include "gdbus/gdbus.h" - -#include "btio/btio.h" -#include "obexd/src/plugin.h" -#include "obexd/src/obex.h" -#include "obexd/src/service.h" -#include "obexd/src/mimetype.h" -#include "obexd/src/log.h" -#include "obexd/src/manager.h" -#include "obexd/src/obexd.h" -#include "filesystem.h" - -#define SYNCML_TARGET_SIZE 11 - -static const uint8_t SYNCML_TARGET[SYNCML_TARGET_SIZE] = { - 0x53, 0x59, 0x4E, 0x43, 0x4D, 0x4C, 0x2D, 0x53, - 0x59, 0x4E, 0x43 }; - -#define SYNCEVOLUTION_CHANNEL 19 - -#define SYNCEVOLUTION_RECORD "\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -" - -#define SYNCE_BUS_NAME "org.syncevolution" -#define SYNCE_PATH "/org/syncevolution/Server" -#define SYNCE_SERVER_INTERFACE "org.syncevolution.Server" -#define SYNCE_CONN_INTERFACE "org.syncevolution.Connection" - -struct synce_context { - struct obex_session *os; - DBusConnection *dbus_conn; - char *conn_obj; - unsigned int reply_watch; - unsigned int abort_watch; - GString *buffer; - int lasterr; - char *id; -}; - -static void append_dict_entry(DBusMessageIter *dict, const char *key, - int type, void *val) -{ - DBusMessageIter entry; - - dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, - NULL, &entry); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &val); - dbus_message_iter_close_container(dict, &entry); -} - -static gboolean reply_signal(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct synce_context *context = data; - const char *path = dbus_message_get_path(msg); - DBusMessageIter iter, array_iter; - char *value; - int length; - - if (strcmp(context->conn_obj, path) != 0) { - obex_object_set_io_flags(context, G_IO_ERR, -EPERM); - context->lasterr = -EPERM; - return FALSE; - } - - dbus_message_iter_init(msg, &iter); - - dbus_message_iter_recurse(&iter, &array_iter); - dbus_message_iter_get_fixed_array(&array_iter, &value, &length); - - context->buffer = g_string_new_len(value, length); - obex_object_set_io_flags(context, G_IO_IN, 0); - context->lasterr = 0; - - return TRUE; -} - -static gboolean abort_signal(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct synce_context *context = data; - - obex_object_set_io_flags(context, G_IO_ERR, -EPERM); - context->lasterr = -EPERM; - - return TRUE; -} - -static void connect_cb(DBusPendingCall *call, void *user_data) -{ - struct synce_context *context = user_data; - DBusConnection *conn; - DBusMessage *reply; - DBusError err; - char *path; - - conn = context->dbus_conn; - - reply = dbus_pending_call_steal_reply(call); - - dbus_error_init(&err); - if (dbus_message_get_args(reply, &err, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID) == FALSE) { - error("%s", err.message); - dbus_error_free(&err); - goto failed; - } - - DBG("Got conn object %s from syncevolution", path); - context->conn_obj = g_strdup(path); - - context->reply_watch = g_dbus_add_signal_watch(conn, NULL, path, - SYNCE_CONN_INTERFACE, "Reply", - reply_signal, context, NULL); - - context->abort_watch = g_dbus_add_signal_watch(conn, NULL, path, - SYNCE_CONN_INTERFACE, "Abort", - abort_signal, context, NULL); - - dbus_message_unref(reply); - - return; - -failed: - obex_object_set_io_flags(context, G_IO_ERR, -EPERM); - context->lasterr = -EPERM; -} - -static void process_cb(DBusPendingCall *call, void *user_data) -{ - struct synce_context *context = user_data; - DBusMessage *reply; - DBusError derr; - - reply = dbus_pending_call_steal_reply(call); - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("process_cb(): syncevolution replied with an error:" - " %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - - obex_object_set_io_flags(context, G_IO_ERR, -EPERM); - context->lasterr = -EPERM; - goto done; - } - - obex_object_set_io_flags(context, G_IO_OUT, 0); - context->lasterr = 0; - -done: - dbus_message_unref(reply); -} - -static void *synce_connect(struct obex_session *os, int *err) -{ - DBusConnection *conn; - struct synce_context *context; - char *address; - - manager_register_session(os); - - conn = manager_dbus_get_connection(); - if (!conn) - goto failed; - - context = g_new0(struct synce_context, 1); - context->dbus_conn = conn; - context->lasterr = -EAGAIN; - context->os = os; - - if (obex_getpeername(os, &address) == 0) { - context->id = g_strdup_printf("%s+%d", address, - SYNCEVOLUTION_CHANNEL); - g_free(address); - } - - if (err) - *err = 0; - - return context; - -failed: - if (err) - *err = -EPERM; - - return NULL; -} - -static int synce_put(struct obex_session *os, void *user_data) -{ - return 0; -} - -static int synce_get(struct obex_session *os, void *user_data) -{ - return obex_get_stream_start(os, NULL); -} - -static void close_cb(DBusPendingCall *call, void *user_data) -{ - DBusMessage *reply; - DBusError derr; - - reply = dbus_pending_call_steal_reply(call); - dbus_error_init(&derr); - if (dbus_set_error_from_message(&derr, reply)) { - error("close_cb(): syncevolution replied with an error:" - " %s, %s", derr.name, derr.message); - dbus_error_free(&derr); - } - - dbus_message_unref(reply); -} - -static void synce_disconnect(struct obex_session *os, void *user_data) -{ - struct synce_context *context = user_data; - - g_free(context); -} - -static void *synce_open(const char *name, int oflag, mode_t mode, - void *user_data, size_t *size, int *err) -{ - struct synce_context *context = user_data; - - if (err) - *err = context ? 0 : -EFAULT; - - return user_data; -} - -static int synce_close(void *object) -{ - struct synce_context *context = object; - DBusMessage *msg; - const char *error; - gboolean normal; - DBusPendingCall *call; - - if (!context->conn_obj) - goto done; - - msg = dbus_message_new_method_call(SYNCE_BUS_NAME, context->conn_obj, - SYNCE_CONN_INTERFACE, "Close"); - if (!msg) - goto failed; - - normal = TRUE; - error = "none"; - dbus_message_append_args(msg, DBUS_TYPE_BOOLEAN, &normal, - DBUS_TYPE_STRING, &error, DBUS_TYPE_INVALID); - - g_dbus_send_message_with_reply(context->dbus_conn, msg, &call, -1); - dbus_pending_call_set_notify(call, close_cb, NULL, NULL); - dbus_message_unref(msg); - dbus_pending_call_unref(call); - -failed: - g_dbus_remove_watch(context->dbus_conn, context->reply_watch); - context->reply_watch = 0; - g_dbus_remove_watch(context->dbus_conn, context->abort_watch); - context->abort_watch = 0; - - g_free(context->conn_obj); - context->conn_obj = NULL; - -done: - dbus_connection_unref(context->dbus_conn); - g_free(context); - return 0; -} - -static ssize_t synce_read(void *object, void *buf, size_t count) -{ - struct synce_context *context = object; - DBusConnection *conn; - char transport[36], transport_description[24]; - const char *session; - DBusMessage *msg; - DBusMessageIter iter, dict; - gboolean authenticate; - DBusPendingCall *call; - - if (context->buffer) - return string_read(context->buffer, buf, count); - - conn = manager_dbus_get_connection(); - if (conn == NULL) - return -EPERM; - - msg = dbus_message_new_method_call(SYNCE_BUS_NAME, SYNCE_PATH, - SYNCE_SERVER_INTERFACE, "Connect"); - if (!msg) - return -EPERM; - - dbus_message_iter_init_append(msg, &iter); - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - append_dict_entry(&dict, "id", DBUS_TYPE_STRING, context->id); - - snprintf(transport, sizeof(transport), "%s.obexd", OBEXD_SERVICE); - append_dict_entry(&dict, "transport", DBUS_TYPE_STRING, transport); - - snprintf(transport_description, sizeof(transport_description), - "version %s", VERSION); - append_dict_entry(&dict, "transport_description", DBUS_TYPE_STRING, - transport_description); - - dbus_message_iter_close_container(&iter, &dict); - - authenticate = FALSE; - session = ""; - dbus_message_append_args(msg, DBUS_TYPE_BOOLEAN, &authenticate, - DBUS_TYPE_STRING, &session, DBUS_TYPE_INVALID); - - if (!g_dbus_send_message_with_reply(conn, msg, &call, -1)) { - error("D-Bus call to %s failed.", SYNCE_SERVER_INTERFACE); - dbus_message_unref(msg); - return -EPERM; - } - - dbus_pending_call_set_notify(call, connect_cb, context, NULL); - - dbus_pending_call_unref(call); - dbus_message_unref(msg); - - return -EAGAIN; -} - -static ssize_t synce_write(void *object, const void *buf, size_t count) -{ - struct synce_context *context = object; - DBusMessage *msg; - DBusMessageIter iter, array_iter; - DBusPendingCall *call; - const char *type = obex_get_type(context->os); - - if (context->lasterr == 0) - return count; - - if (!context->conn_obj) - return -EFAULT; - - msg = dbus_message_new_method_call(SYNCE_BUS_NAME, context->conn_obj, - SYNCE_CONN_INTERFACE, "Process"); - if (!msg) - return -EFAULT; - - dbus_message_iter_init_append(msg, &iter); - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_TYPE_BYTE_AS_STRING, &array_iter); - - dbus_message_iter_append_fixed_array(&array_iter, DBUS_TYPE_BYTE, - &buf, count); - dbus_message_iter_close_container(&iter, &array_iter); - - dbus_message_append_args(msg, DBUS_TYPE_STRING, &type, - DBUS_TYPE_INVALID); - - if (!g_dbus_send_message_with_reply(context->dbus_conn, msg, - &call, -1)) { - error("D-Bus call to %s failed.", SYNCE_CONN_INTERFACE); - dbus_message_unref(msg); - return -EPERM; - } - - dbus_pending_call_set_notify(call, process_cb, context, NULL); - - dbus_message_unref(msg); - dbus_pending_call_unref(call); - - return -EAGAIN; -} - -static struct obex_mime_type_driver synce_driver = { - .target = SYNCML_TARGET, - .target_size = SYNCML_TARGET_SIZE, - .open = synce_open, - .close = synce_close, - .read = synce_read, - .write = synce_write, -}; - -static struct obex_service_driver synce = { - .name = "OBEX server for SyncML, using SyncEvolution", - .service = OBEX_SYNCEVOLUTION, - .channel = SYNCEVOLUTION_CHANNEL, - .secure = TRUE, - .record = SYNCEVOLUTION_RECORD, - .target = SYNCML_TARGET, - .target_size = SYNCML_TARGET_SIZE, - .get = synce_get, - .put = synce_put, - .connect = synce_connect, - .disconnect = synce_disconnect, -}; - -static int synce_init(void) -{ - int err; - - err = obex_mime_type_driver_register(&synce_driver); - if (err < 0) - return err; - - return obex_service_driver_register(&synce); -} - -static void synce_exit(void) -{ - obex_service_driver_unregister(&synce); - obex_mime_type_driver_unregister(&synce_driver); -} - -OBEX_PLUGIN_DEFINE(syncevolution, synce_init, synce_exit) diff --git a/obexd/plugins/vcard.c b/obexd/plugins/vcard.c old mode 100644 new mode 100755 diff --git a/obexd/plugins/vcard.h b/obexd/plugins/vcard.h old mode 100644 new mode 100755 diff --git a/obexd/src/main.c b/obexd/src/main.c index e2df4ef..c774cda 100755 --- a/obexd/src/main.c +++ b/obexd/src/main.c @@ -179,14 +179,6 @@ static GOptionEntry options[] = { { NULL }, }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void obex_option_set_root_folder(const char *root) -{ - g_free(option_root); - option_root = g_strdup(root); -} -#endif - gboolean obex_option_auto_accept(void) { return option_autoaccept; diff --git a/obexd/src/manager.c b/obexd/src/manager.c index 90c5114..f84384a 100755 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -190,52 +190,6 @@ static DBusMessage *unregister_agent(DBusConnection *conn, return dbus_message_new_method_return(msg); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *set_root(DBusConnection *conn, DBusMessage *msg, - const char *root, void *data) -{ - DBG("new_root: %s", root); - - /* Change the option root path (using in filesystem) */ - obex_option_set_root_folder(root); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *set_property(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - DBusMessageIter iter; - DBusMessageIter sub; - const char *property; - - if (!dbus_message_iter_init(msg, &iter)) - return invalid_args(msg); - - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) - return invalid_args(msg); - - dbus_message_iter_get_basic(&iter, &property); - dbus_message_iter_next(&iter); - - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT) - return invalid_args(msg); - dbus_message_iter_recurse(&iter, &sub); - - if (g_str_equal("Root", property)) { - const char *root; - - if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRING) - return invalid_args(msg); - dbus_message_iter_get_basic(&sub, &root); - - return set_root(conn, msg, root, data); - } - - return invalid_args(msg); -} -#endif - static gboolean get_source(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -486,79 +440,6 @@ static gboolean transfer_get_filename(const GDBusPropertyTable *property, return TRUE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean transfer_operation_exists(const GDBusPropertyTable *property, - void *data) -{ - struct obex_transfer *transfer = data; - struct obex_session *session = transfer->session; - - if (session->cmd == G_OBEX_OP_PUT && - session->size != OBJECT_SIZE_DELETE) - return TRUE; - else if (session->cmd == G_OBEX_OP_GET) - return TRUE; - else - return FALSE; -} - -static gboolean transfer_get_operation(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct obex_transfer *transfer = data; - struct obex_session *session = transfer->session; - const char *operation; - - if (session->cmd == G_OBEX_OP_PUT && - session->size != OBJECT_SIZE_DELETE) - operation = "PUT"; - else if (session->cmd == G_OBEX_OP_GET) - operation = "GET"; - else - return FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &operation); - - return TRUE; -} - -static gboolean transfer_address_exists(const GDBusPropertyTable *property, - void *data) -{ - struct obex_transfer *transfer = data; - struct obex_session *session = transfer->session; - char *address; - int err; - - err = obex_getpeername(session, &address); - if (err < 0) - return FALSE; - - g_free(address); - - return TRUE; -} - -static gboolean transfer_get_address(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct obex_transfer *transfer = data; - struct obex_session *session = transfer->session; - char *address; - int err; - - err = obex_getpeername(session, &address); - if (err < 0) - return FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &address); - g_free(address); - - return TRUE; -} - -#endif - static gboolean transfer_get_transferred(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -576,10 +457,6 @@ static const GDBusMethodTable manager_methods[] = { GDBUS_ARGS({ "agent", "o" }), NULL, register_agent) }, { GDBUS_METHOD("UnregisterAgent", GDBUS_ARGS({ "agent", "o" }), NULL, unregister_agent) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_METHOD("SetProperty", - GDBUS_ARGS({ "property", "sv" }), NULL, set_property) }, -#endif { } }; @@ -597,12 +474,6 @@ static const GDBusPropertyTable transfer_properties[] = { { "Time", "t", transfer_get_time, NULL, transfer_time_exists }, { "Filename", "s", transfer_get_filename, NULL, transfer_filename_exists }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "Operation", "s", transfer_get_operation, NULL, - transfer_operation_exists }, - { "Address", "s", transfer_get_address, NULL, - transfer_address_exists }, -#endif { "Transferred", "t", transfer_get_transferred }, { } }; diff --git a/obexd/src/obex.c b/obexd/src/obex.c old mode 100644 new mode 100755 index fee2461..788bffc --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -642,17 +642,7 @@ static void parse_name(struct obex_session *os, GObexPacket *req) if (!g_obex_header_get_unicode(hdr, &name)) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("Obex Session For: %s", os->service->name); - if (name && g_strcmp0(os->service->name, "Object Push server") == 0) { - char *new_name; - new_name = strrchr(name, '/'); - if (new_name) { - name = new_name + 1; - DBG("FileName %s", name); - } - } -#endif + os->name = g_strdup(name); DBG("NAME: %s", os->name); } @@ -783,11 +773,7 @@ int obex_put_stream_start(struct obex_session *os, const char *filename) int err; os->object = os->driver->open(filename, O_WRONLY | O_CREAT | O_TRUNC, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - 0644, os->service_data, -#else 0600, os->service_data, -#endif os->size != OBJECT_SIZE_UNKNOWN ? (size_t *) &os->size : NULL, &err); if (os->object == NULL) { diff --git a/obexd/src/obexd.h b/obexd/src/obexd.h index ddf5ba0..42c3c4d 100755 --- a/obexd/src/obexd.h +++ b/obexd/src/obexd.h @@ -41,6 +41,3 @@ gboolean obex_option_auto_accept(void); const char *obex_option_root_folder(void); gboolean obex_option_symlinks(void); const char *obex_option_capability(void); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void obex_option_set_root_folder(const char *root); -#endif diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service index 3abb555..a538088 100755 --- a/obexd/src/org.bluez.obex.service +++ b/obexd/src/org.bluez.obex.service @@ -1,3 +1,4 @@ [D-BUS Service] Name=org.bluez.obex -Exec=/bin/sh -c 'exec /usr/libexec/bluetooth/obexd -d --noplugin=ftp,syncevolution,pcsuite,irmc --symlinks -r /opt/usr/home/owner/media/' +Exec=/bin/false +SystemdService=dbus-org.bluez.obex.service diff --git a/packaging/500.bluez_upgrade.sh b/packaging/500.bluez_upgrade.sh deleted file mode 100644 index d500621..0000000 --- a/packaging/500.bluez_upgrade.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -#------------------------------------------# -# bluetoothd patch for upgrade (2.4 -> 3.0) # -#------------------------------------------# - -# Change the smack label for BT chip and paired info -chsmack -a "User" /var/lib/bluetooth -chsmack -a "System" /var/lib/bluetooth/* -r diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf deleted file mode 100644 index ec97a81..0000000 --- a/packaging/baselibs.conf +++ /dev/null @@ -1,4 +0,0 @@ -libbluetooth -bluez-devel - requires -bluez- - requires "libbluetooth- = " diff --git a/packaging/bluetooth.modprobe b/packaging/bluetooth.modprobe deleted file mode 100644 index 3072d78..0000000 --- a/packaging/bluetooth.modprobe +++ /dev/null @@ -1,3 +0,0 @@ -# use "reset=1" as default, since it should be safe for recent devices and -# solves all kind of problems. -options btusb reset=1 diff --git a/packaging/bluetooth.sh b/packaging/bluetooth.sh deleted file mode 100644 index 8cec636..0000000 --- a/packaging/bluetooth.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -BLUETOOTH_CONFIG=/etc/sysconfig/bluetooth -test -r $BLUETOOTH_CONFIG && . $BLUETOOTH_CONFIG - -if [ "$START_BLUETOOTHD" = "no" ]; then - exit 0 -fi - -exec /usr/sbin/bluetoothd --udev diff --git a/packaging/bluetooth.sysconfig b/packaging/bluetooth.sysconfig deleted file mode 100644 index d2bfec6..0000000 --- a/packaging/bluetooth.sysconfig +++ /dev/null @@ -1,7 +0,0 @@ -############ general -## Path: Hardware/Bluetooth -## Description: General settings for the Bluetooth device, if set to 'yes' bluetooth is started when udev reports 'added bluetooth device' -## Type: yesno -## Default: yes - -START_BLUETOOTHD=yes diff --git a/packaging/bluez-coldplug.init b/packaging/bluez-coldplug.init deleted file mode 100644 index bf370b8..0000000 --- a/packaging/bluez-coldplug.init +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/sh -# -# /etc/init.d/bluez-coldplug -# -# Copyright (c) 2009, SUSE Linux Products GmbH Nuernberg, Germany. All rights reserved. -# -# -### BEGIN INIT INFO -# Provides: bluez-coldplug -# Required-Start: dbus $remote_fs -# Should-Start: $network $syslog -# Required-Stop: $null -# Should-Stop: $null -# Default-Start: 2 3 5 -# Default-Stop: -# Short-Description: -# Description: handles udev coldplug of bluetooth dongles -### END INIT INFO - -. /etc/rc.status - -case "$1" in - start|restart|try-restart) - udevadm trigger --subsystem-match=bluetooth --action=add - rc_status -v - ;; - stop) - rc_status -v - ;; - force-reload|reload) - rc_status -v - ;; - status) - rc_status -v - ;; - *) - echo "Usage: $0" \ - "{start|stop|status|try-restart|restart|force-reload|reload}" - exit 1 - ;; -esac -rc_exit diff --git a/packaging/bluez-ncurses.patch b/packaging/bluez-ncurses.patch deleted file mode 100644 index 186fd42..0000000 --- a/packaging/bluez-ncurses.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/Makefile.tools b/Makefile.tools -index 42cccc6..37e10d6 100644 ---- a/Makefile.tools -+++ b/Makefile.tools -@@ -7,7 +7,7 @@ client_bluetoothctl_SOURCES = client/main.c \ - client/agent.h client/agent.c \ - monitor/uuid.h monitor/uuid.c - client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ -- -lreadline -+ -lreadline -lncurses - endif - - if MONITOR -@@ -288,12 +288,12 @@ attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ - attrib/utils.c src/log.c client/display.c \ - client/display.h - attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ -- src/libshared-glib.la @GLIB_LIBS@ -lreadline -+ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses - - tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \ - tools/obex-client-tool.c - tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ -- @GLIB_LIBS@ -lreadline -+ @GLIB_LIBS@ -lreadline -lncurses - - tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ - tools/obex-server-tool.c -@@ -302,12 +302,12 @@ tools_obex_server_tool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ - tools_bluetooth_player_SOURCES = tools/bluetooth-player.c \ - client/display.h client/display.c - tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ -- @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -+ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses - - tools_obexctl_SOURCES = tools/obexctl.c \ - client/display.h client/display.c - tools_obexctl_LDADD = gdbus/libgdbus-internal.la \ -- @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -+ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses - endif - - if EXPERIMENTAL diff --git a/packaging/bluez.changes b/packaging/bluez.changes deleted file mode 100644 index 0f7fdf1..0000000 --- a/packaging/bluez.changes +++ /dev/null @@ -1,9 +0,0 @@ -* Mon Mar 18 2013 Anas Nashif upstream/4.101@89d301e -- Fixed package groups - -* Wed Mar 06 2013 William Douglas submit/trunk/20130306.190137@68749bf -- Correct the dbus service file's systemd unit name for bluez. -- Fixed requirement on python-gobject -- add packaging -- Imported Upstream version 4.101 - diff --git a/packaging/bluez.manifest b/packaging/bluez.manifest deleted file mode 100644 index 6c50789..0000000 --- a/packaging/bluez.manifest +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/packaging/bluez.spec b/packaging/bluez.spec deleted file mode 100644 index fdc16b5..0000000 --- a/packaging/bluez.spec +++ /dev/null @@ -1,427 +0,0 @@ -# Do not create provides fro extension-tm1 because the main package -# should anchor any reverse-dependencies -%global __provides_exclude_from ^(.*\\.tm1)$ - -#%define with_libcapng --enable-capng -%define _libpath /usr/lib -%define upgrade_script_path /usr/share/upgrade/scripts -Name: bluez -Summary: Bluetooth Stack for Linux -Version: 5.37 -Release: 2 -Group: Network & Connectivity/Bluetooth -License: GPL-2.0+ and LGPL-2.1+ and Apache-2.0 -URL: http://www.bluez.org/ -Source: bluez-%{version}.tar.gz -Source2: bluez-coldplug.init -Source3: bluetooth.sysconfig -Source4: bluetooth.sh -Source5: baselibs.conf -Source7: bluetooth.modprobe -Source101: obex-root-setup -Source102: create-symlinks -Source103: obex.sh -Source1001: bluez.manifest -#Patch1 : bluez-ncurses.patch -#Patch2 : disable-eir-unittest.patch -#Requires: dbus >= 0.60 -#BuildRequires: pkgconfig(libudev) -BuildRequires: pkgconfig(dbus-1) -BuildRequires: pkgconfig(iniparser) -BuildRequires: pkgconfig(libxml-2.0) -#BuildRequires: pkgconfig(glib-2.0) -#BuildRequires: pkgconfig(ncurses) -#BuildRequires: flex -#BuildRequires: bison -#BuildRequires: readline-devel -#BuildRequires: openssl-devel -BuildRequires: flex -BuildRequires: libcap-ng-devel -BuildRequires: systemd -%{?systemd_requires} -BuildRequires: pkgconfig(alsa) -BuildRequires: automake -BuildRequires: check-devel -BuildRequires: glib2-devel >= 2.16 -BuildRequires: libsndfile-devel -BuildRequires: libtool -BuildRequires: libudev-devel -BuildRequires: libusb-devel -BuildRequires: pkg-config -BuildRequires: readline-devel -BuildRequires: udev -BuildRequires: pkgconfig(libtzplatform-config) -Requires: %{name}-compat = %{version}-%{release} -Recommends: %{name}-profile_common = %{version}-%{release} - -%description -The Bluetooth stack for Linux. - -%package devel -Summary: Files needed for BlueZ development -License: GPL-2.0+ -Group: Development/Libraries -Requires: libbluetooth = %{version} - -%description devel -Files needed to develop applications for the BlueZ Bluetooth protocol -stack. - -%package -n libbluetooth -Summary: Bluetooth Libraries -License: GPL-2.0+ -Group: Network & Connectivity/Bluetooth - -%description -n libbluetooth -Bluetooth protocol stack libraries. - -%package -n obexd -Summary: OBEX Server A basic OBEX server implementation -Group: Network & Connectivity/Bluetooth -Requires: tizen-platform-config-tools - -%description -n obexd -OBEX Server A basic OBEX server implementation. - -%package test -Summary: Tools for testing of various Bluetooth-functions -License: GPL-2.0+ -Group: Development/Tools -Requires: dbus-python -Requires: libbluetooth = %{version} -Requires: python-gobject - -%description test -Contains a few tools for testing various bluetooth functions. The -BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. - -%package profile_common -Summary: Modified bluez for mobile/common profile -Provides: %{name}-compat = %{version}-%{release} -Provides: %{name}-profile_mobile = %{version}-%{release} -Provides: %{name}-profile_ivi = %{version}-%{release} -Conflicts: %{name}-profile_wearable -Conflicts: %{name}-profile_tv -%description profile_common -Bluez default service script for Tizen (mobile/common profile) - -%package profile_wearable -Summary: Modified bluez for wearable profile -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_common -Conflicts: %{name}-profile_tv -%description profile_wearable -Bluez modified service script for Tizen wearable - -%package profile_tv -Summary: Modified bluez for wearable profile -Provides: %{name}-compat = %{version}-%{release} -Conflicts: %{name}-profile_common -Conflicts: %{name}-profile_wearable -%description profile_tv -Bluez modified service script for Tizen TV - -%ifarch %{ix86} || %{arm} -%package -n libbluetooth-extension-TM1 -Summary: Extension for mobile TM1 -Requires: libbluetooth = %{version}-%{release} -%description -n libbluetooth-extension-TM1 -Bluez default service script for Tizen mobile TM1 -When you want to uninstall this while keeping libbluetooth, you need -to reinstall libbluetooth after uninstalling this because this package -overwrites some contents of libbluetooth. -%endif - -%prep -%setup -q -cp %{SOURCE1001} . - -%build -autoreconf -fiv - -#if "{?profile}" == "ivi" -# TIZEN_FEATURE_BLUEZ_BRCM_CHIP: only in tools/hciattach.c ==> RUNTIME! (profile.h) -#endif - -#if "{?profile}" == "wearable" -# TIZEN_FEATURE_BLUEZ_SMS_ONLY: only in obexd/plugins/messages-tizen.c ==> RUNTIME! (profile.h) -# TIZEN_FEATURE_BLUEZ_BRCM_QOS: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h) -# TIZEN_FEATURE_BLUEZ_ROLE_CHANGE: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h) -# TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY: only in src/device.c ==> RUNTIME! (profile.h) -#endif - -export LDFLAGS=" -lncurses -Wl,--as-needed " -export CFLAGS+=" -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET" -export CFLAGS_DEFAULT="$CFLAGS" - -%ifarch %{ix86} || %{arm} -# extension-TM1 -export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BLUEZ_SPRD_QOS -DTIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN" -# TIZEN_FEATURE_BLUEZ_SPRD_QOS: only in profiles/audio/avdtp.c -# TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN: src/adapter.c - -%reconfigure --disable-static \ - --sysconfdir=%{_sysconfdir} \ - --localstatedir=%{_localstatedir} \ - --with-systemdsystemunitdir=%{_libpath}/systemd/system \ - --with-systemduserunitdir=%{_libpath}/systemd/user \ - --libexecdir=%{_libexecdir} \ - --enable-debug \ - --enable-pie \ - --enable-serial \ - --enable-input \ - --enable-usb=no \ - --enable-tools \ - --disable-bccmd \ - --enable-pcmcia=no \ - --enable-hid2hci=no \ - --enable-alsa=no \ - --enable-gstreamer=no \ - --disable-dfutool \ - --disable-cups \ - --enable-health=yes \ - --enable-proximity=yes \ - --enable-dbusoob \ - --enable-test \ - --with-telephony=tizen \ - --enable-obex \ - --enable-library \ - --enable-gatt \ - --enable-experimental \ - --enable-autopair=no \ - --enable-hid=yes \ - --enable-tizenunusedplugin=no - - -make %{?_smp_mflags} all V=1 - -mkdir -p tm1 - -%make_install -cp -a %{buildroot}%{_libdir}/libbluetooth.so* tm1/ -%endif - -# non-extension-TM1 -export CFLAGS="$CFLAGS_DEFAULT" - -%reconfigure --disable-static \ - --sysconfdir=%{_sysconfdir} \ - --localstatedir=%{_localstatedir} \ - --with-systemdsystemunitdir=%{_libpath}/systemd/system \ - --with-systemduserunitdir=%{_libpath}/systemd/user \ - --libexecdir=%{_libexecdir} \ - --enable-debug \ - --enable-pie \ - --enable-serial \ - --enable-input \ - --enable-usb=no \ - --enable-tools \ - --disable-bccmd \ - --enable-pcmcia=no \ - --enable-hid2hci=no \ - --enable-alsa=no \ - --enable-gstreamer=no \ - --disable-dfutool \ - --disable-cups \ - --enable-health=yes \ - --enable-proximity=yes \ - --enable-dbusoob \ - --enable-test \ - --with-telephony=tizen \ - --enable-obex \ - --enable-library \ - --enable-gatt \ - --enable-experimental \ - --enable-autopair=no \ -%if "%{?profile}" == "wearable" - --enable-wearable \ -%endif - --enable-hid=yes \ - --enable-tizenunusedplugin=no -# The if/endif for wearable above if only for PRODUCT optimization - -# enable-wearable disables "TIZEN_HID_PLUGIN / TIZEN_UNUSED_PLUGIN" (input / hog) -# TIZEN_UNUSED_PLUGIN is "no" regardless of enable-wearable. -# TIZEN_HID_PLUGIN only matters. -# enable-network is not used in configure. - - -make %{?_smp_mflags} all V=1 - -%check -make check - -%install -%make_install -%ifarch %{ix86} || %{arm} -pushd tm1 -for FILE in libbluetooth.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tm1"; done -popd -%endif - -# bluez-test -rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-* -#install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh -install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluetooth.conf - -# no idea why this is suddenly necessary... -install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth - -install -D -m 0644 src/main_w.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.wearable -install -D -m 0644 src/main_m.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf - -#install -D -m 0644 src/bluetooth.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth.conf -#install -D -m 0644 profiles/audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/audio.conf -#install -D -m 0644 profiles/network/network.conf %{buildroot}%{_sysconfdir}/bluetooth/network.conf - -#install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/bluez -#install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth3 -#install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth-devel - -#install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup -#install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks -#install -D -m 0755 %SOURCE103 %{buildroot}%{_bindir}/obex.sh -install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT/%{_bindir}/ -install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT/%{_bindir}/ -#install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT/%{_bindir}/ -install -D -m 0755 tools/btmgmt $RPM_BUILD_ROOT/%{_bindir}/ -install -D -m 0755 tools/scotest $RPM_BUILD_ROOT/%{_bindir}/ -install -D -m 0755 tools/bluemoon $RPM_BUILD_ROOT/%{_bindir}/ -install -D -m 0755 attrib/gatttool $RPM_BUILD_ROOT/%{_bindir}/ - - -install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl - -#test -#if "tv" -mkdir -p %{buildroot}%{_libpath}/systemd/system/multi-user.target.wants/ -ln -sf bluetooth.service %{buildroot}%{_libpath}/systemd/system/dbus-org.bluez.service -ln -sf ../bluetooth-frwk.service %{buildroot}%{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service -#endif - -mkdir -p %{buildroot}%{upgrade_script_path} -cp -f packaging/500.bluez_upgrade.sh %{buildroot}%{upgrade_script_path} - -%post -n libbluetooth -p /sbin/ldconfig - -%postun -n libbluetooth -p /sbin/ldconfig - -%ifarch %{ix86} || %{arm} -%post -n libbluetooth-extension-TM1 -pushd %{_libdir} -for FILE in libbluetooth.so*.tm1; do mv "$FILE" "${FILE%.tm1}"; done -popd -/sbin/ldconfig -%endif - -%files -%manifest %{name}.manifest -%defattr(-, root, root) -%license COPYING -#%{_sysconfdir}/bluetooth/audio.conf -#%{_sysconfdir}/bluetooth/network.conf -#%{_sysconfdir}/bluetooth/rfcomm.conf -#%{_sysconfdir}/dbus-1/system.d/bluetooth.conf -#%{_datadir}/man/*/* -%{_bindir}/hcitool -%{_bindir}/l2ping -%{_bindir}/obexctl -%{_bindir}/rfcomm -%{_bindir}/btsnoop -%{_bindir}/mpris-proxy -%{_bindir}/sdptool -%{_bindir}/ciptool -#%{_bindir}/dfutool -%{_bindir}/hciattach -%{_bindir}/hciconfig -%{_libexecdir}/bluetooth/bluetoothd -%{_bindir}/bccmd -#%{_sbindir}/hid2hci -%dir /usr/lib/udev -/usr/lib/udev/* -%{upgrade_script_path}/500.bluez_upgrade.sh - -#test -2 -%exclude /%{_libpath}/systemd/system/bluetooth.service -%exclude %{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service -%exclude /%{_datadir}/dbus-1/system-services/org.bluez.service -%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf -%dir /var/lib/bluetooth -%dir %{_sysconfdir}/modprobe.d -%config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf - - - - -%files devel -%manifest %{name}.manifest -%defattr(-, root, root) -%{_includedir}/bluetooth/* -%{_libdir}/libbluetooth.so -%{_libdir}/pkgconfig/bluez.pc - -%files -n libbluetooth -%manifest %{name}.manifest -%defattr(-, root, root) -%{_libdir}/libbluetooth.so.* -%exclude %{_libdir}/libbluetooth.so*.tm1 -%license COPYING - -%ifarch %{ix86} || %{arm} -%files -n libbluetooth-extension-TM1 -%manifest %{name}.manifest -%defattr(-, root, root) -%{_libdir}/libbluetooth.so*.tm1 -%endif - -%files -n obexd -%manifest %{name}.manifest -%defattr(-,root,root,-) -%{_libexecdir}/bluetooth/obexd -%{_libpath}/systemd/user/obex.service -%{_datadir}/dbus-1/services/org.bluez.obex.service -#%{_sysconfdir}/obex/root-setup.d/000_create-symlinks -#%{_bindir}/obex-root-setup -#%{_bindir}/obex.sh - - -%files test -%manifest %{name}.manifest -%defattr(-,root,root) -%{_libdir}/bluez/test/* -%{_bindir}/l2test -%{_bindir}/rctest -%{_bindir}/bluetoothctl -%{_bindir}/btiotest -#%{_bindir}/mpris-player -%{_bindir}/bluetooth-player -%{_bindir}/btmon -%{_bindir}/hcidump -%{_bindir}/btmgmt -%{_bindir}/scotest -%{_bindir}/bluemoon -%{_bindir}/gatttool -%{_bindir}/hex2hcd -%{_bindir}/btattach -%exclude /usr/lib/debug/* - -%docs_package - -%post profile_wearable -ln -sf main.conf.wearable %{_sysconfdir}/bluetooth/main.conf -%preun profile_wearable -rm %{_sysconfdir}/bluetooth/main.conf -%files profile_wearable -%{_sysconfdir}/bluetooth/main.conf.wearable - -%files profile_tv -%{_sysconfdir}/bluetooth/main.conf -%{_libpath}/systemd/system/bluetooth.service -%{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service -%{_libpath}/systemd/system/dbus-org.bluez.service -%{_datadir}/dbus-1/system-services/org.bluez.service - -%files profile_common -%{_sysconfdir}/bluetooth/main.conf - -%changelog diff --git a/packaging/create-symlinks b/packaging/create-symlinks deleted file mode 100644 index 31aa6ab..0000000 --- a/packaging/create-symlinks +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -OBEX_ROOT="$1" - -cd "$OBEX_ROOT" - -ln -sf ../MyDocs/.documents Documents -ln -sf ../MyDocs/.images Images -ln -sf ../MyDocs/.sounds "Audio clips" -ln -sf ../MyDocs/.camera Camera -ln -sf ../MyDocs/.videos "Video clips" -ln -sf ../MyDocs Data diff --git a/packaging/disable-eir-unittest.patch b/packaging/disable-eir-unittest.patch deleted file mode 100644 index 1c4aacd..0000000 --- a/packaging/disable-eir-unittest.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: master/bluez/Makefile.am -=================================================================== ---- master.orig/bluez/Makefile.am 2012-12-03 18:04:33.553687302 +0530 -+++ master/bluez/Makefile.am 2012-12-03 18:47:45.061594577 +0530 -@@ -441,7 +441,7 @@ - - unit_objects = - --if TEST -+if FALSE - unit_tests = unit/test-eir - - noinst_PROGRAMS += $(unit_tests) -Index: master/bluez/acinclude.m4 -=================================================================== ---- master.orig/bluez/acinclude.m4 2012-12-03 18:04:33.553687302 +0530 -+++ master/bluez/acinclude.m4 2012-12-03 18:27:11.865638700 +0530 -@@ -387,7 +387,7 @@ - AM_CONDITIONAL(PAND, test "${pand_enable}" = "yes") - AM_CONDITIONAL(DUND, test "${dund_enable}" = "yes") - AM_CONDITIONAL(CUPS, test "${cups_enable}" = "yes") -- AM_CONDITIONAL(TEST, test "${test_enable}" = "yes" && test "${check_found}" = "yes") -+ AM_CONDITIONAL(TEST, test "${test_enable}" = "yes") - AM_CONDITIONAL(TOOLS, test "${tools_enable}" = "yes") - AM_CONDITIONAL(BCCMD, test "${bccmd_enable}" = "yes") - AM_CONDITIONAL(PCMCIA, test "${pcmcia_enable}" = "yes") diff --git a/packaging/obex-root-setup b/packaging/obex-root-setup deleted file mode 100644 index fc0864f..0000000 --- a/packaging/obex-root-setup +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -ROOT_SETUP=/etc/obex/root-setup.d - -OBEX_ROOT="$1" - -mkdir -p "$OBEX_ROOT" - -if [ -d "$ROOT_SETUP" ]; then - run-parts -a "$OBEX_ROOT" "$ROOT_SETUP" -fi - -chmod 0550 "$OBEX_ROOT" diff --git a/packaging/obex.sh b/packaging/obex.sh deleted file mode 100644 index 884abde..0000000 --- a/packaging/obex.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# This script has to be launched by systemd obex service. -# It was separated from the systemd service to check -# the presence of obex root directory. If the directory -# does not exist, then create it. -if [ ! -z `ps ax | grep -v grep | grep obexd` ]; -then return -fi - -eval $(tzplatform-get TZ_USER_CONTENT); - -if [ ! -d $TZ_USER_CONTENT ]; -then mkdir -p $TZ_USER_CONTENT; -fi - -exec /lib/bluetooth/obexd -d --noplugin=syncevolution,pcsuite,irmc --symlinks -r $TZ_USER_CONTENT; - diff --git a/peripheral/attach.c b/peripheral/attach.c old mode 100644 new mode 100755 diff --git a/peripheral/attach.h b/peripheral/attach.h old mode 100644 new mode 100755 diff --git a/peripheral/efivars.c b/peripheral/efivars.c old mode 100644 new mode 100755 diff --git a/peripheral/efivars.h b/peripheral/efivars.h old mode 100644 new mode 100755 diff --git a/peripheral/gap.c b/peripheral/gap.c old mode 100644 new mode 100755 diff --git a/peripheral/gap.h b/peripheral/gap.h old mode 100644 new mode 100755 diff --git a/peripheral/gatt.c b/peripheral/gatt.c old mode 100644 new mode 100755 diff --git a/peripheral/gatt.h b/peripheral/gatt.h old mode 100644 new mode 100755 diff --git a/peripheral/log.c b/peripheral/log.c old mode 100644 new mode 100755 diff --git a/peripheral/log.h b/peripheral/log.h old mode 100644 new mode 100755 diff --git a/peripheral/main.c b/peripheral/main.c old mode 100644 new mode 100755 diff --git a/plugins/autopair.c b/plugins/autopair.c old mode 100644 new mode 100755 diff --git a/plugins/dbusoob.c b/plugins/dbusoob.c deleted file mode 100644 index 8948d5d..0000000 --- a/plugins/dbusoob.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 ST-Ericsson SA - * - * Author: Szymon Janc for ST-Ericsson - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "gdbus/gdbus.h" - -#include -#include -#include - -#include "src/plugin.h" -#include "src/log.h" -#include "src/dbus-common.h" -#include "src/adapter.h" -#include "src/device.h" -#include "src/eir.h" -#include "src/agent.h" -#include "src/hcid.h" -#include "src/error.h" - -#define OOB_INTERFACE "org.bluez.OutOfBand" - -struct oob_request { - struct btd_adapter *adapter; - DBusMessage *msg; -}; - -static GSList *oob_requests = NULL; -static DBusConnection *connection = NULL; - -static gint oob_request_cmp(gconstpointer a, gconstpointer b) -{ - const struct oob_request *data = a; - const struct btd_adapter *adapter = b; - - return data->adapter != adapter; -} - -static struct oob_request *find_oob_request(struct btd_adapter *adapter) -{ - GSList *match; - - match = g_slist_find_custom(oob_requests, adapter, oob_request_cmp); - - if (match) - return match->data; - - return NULL; -} - -static void read_local_data_complete(struct btd_adapter *adapter, - const uint8_t *hash192, const uint8_t *randomizer192, - const uint8_t *hash256, const uint8_t *randomizer256, - void *user_data) -{ - struct DBusMessage *reply; - struct oob_request *oob_request; - - oob_request = find_oob_request(adapter); - if (!oob_request) - return; - - if ((hash192 && randomizer192) || (hash256 && randomizer256)) - reply = g_dbus_create_reply(oob_request->msg, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &hash192, 16, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &randomizer192, 16, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, - &hash256, hash256 ? 16 : 0, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, - &randomizer256, randomizer256 ? 16 : 0, - DBUS_TYPE_INVALID); - else - reply = btd_error_failed(oob_request->msg, - "Failed to read local OOB data."); - - oob_requests = g_slist_remove(oob_requests, oob_request); - dbus_message_unref(oob_request->msg); - g_free(oob_request); - - if (!reply) { - error("Couldn't allocate D-Bus message"); - return; - } - - if (!g_dbus_send_message(connection, reply)) - error("D-Bus send failed"); -} - -static DBusMessage *read_local_data(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct btd_adapter *adapter = data; - struct oob_request *oob_request; - struct oob_handler *handler; - - if (find_oob_request(adapter)) - return btd_error_in_progress(msg); - - if (btd_adapter_read_local_oob_data(adapter)) - return btd_error_failed(msg, "Request failed."); - - oob_request = g_new(struct oob_request, 1); - oob_request->adapter = adapter; - oob_requests = g_slist_append(oob_requests, oob_request); - oob_request->msg = dbus_message_ref(msg); - - handler = g_new0(struct oob_handler, 1); - handler->read_local_cb = read_local_data_complete; - - btd_adapter_set_oob_handler(oob_request->adapter, handler); - - return NULL; -} - -static DBusMessage *add_remote_data(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct btd_adapter *adapter = data; - const char *addr = NULL; - uint8_t *hash192 = NULL; - uint8_t *randomizer192 = NULL; - int32_t h192_len = 0; - int32_t r192_len = 0; - uint8_t *hash256 = NULL; - uint8_t *randomizer256 = NULL; - int32_t h256_len = 0; - int32_t r256_len = 0; - bdaddr_t bdaddr; - uint8_t addr_type = 0; - bool valid_len; - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &addr, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &hash192, &h192_len, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &randomizer192, &r192_len, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &hash256, &h256_len, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &randomizer256, &r256_len, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - valid_len = (h192_len == 16 && r192_len == 16) || - (h256_len == 16 && r256_len == 16); - - if (!valid_len || bachk(addr)) - return btd_error_invalid_args(msg); - - str2ba(addr, &bdaddr); - - if (btd_adapter_add_remote_oob_ext_data(adapter, &bdaddr, addr_type, - hash192, randomizer192, - hash256, randomizer256)) - return btd_error_failed(msg, "Request failed"); - - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} - -static DBusMessage *remove_remote_data(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct btd_adapter *adapter = data; - const char *addr; - bdaddr_t bdaddr; - uint8_t addr_type = 0; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &addr, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (bachk(addr)) - return btd_error_invalid_args(msg); - - str2ba(addr, &bdaddr); - - if (btd_adapter_remove_remote_oob_ext_data(adapter, &bdaddr, addr_type)) - return btd_error_failed(msg, "Request failed"); - - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} - -static const GDBusMethodTable oob_methods[] = { - { GDBUS_METHOD("AddRemoteData", - GDBUS_ARGS({ "address", "s" }, - { "hash192", "ay" }, { "randomizer192", "ay" }, - { "hash256", "ay" }, { "randomizer256", "ay" }), - NULL, - add_remote_data) }, - { GDBUS_METHOD("RemoveRemoteData", - GDBUS_ARGS({ "address", "s" }), NULL, - remove_remote_data) }, - { GDBUS_ASYNC_METHOD("ReadLocalData", - NULL, GDBUS_ARGS( - {"hash192", "ay" }, { "randomizer192", "ay" }, - {"hash256", "ay" }, { "randomizer256", "ay" }), - read_local_data) }, - { } -}; - -static int oob_probe(struct btd_adapter *adapter) -{ - const char *path = adapter_get_path(adapter); - - DBG("dbusoob probe"); - DBG("adapter path: %s", path); - - if (!g_dbus_register_interface(connection, path, OOB_INTERFACE, - oob_methods, NULL, NULL, adapter, NULL)) { - error("OOB interface init failed on path %s", path); - return -EIO; - } - - return 0; -} - -static void oob_remove(struct btd_adapter *adapter) -{ - read_local_data_complete(adapter, NULL, NULL, NULL, NULL, NULL); - - g_dbus_unregister_interface(connection, adapter_get_path(adapter), - OOB_INTERFACE); -} - -static struct btd_adapter_driver oob_driver = { - .name = "oob", - .probe = oob_probe, - .remove = oob_remove, -}; - -static int dbusoob_init(void) -{ - DBG("Setup dbusoob plugin"); - - connection = btd_get_dbus_connection(); - - return btd_register_adapter_driver(&oob_driver); -} - -static void dbusoob_exit(void) -{ - DBG("Cleanup dbusoob plugin"); - - btd_unregister_adapter_driver(&oob_driver); -} - -BLUETOOTH_PLUGIN_DEFINE(dbusoob, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - dbusoob_init, dbusoob_exit) -#endif diff --git a/plugins/external-dummy.c b/plugins/external-dummy.c old mode 100644 new mode 100755 diff --git a/plugins/gatt-example.c b/plugins/gatt-example.c old mode 100644 new mode 100755 diff --git a/plugins/hostname.c b/plugins/hostname.c old mode 100644 new mode 100755 diff --git a/plugins/neard.c b/plugins/neard.c old mode 100644 new mode 100755 index 51e276e..cabcf34 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -259,16 +259,9 @@ static DBusMessage *create_request_oob_reply(struct btd_adapter *adapter, return reply; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void read_local_complete(struct btd_adapter *adapter, - const uint8_t *hash, const uint8_t *randomizer, - const uint8_t *hash256, const uint8_t *randomizer256, - void *user_data) -#else static void read_local_complete(struct btd_adapter *adapter, const uint8_t *hash, const uint8_t *randomizer, void *user_data) -#endif { DBusMessage *msg = user_data; DBusMessage *reply; diff --git a/plugins/policy.c b/plugins/policy.c old mode 100644 new mode 100755 index 5bf8f5c..c9a7c84 --- a/plugins/policy.c +++ b/plugins/policy.c @@ -45,21 +45,12 @@ #include "src/profile.h" #include "src/hcid.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define CONTROL_CONNECT_TIMEOUT 4 -#define TARGET_CONNECT_TIMEOUT 1 -#else #define CONTROL_CONNECT_TIMEOUT 2 -#endif #define SOURCE_RETRY_TIMEOUT 2 #define SINK_RETRY_TIMEOUT SOURCE_RETRY_TIMEOUT #define CT_RETRY_TIMEOUT 1 #define TG_RETRY_TIMEOUT CT_RETRY_TIMEOUT -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define SOURCE_RETRIES 0 -#else #define SOURCE_RETRIES 1 -#endif #define SINK_RETRIES SOURCE_RETRIES #define CT_RETRIES 1 #define TG_RETRIES CT_RETRIES @@ -104,10 +95,29 @@ struct policy_data { uint8_t tg_retries; }; +static struct reconnect_data *reconnect_find(struct btd_device *dev) +{ + GSList *l; + + for (l = reconnects; l; l = g_slist_next(l)) { + struct reconnect_data *reconnect = l->data; + + if (reconnect->dev == dev) + return reconnect; + } + + return NULL; +} + static void policy_connect(struct policy_data *data, struct btd_service *service) { struct btd_profile *profile = btd_service_get_profile(service); + struct reconnect_data *reconnect; + + reconnect = reconnect_find(btd_service_get_device(service)); + if (reconnect && reconnect->active) + return; DBG("%s profile %s", device_get_path(data->dev), profile->name); @@ -277,15 +287,7 @@ static void sink_cb(struct btd_service *service, btd_service_state_t old_state, * immediatelly otherwise set timer */ if (old_state == BTD_SERVICE_STATE_CONNECTING) -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Set timer as most of the devices initiate - * avrcp connection immediately; irrespective of local - * or remote initiated a2dp connection - */ - policy_set_ct_timer(data, CONTROL_CONNECT_TIMEOUT); -#else policy_connect(data, controller); -#endif else if (btd_service_get_state(controller) != BTD_SERVICE_STATE_CONNECTED) policy_set_ct_timer(data, CONTROL_CONNECT_TIMEOUT); @@ -315,15 +317,8 @@ static void policy_set_tg_timer(struct policy_data *data, int timeout) if (data->tg_timer > 0) g_source_remove(data->tg_timer); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - data->tg_timer = g_timeout_add_seconds(TARGET_CONNECT_TIMEOUT, - policy_connect_tg, - data); -#else data->tg_timer = g_timeout_add_seconds(timeout, policy_connect_tg, data); -#endif } static gboolean policy_connect_source(gpointer user_data) @@ -391,13 +386,9 @@ static void source_cb(struct btd_service *service, if (data->tg_timer > 0) { g_source_remove(data->tg_timer); data->tg_timer = 0; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined BT_QUALIFICATION - } -#else } else if (btd_service_get_state(target) != BTD_SERVICE_STATE_DISCONNECTED) policy_disconnect(data, target); -#endif break; case BTD_SERVICE_STATE_CONNECTING: break; @@ -524,6 +515,7 @@ static void target_cb(struct btd_service *service, static void reconnect_reset(struct reconnect_data *reconnect) { reconnect->attempt = 0; + reconnect->active = false; if (reconnect->timer > 0) { g_source_remove(reconnect->timer); @@ -546,20 +538,6 @@ static bool reconnect_match(const char *uuid) return false; } -static struct reconnect_data *reconnect_find(struct btd_device *dev) -{ - GSList *l; - - for (l = reconnects; l; l = g_slist_next(l)) { - struct reconnect_data *reconnect = l->data; - - if (reconnect->dev == dev) - return reconnect; - } - - return NULL; -} - static struct reconnect_data *reconnect_add(struct btd_service *service) { struct btd_device *dev = btd_service_get_device(service); @@ -671,7 +649,6 @@ static void service_cb(struct btd_service *service, */ reconnect = reconnect_add(service); - reconnect->active = false; reconnect_reset(reconnect); /* @@ -703,7 +680,6 @@ static gboolean reconnect_timeout(gpointer data) return FALSE; } - reconnect->active = true; reconnect->attempt++; return FALSE; @@ -713,12 +689,13 @@ static void reconnect_set_timer(struct reconnect_data *reconnect) { static int timeout = 0; - reconnect->attempt++; + reconnect->active = true; if (reconnect->attempt < reconnect_intervals_len) timeout = reconnect_intervals[reconnect->attempt]; - DBG("%d seconds", timeout); + DBG("attempt %u/%zu %d seconds", reconnect->attempt + 1, + reconnect_attempts, timeout); reconnect->timer = g_timeout_add_seconds(timeout, reconnect_timeout, reconnect); @@ -737,6 +714,8 @@ static void disconnect_cb(struct btd_device *dev, uint8_t reason) if (!reconnect || !reconnect->reconnect) return; + reconnect_reset(reconnect); + DBG("Device %s identified for auto-reconnection", device_get_path(dev)); @@ -756,8 +735,6 @@ static void conn_fail_cb(struct btd_device *dev, uint8_t status) if (!reconnect->active) return; - reconnect->active = false; - /* Give up if we were powered off */ if (status == MGMT_STATUS_NOT_POWERED) { reconnect_reset(reconnect); @@ -805,6 +782,8 @@ static int policy_init(void) goto done; } + g_key_file_set_list_separator(conf, ','); + reconnect_uuids = g_key_file_get_string_list(conf, "Policy", "ReconnectUUIDs", NULL, &gerr); diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c old mode 100644 new mode 100755 diff --git a/plugins/wiimote.c b/plugins/wiimote.c old mode 100644 new mode 100755 diff --git a/profile.h b/profile.h deleted file mode 100644 index 697303d..0000000 --- a/profile.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef __TIZEN_PROFILE_H__ -#define __TIZEN_PROFILE_H__ - -#include - -#include -#include -#include -#include - -#define MODEL_CONFIG_FILE "/etc/config/model-config.xml" -#define TYPE_FIELD "string" -#define FEATURE_TAG "platform" -#define MODEL_CONFIG_TAG "model-config" - -typedef enum { - TIZEN_PROFILE_UNKNOWN = 0, - TIZEN_PROFILE_MOBILE = 0x1, - TIZEN_PROFILE_WEARABLE = 0x2, - TIZEN_PROFILE_TV = 0x4, - TIZEN_PROFILE_IVI = 0x8, - TIZEN_PROFILE_COMMON = 0x10, -} tizen_profile_t; - -static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN; - -static inline int __get_profile_from_model_config_xml(const char *field, char **value) -{ - char *node_name = NULL; - char *node_value = NULL; - xmlNode *cur_node = NULL; - xmlNodePtr cur_ptr = NULL; - xmlNodePtr model_ptr = NULL; - xmlDocPtr xml_doc = NULL; - - xml_doc = xmlParseFile(MODEL_CONFIG_FILE); - if (xml_doc == NULL) - return -1; - - cur_ptr = xmlDocGetRootElement(xml_doc); - if (cur_ptr == NULL) { - xmlFreeDoc(xml_doc); - return -1; - } - - for (cur_node = cur_ptr; cur_node; cur_node = cur_node->next) { - if (!xmlStrcmp(cur_ptr->name, (const xmlChar*)MODEL_CONFIG_TAG)) - break; - } - - if (cur_ptr == NULL) { - xmlFreeDoc(xml_doc); - return -1; - } - - cur_ptr = cur_ptr->xmlChildrenNode; - for (cur_node = cur_ptr; cur_node; cur_node = cur_node->next) { - if (!xmlStrcmp(cur_node->name, (const xmlChar*)FEATURE_TAG)) { - model_ptr = cur_node; - break; - } - } - - if (model_ptr == NULL) { - xmlFreeDoc(xml_doc); - return -1; - } - - if (model_ptr) { - cur_ptr = model_ptr->xmlChildrenNode; - - for (cur_node = cur_ptr; cur_node; cur_node = cur_node->next) { - if (cur_node->type == XML_ELEMENT_NODE) { - node_name = (char *)xmlGetProp(cur_node, (const xmlChar*)"name"); - - if (!strncmp(node_name, field, strlen(node_name))) { - node_value = (char *)xmlNodeListGetString(xml_doc, cur_node->xmlChildrenNode, 1); - if (node_value) { - *value = strdup(node_value); - free(node_name); - free(node_value); - break; - } - } - free(node_name); - } - } - } - - xmlFreeDoc(xml_doc); - return 0; -} - -static inline tizen_profile_t _get_tizen_profile(void) -{ - char *profile_name = NULL; - - if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1)) - return profile; - - if (__get_profile_from_model_config_xml("tizen.org/feature/profile", - &profile_name) < 0) { - profile = TIZEN_PROFILE_MOBILE; - return profile; - } - - if (profile_name == NULL) { - profile = TIZEN_PROFILE_MOBILE; - return profile; - } - - switch (*profile_name) { - case 'm': - case 'M': - profile = TIZEN_PROFILE_MOBILE; - break; - case 'w': - case 'W': - profile = TIZEN_PROFILE_WEARABLE; - break; - case 't': - case 'T': - profile = TIZEN_PROFILE_TV; - break; - case 'i': - case 'I': - profile = TIZEN_PROFILE_IVI; - break; - default: /* common or unknown ==> ALL ARE COMMON */ - profile = TIZEN_PROFILE_COMMON; - } - free(profile_name); - - return profile; -} - -#define TIZEN_FEATURE_BLUEZ_BRCM_CHIP ((_get_tizen_profile()) == TIZEN_PROFILE_IVI) -#define TIZEN_FEATURE_BLUEZ_SMS_ONLY ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE) -#define TIZEN_FEATURE_BLUEZ_BRCM_QOS ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE) -#define TIZEN_FEATURE_BLUEZ_ROLE_CHANGE ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE) -#define TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY ((_get_tizen_profile()) == TIZEN_PROFILE_WEARABLE) - - -#endif /* __TIZEN_PROFILE_H__ */ - diff --git a/profiles/alert/server.c b/profiles/alert/server.c deleted file mode 100644 index 2f6e3cd..0000000 --- a/profiles/alert/server.c +++ /dev/null @@ -1,1044 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/hci.h" -#include "lib/hci_lib.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/plugin.h" -#include "src/dbus-common.h" -#include "attrib/att.h" -#include "src/adapter.h" -#include "src/device.h" -#include "attrib/att-database.h" -#include "src/log.h" -#include "attrib/gatt-service.h" -#include "attrib/gattrib.h" -#include "src/attrib-server.h" -#include "attrib/gatt.h" -#include "src/profile.h" -#include "src/error.h" -#include "src/textfile.h" -#include "src/attio.h" - -#define PHONE_ALERT_STATUS_SVC_UUID 0x180E -#define ALERT_NOTIF_SVC_UUID 0x1811 - -#define ALERT_STATUS_CHR_UUID 0x2A3F -#define RINGER_CP_CHR_UUID 0x2A40 -#define RINGER_SETTING_CHR_UUID 0x2A41 - -#define ALERT_NOTIF_CP_CHR_UUID 0x2A44 -#define UNREAD_ALERT_CHR_UUID 0x2A45 -#define NEW_ALERT_CHR_UUID 0x2A46 -#define SUPP_NEW_ALERT_CAT_CHR_UUID 0x2A47 -#define SUPP_UNREAD_ALERT_CAT_CHR_UUID 0x2A48 - -#define ALERT_OBJECT_PATH "/org/bluez" -#define ALERT_INTERFACE "org.bluez.Alert1" -#define ALERT_AGENT_INTERFACE "org.bluez.AlertAgent1" - -/* Maximum length for "Text String Information" */ -#define NEW_ALERT_MAX_INFO_SIZE 18 -/* Maximum length for New Alert Characteristic Value */ -#define NEW_ALERT_CHR_MAX_VALUE_SIZE (NEW_ALERT_MAX_INFO_SIZE + 2) - -enum { - ENABLE_NEW_INCOMING, - ENABLE_UNREAD_CAT, - DISABLE_NEW_INCOMING, - DISABLE_UNREAD_CAT, - NOTIFY_NEW_INCOMING, - NOTIFY_UNREAD_CAT, -}; - -enum { - RINGER_SILENT_MODE = 1, - RINGER_MUTE_ONCE, - RINGER_CANCEL_SILENT_MODE, -}; - -/* Ringer Setting characteristic values */ -enum { - RINGER_SILENT, - RINGER_NORMAL, -}; - -enum notify_type { - NOTIFY_RINGER_SETTING = 0, - NOTIFY_ALERT_STATUS, - NOTIFY_NEW_ALERT, - NOTIFY_UNREAD_ALERT, - NOTIFY_SIZE, -}; - -struct alert_data { - const char *category; - char *srv; - char *path; - guint watcher; -}; - -struct alert_adapter { - struct btd_adapter *adapter; - uint16_t supp_new_alert_cat_handle; - uint16_t supp_unread_alert_cat_handle; - uint16_t hnd_ccc[NOTIFY_SIZE]; - uint16_t hnd_value[NOTIFY_SIZE]; -}; - -struct notify_data { - struct alert_adapter *al_adapter; - enum notify_type type; - uint8_t *value; - size_t len; -}; - -struct notify_callback { - struct notify_data *notify_data; - struct btd_device *device; - guint id; -}; - -static GSList *registered_alerts = NULL; -static GSList *alert_adapters = NULL; -static uint8_t ringer_setting = RINGER_NORMAL; -static uint8_t alert_status = 0; - -static const char * const anp_categories[] = { - "simple", - "email", - "news", - "call", - "missed-call", - "sms-mms", - "voice-mail", - "schedule", - "high-priority", - "instant-message", -}; - -static const char * const pasp_categories[] = { - "ringer", - "vibrate", - "display", -}; - -static int adapter_cmp(gconstpointer a, gconstpointer b) -{ - const struct alert_adapter *al_adapter = a; - const struct btd_adapter *adapter = b; - - return al_adapter->adapter == adapter ? 0 : -1; -} - -static struct alert_adapter *find_alert_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(alert_adapters, adapter, adapter_cmp); - - return l ? l->data : NULL; -} - -static void alert_data_destroy(gpointer user_data) -{ - struct alert_data *alert = user_data; - - if (alert->watcher) - g_dbus_remove_watch(btd_get_dbus_connection(), alert->watcher); - - g_free(alert->srv); - g_free(alert->path); - g_free(alert); -} - -static void alert_release(gpointer user_data) -{ - struct alert_data *alert = user_data; - DBusMessage *msg; - - msg = dbus_message_new_method_call(alert->srv, alert->path, - ALERT_AGENT_INTERFACE, - "Release"); - if (msg) - g_dbus_send_message(btd_get_dbus_connection(), msg); - - alert_data_destroy(alert); -} - -static void alert_destroy(gpointer user_data) -{ - DBG(""); - - g_slist_free_full(registered_alerts, alert_release); - registered_alerts = NULL; -} - -static const char *valid_category(const char *category) -{ - unsigned i; - - for (i = 0; i < G_N_ELEMENTS(anp_categories); i++) { - if (g_str_equal(anp_categories[i], category)) - return anp_categories[i]; - } - - for (i = 0; i < G_N_ELEMENTS(pasp_categories); i++) { - if (g_str_equal(pasp_categories[i], category)) - return pasp_categories[i]; - } - - return NULL; -} - -static struct alert_data *get_alert_data_by_category(const char *category) -{ - GSList *l; - struct alert_data *alert; - - for (l = registered_alerts; l; l = g_slist_next(l)) { - alert = l->data; - if (g_str_equal(alert->category, category)) - return alert; - } - - return NULL; -} - -static gboolean registered_category(const char *category) -{ - struct alert_data *alert; - - alert = get_alert_data_by_category(category); - if (alert) - return TRUE; - - return FALSE; -} - -static gboolean pasp_category(const char *category) -{ - unsigned i; - - for (i = 0; i < G_N_ELEMENTS(pasp_categories); i++) - if (g_str_equal(category, pasp_categories[i])) - return TRUE; - - return FALSE; -} - -static gboolean valid_description(const char *category, - const char *description) -{ - if (!pasp_category(category)) { - if (strlen(description) >= NEW_ALERT_MAX_INFO_SIZE) - return FALSE; - - return TRUE; - } - - if (g_str_equal(description, "active") || - g_str_equal(description, "not active")) - return TRUE; - - if (g_str_equal(category, "ringer")) - if (g_str_equal(description, "enabled") || - g_str_equal(description, "disabled")) - return TRUE; - - return FALSE; -} - -static gboolean valid_count(const char *category, uint16_t count) -{ - if (!pasp_category(category) && count > 0 && count <= 255) - return TRUE; - - if (pasp_category(category) && count == 1) - return TRUE; - - return FALSE; -} - -static void update_supported_categories(gpointer data, gpointer user_data) -{ - struct alert_adapter *al_adapter = data; - struct btd_adapter *adapter = al_adapter->adapter; - uint8_t value[2]; - unsigned int i; - - memset(value, 0, sizeof(value)); - - for (i = 0; i < G_N_ELEMENTS(anp_categories); i++) { - if (registered_category(anp_categories[i])) - hci_set_bit(i, value); - } - - attrib_db_update(adapter, al_adapter->supp_new_alert_cat_handle, NULL, - value, sizeof(value), NULL); - - /* FIXME: For now report all registered categories as supporting unread - * status, until it is known which ones should be supported */ - attrib_db_update(adapter, al_adapter->supp_unread_alert_cat_handle, - NULL, value, sizeof(value), NULL); -} - -static void watcher_disconnect(DBusConnection *conn, void *user_data) -{ - struct alert_data *alert = user_data; - - DBG("Category %s was disconnected", alert->category); - - registered_alerts = g_slist_remove(registered_alerts, alert); - alert_data_destroy(alert); - - g_slist_foreach(alert_adapters, update_supported_categories, NULL); -} - -static gboolean is_notifiable_device(struct btd_device *device, uint16_t ccc) -{ - char *filename; - GKeyFile *key_file; - char handle[6]; - char *str; - uint16_t val; - gboolean result; - - sprintf(handle, "%hu", ccc); - - filename = btd_device_get_storage_path(device, "ccc"); - if (!filename) { - warn("Unable to get ccc storage path for device"); - return FALSE; - } - - key_file = g_key_file_new(); - g_key_file_load_from_file(key_file, filename, 0, NULL); - - str = g_key_file_get_string(key_file, handle, "Value", NULL); - if (!str) { - result = FALSE; - goto end; - } - - val = strtol(str, NULL, 16); - if (!(val & 0x0001)) { - result = FALSE; - goto end; - } - - result = TRUE; -end: - g_free(str); - g_free(filename); - g_key_file_free(key_file); - - return result; -} - -static void destroy_notify_callback(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct notify_callback *cb = user_data; - - DBG("status=%#x", status); - - btd_device_remove_attio_callback(cb->device, cb->id); - btd_device_unref(cb->device); - g_free(cb->notify_data->value); - g_free(cb->notify_data); - g_free(cb); -} - -static void attio_connected_cb(GAttrib *attrib, gpointer user_data) -{ - struct notify_callback *cb = user_data; - struct notify_data *nd = cb->notify_data; - enum notify_type type = nd->type; - struct alert_adapter *al_adapter = nd->al_adapter; - size_t len; - uint8_t *pdu = g_attrib_get_buffer(attrib, &len); - - - switch (type) { - case NOTIFY_RINGER_SETTING: - len = enc_notification(al_adapter->hnd_value[type], - &ringer_setting, sizeof(ringer_setting), - pdu, len); - break; - case NOTIFY_ALERT_STATUS: - len = enc_notification(al_adapter->hnd_value[type], - &alert_status, sizeof(alert_status), - pdu, len); - break; - case NOTIFY_NEW_ALERT: - case NOTIFY_UNREAD_ALERT: - len = enc_notification(al_adapter->hnd_value[type], - nd->value, nd->len, pdu, len); - break; - case NOTIFY_SIZE: - default: - DBG("Unknown type, could not send notification"); - goto end; - } - - DBG("Send notification for handle: 0x%04x, ccc: 0x%04x", - al_adapter->hnd_value[type], - al_adapter->hnd_ccc[type]); - - g_attrib_send(attrib, 0, pdu, len, destroy_notify_callback, cb, NULL); - - return; - -end: - btd_device_remove_attio_callback(cb->device, cb->id); - btd_device_unref(cb->device); - g_free(cb->notify_data->value); - g_free(cb->notify_data); - g_free(cb); -} - -static void filter_devices_notify(struct btd_device *device, void *user_data) -{ - struct notify_data *notify_data = user_data; - struct alert_adapter *al_adapter = notify_data->al_adapter; - enum notify_type type = notify_data->type; - struct notify_callback *cb; - - if (!is_notifiable_device(device, al_adapter->hnd_ccc[type])) - return; - - cb = g_new0(struct notify_callback, 1); - cb->notify_data = notify_data; - cb->device = btd_device_ref(device); - cb->id = btd_device_add_attio_callback(device, - attio_connected_cb, NULL, cb); -} - -static void notify_devices(struct alert_adapter *al_adapter, - enum notify_type type, uint8_t *value, size_t len) -{ - struct notify_data *notify_data; - - notify_data = g_new0(struct notify_data, 1); - notify_data->al_adapter = al_adapter; - notify_data->type = type; - notify_data->value = g_memdup(value, len); - notify_data->len = len; - - btd_adapter_for_each_device(al_adapter->adapter, filter_devices_notify, - notify_data); -} - -static void pasp_notification(enum notify_type type) -{ - GSList *it; - struct alert_adapter *al_adapter; - - for (it = alert_adapters; it; it = g_slist_next(it)) { - al_adapter = it->data; - - notify_devices(al_adapter, type, NULL, 0); - } -} - -static DBusMessage *register_alert(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - const char *sender = dbus_message_get_sender(msg); - char *path; - const char *category; - const char *c; - struct alert_data *alert; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &c, - DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - category = valid_category(c); - if (!category) { - DBG("Invalid category: %s", c); - return btd_error_invalid_args(msg); - } - - if (registered_category(category)) { - DBG("Category %s already registered", category); - return dbus_message_new_method_return(msg); - } - - alert = g_new0(struct alert_data, 1); - alert->srv = g_strdup(sender); - alert->path = g_strdup(path); - alert->category = category; - alert->watcher = g_dbus_add_disconnect_watch(conn, alert->srv, - watcher_disconnect, alert, NULL); - - if (alert->watcher == 0) { - alert_data_destroy(alert); - DBG("Could not register disconnect watcher"); - return btd_error_failed(msg, - "Could not register disconnect watcher"); - } - - registered_alerts = g_slist_append(registered_alerts, alert); - - g_slist_foreach(alert_adapters, update_supported_categories, NULL); - - DBG("RegisterAlert(\"%s\", \"%s\")", alert->category, alert->path); - - return dbus_message_new_method_return(msg); -} - -static void update_new_alert(gpointer data, gpointer user_data) -{ - struct alert_adapter *al_adapter = data; - struct btd_adapter *adapter = al_adapter->adapter; - uint8_t *value = user_data; - - attrib_db_update(adapter, al_adapter->hnd_value[NOTIFY_NEW_ALERT], NULL, - &value[1], value[0], NULL); - - notify_devices(al_adapter, NOTIFY_NEW_ALERT, &value[1], value[0]); -} - -static void update_phone_alerts(const char *category, const char *description) -{ - unsigned int i; - - if (g_str_equal(category, "ringer")) { - if (g_str_equal(description, "enabled")) { - ringer_setting = RINGER_NORMAL; - pasp_notification(NOTIFY_RINGER_SETTING); - return; - } else if (g_str_equal(description, "disabled")) { - ringer_setting = RINGER_SILENT; - pasp_notification(NOTIFY_RINGER_SETTING); - return; - } - } - - for (i = 0; i < G_N_ELEMENTS(pasp_categories); i++) { - if (g_str_equal(pasp_categories[i], category)) { - if (g_str_equal(description, "active")) { - alert_status |= (1 << i); - pasp_notification(NOTIFY_ALERT_STATUS); - } else if (g_str_equal(description, "not active")) { - alert_status &= ~(1 << i); - pasp_notification(NOTIFY_ALERT_STATUS); - } - break; - } - } -} - -static DBusMessage *new_alert(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - const char *sender = dbus_message_get_sender(msg); - const char *category, *description; - struct alert_data *alert; - uint16_t count; - unsigned int i; - size_t dlen; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &category, - DBUS_TYPE_UINT16, &count, DBUS_TYPE_STRING, - &description, DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - alert = get_alert_data_by_category(category); - if (!alert) { - DBG("Category %s not registered", category); - return btd_error_invalid_args(msg); - } - - if (!g_str_equal(alert->srv, sender)) { - DBG("Sender %s is not registered in category %s", sender, - category); - return btd_error_invalid_args(msg); - } - - if (!valid_description(category, description)) { - DBG("Description %s is invalid for %s category", - description, category); - return btd_error_invalid_args(msg); - } - - if (!valid_count(category, count)) { - DBG("Count %d is invalid for %s category", count, category); - return btd_error_invalid_args(msg); - } - - dlen = strlen(description); - - for (i = 0; i < G_N_ELEMENTS(anp_categories); i++) { - uint8_t value[NEW_ALERT_CHR_MAX_VALUE_SIZE + 1]; - uint8_t *ptr = value; - - if (!g_str_equal(anp_categories[i], category)) - continue; - - memset(value, 0, sizeof(value)); - - *ptr++ = 2; /* Attribute value size */ - *ptr++ = i; /* Category ID (mandatory) */ - *ptr++ = count; /* Number of New Alert (mandatory) */ - /* Text String Information (optional) */ - strncpy((char *) ptr, description, - NEW_ALERT_MAX_INFO_SIZE - 1); - - if (dlen > 0) - *value += dlen + 1; - - g_slist_foreach(alert_adapters, update_new_alert, value); - } - - if (pasp_category(category)) - update_phone_alerts(category, description); - - DBG("NewAlert(\"%s\", %d, \"%s\")", category, count, description); - - return dbus_message_new_method_return(msg); -} - -static int agent_ringer_mute_once(void) -{ - struct alert_data *alert; - DBusMessage *msg; - - alert = get_alert_data_by_category("ringer"); - if (!alert) { - DBG("Category ringer is not registered"); - return -EINVAL; - } - - msg = dbus_message_new_method_call(alert->srv, alert->path, - ALERT_AGENT_INTERFACE, "MuteOnce"); - if (!msg) - return -ENOMEM; - - dbus_message_set_no_reply(msg, TRUE); - g_dbus_send_message(btd_get_dbus_connection(), msg); - - return 0; -} - -static int agent_ringer_set_ringer(const char *mode) -{ - struct alert_data *alert; - DBusMessage *msg; - - alert = get_alert_data_by_category("ringer"); - if (!alert) { - DBG("Category ringer is not registered"); - return -EINVAL; - } - - msg = dbus_message_new_method_call(alert->srv, alert->path, - ALERT_AGENT_INTERFACE, "SetRinger"); - if (!msg) - return -ENOMEM; - - dbus_message_append_args(msg, DBUS_TYPE_STRING, &mode, - DBUS_TYPE_INVALID); - - dbus_message_set_no_reply(msg, TRUE); - g_dbus_send_message(btd_get_dbus_connection(), msg); - - return 0; -} - -static void update_unread_alert(gpointer data, gpointer user_data) -{ - struct alert_adapter *al_adapter = data; - struct btd_adapter *adapter = al_adapter->adapter; - uint8_t *value = user_data; - - attrib_db_update(adapter, - al_adapter->hnd_value[NOTIFY_UNREAD_ALERT], NULL, value, - 2, NULL); - - notify_devices(al_adapter, NOTIFY_UNREAD_ALERT, value, 2); -} - -static DBusMessage *unread_alert(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - const char *sender = dbus_message_get_sender(msg); - struct alert_data *alert; - const char *category; - unsigned int i; - uint16_t count; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &category, - DBUS_TYPE_UINT16, &count, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - alert = get_alert_data_by_category(category); - if (!alert) { - DBG("Category %s not registered", category); - return btd_error_invalid_args(msg); - } - - if (!valid_count(category, count)) { - DBG("Count %d is invalid for %s category", count, category); - return btd_error_invalid_args(msg); - } - - if (!g_str_equal(alert->srv, sender)) { - DBG("Sender %s is not registered in category %s", sender, - category); - return btd_error_invalid_args(msg); - } - - for (i = 0; i < G_N_ELEMENTS(anp_categories); i++) { - if (g_str_equal(anp_categories[i], category)) { - uint8_t value[2]; - - value[0] = i; /* Category ID */ - value[1] = count; /* Unread count */ - - g_slist_foreach(alert_adapters, update_unread_alert, - value); - } - } - - DBG("category %s, count %d", category, count); - - return dbus_message_new_method_return(msg); -} - -static uint8_t ringer_cp_write(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - DBG("a = %p", a); - - if (a->len > 1) { - DBG("Invalid command size (%zu)", a->len); - return 0; - } - - switch (a->data[0]) { - case RINGER_SILENT_MODE: - DBG("Silent Mode"); - agent_ringer_set_ringer("disabled"); - break; - case RINGER_MUTE_ONCE: - DBG("Mute Once"); - agent_ringer_mute_once(); - break; - case RINGER_CANCEL_SILENT_MODE: - DBG("Cancel Silent Mode"); - agent_ringer_set_ringer("enabled"); - break; - default: - DBG("Invalid command (0x%02x)", a->data[0]); - } - - return 0; -} - -static uint8_t alert_status_read(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - - DBG("a = %p", a); - - if (a->data == NULL || a->data[0] != alert_status) - attrib_db_update(adapter, a->handle, NULL, &alert_status, - sizeof(alert_status), NULL); - - return 0; -} - -static uint8_t ringer_setting_read(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - - DBG("a = %p", a); - - if (a->data == NULL || a->data[0] != ringer_setting) - attrib_db_update(adapter, a->handle, NULL, &ringer_setting, - sizeof(ringer_setting), NULL); - - return 0; -} - -static void register_phone_alert_service(struct alert_adapter *al_adapter) -{ - bt_uuid_t uuid; - - bt_uuid16_create(&uuid, PHONE_ALERT_STATUS_SVC_UUID); - - /* Phone Alert Status Service */ - gatt_service_add(al_adapter->adapter, GATT_PRIM_SVC_UUID, &uuid, - /* Alert Status characteristic */ - GATT_OPT_CHR_UUID16, ALERT_STATUS_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_READ | - GATT_CHR_PROP_NOTIFY, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - alert_status_read, al_adapter->adapter, - GATT_OPT_CCC_GET_HANDLE, - &al_adapter->hnd_ccc[NOTIFY_ALERT_STATUS], - GATT_OPT_CHR_VALUE_GET_HANDLE, - &al_adapter->hnd_value[NOTIFY_ALERT_STATUS], - /* Ringer Control Point characteristic */ - GATT_OPT_CHR_UUID16, RINGER_CP_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_WRITE_WITHOUT_RESP, - GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE, - ringer_cp_write, NULL, - /* Ringer Setting characteristic */ - GATT_OPT_CHR_UUID16, RINGER_SETTING_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_READ | - GATT_CHR_PROP_NOTIFY, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - ringer_setting_read, al_adapter->adapter, - GATT_OPT_CCC_GET_HANDLE, - &al_adapter->hnd_ccc[NOTIFY_RINGER_SETTING], - GATT_OPT_CHR_VALUE_GET_HANDLE, - &al_adapter->hnd_value[NOTIFY_RINGER_SETTING], - GATT_OPT_INVALID); -} - -static uint8_t supp_new_alert_cat_read(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - uint8_t value[] = { 0x00, 0x00 }; - - DBG("a = %p", a); - - if (a->data == NULL) - attrib_db_update(adapter, a->handle, NULL, value, sizeof(value), - NULL); - - return 0; -} - -static uint8_t supp_unread_alert_cat_read(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - uint8_t value[] = { 0x00, 0x00 }; - - DBG("a = %p", a); - - if (a->data == NULL) - attrib_db_update(adapter, a->handle, NULL, value, sizeof(value), - NULL); - - return 0; -} - -static uint8_t alert_notif_cp_write(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - DBG("a = %p", a); - - if (a->len < 2) - return 0; - - switch (a->data[0]) { - case ENABLE_NEW_INCOMING: - DBG("ENABLE_NEW_INCOMING: 0x%02x", a->data[1]); - break; - case ENABLE_UNREAD_CAT: - DBG("ENABLE_UNREAD_CAT: 0x%02x", a->data[1]); - break; - case DISABLE_NEW_INCOMING: - DBG("DISABLE_NEW_INCOMING: 0x%02x", a->data[1]); - break; - case DISABLE_UNREAD_CAT: - DBG("DISABLE_UNREAD_CAT: 0x%02x", a->data[1]); - break; - case NOTIFY_NEW_INCOMING: - DBG("NOTIFY_NEW_INCOMING: 0x%02x", a->data[1]); - break; - case NOTIFY_UNREAD_CAT: - DBG("NOTIFY_UNREAD_CAT: 0x%02x", a->data[1]); - break; - default: - DBG("0x%02x 0x%02x", a->data[0], a->data[1]); - } - - return 0; -} - -static void register_alert_notif_service(struct alert_adapter *al_adapter) -{ - bt_uuid_t uuid; - - bt_uuid16_create(&uuid, ALERT_NOTIF_SVC_UUID); - - /* Alert Notification Service */ - gatt_service_add(al_adapter->adapter, GATT_PRIM_SVC_UUID, &uuid, - /* Supported New Alert Category */ - GATT_OPT_CHR_UUID16, SUPP_NEW_ALERT_CAT_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_READ, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - supp_new_alert_cat_read, al_adapter->adapter, - GATT_OPT_CHR_VALUE_GET_HANDLE, - &al_adapter->supp_new_alert_cat_handle, - /* New Alert */ - GATT_OPT_CHR_UUID16, NEW_ALERT_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_NOTIFY, - GATT_OPT_CCC_GET_HANDLE, - &al_adapter->hnd_ccc[NOTIFY_NEW_ALERT], - GATT_OPT_CHR_VALUE_GET_HANDLE, - &al_adapter->hnd_value[NOTIFY_NEW_ALERT], - /* Supported Unread Alert Category */ - GATT_OPT_CHR_UUID16, SUPP_UNREAD_ALERT_CAT_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_READ, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - supp_unread_alert_cat_read, al_adapter->adapter, - GATT_OPT_CHR_VALUE_GET_HANDLE, - &al_adapter->supp_unread_alert_cat_handle, - /* Unread Alert Status */ - GATT_OPT_CHR_UUID16, UNREAD_ALERT_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_NOTIFY, - GATT_OPT_CCC_GET_HANDLE, - &al_adapter->hnd_ccc[NOTIFY_UNREAD_ALERT], - GATT_OPT_CHR_VALUE_GET_HANDLE, - &al_adapter->hnd_value[NOTIFY_UNREAD_ALERT], - /* Alert Notification Control Point */ - GATT_OPT_CHR_UUID16, ALERT_NOTIF_CP_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_WRITE, - GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE, - alert_notif_cp_write, NULL, - GATT_OPT_INVALID); -} - -static int alert_server_probe(struct btd_profile *p, - struct btd_adapter *adapter) -{ - struct alert_adapter *al_adapter; - - al_adapter = g_new0(struct alert_adapter, 1); - al_adapter->adapter = btd_adapter_ref(adapter); - - alert_adapters = g_slist_append(alert_adapters, al_adapter); - - register_phone_alert_service(al_adapter); - register_alert_notif_service(al_adapter); - - return 0; -} - -static void alert_server_remove(struct btd_profile *p, - struct btd_adapter *adapter) -{ - struct alert_adapter *al_adapter; - - al_adapter = find_alert_adapter(adapter); - if (!al_adapter) - return; - - alert_adapters = g_slist_remove(alert_adapters, al_adapter); - btd_adapter_unref(al_adapter->adapter); - - g_free(al_adapter); -} - -static struct btd_profile alert_profile = { - .name = "gatt-alert-server", - .adapter_probe = alert_server_probe, - .adapter_remove = alert_server_remove, -}; - -static const GDBusMethodTable alert_methods[] = { - { GDBUS_METHOD("RegisterAlert", - GDBUS_ARGS({ "category", "s" }, - { "agent", "o" }), NULL, - register_alert) }, - { GDBUS_METHOD("NewAlert", - GDBUS_ARGS({ "category", "s" }, - { "count", "q" }, - { "description", "s" }), NULL, - new_alert) }, - { GDBUS_METHOD("UnreadAlert", - GDBUS_ARGS({ "category", "s" }, { "count", "q" }), NULL, - unread_alert) }, - { } -}; - -static int alert_server_init(void) -{ - if (!g_dbus_register_interface(btd_get_dbus_connection(), - ALERT_OBJECT_PATH, ALERT_INTERFACE, - alert_methods, NULL, NULL, NULL, - alert_destroy)) { - error("D-Bus failed to register %s interface", - ALERT_INTERFACE); - return -EIO; - } - - return btd_profile_register(&alert_profile); -} - -static void alert_server_exit(void) -{ - btd_profile_unregister(&alert_profile); - - g_dbus_unregister_interface(btd_get_dbus_connection(), - ALERT_OBJECT_PATH, ALERT_INTERFACE); -} - -static int alert_init(void) -{ - return alert_server_init(); -} - -static void alert_exit(void) -{ - alert_server_exit(); -} - -BLUETOOTH_PLUGIN_DEFINE(alert, VERSION, - BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - alert_init, alert_exit) diff --git a/profiles/audio/a2dp-codecs.h b/profiles/audio/a2dp-codecs.h old mode 100644 new mode 100755 index e9da0bf..4fb5c0c --- a/profiles/audio/a2dp-codecs.h +++ b/profiles/audio/a2dp-codecs.h @@ -234,6 +234,11 @@ typedef struct { uint8_t channel_mode:4; } __attribute__ ((packed)) a2dp_aptx_t; +typedef struct { + a2dp_vendor_codec_t info; + uint8_t unknown[2]; +} __attribute__ ((packed)) a2dp_ldac_t; + #else #error "Unknown byte order" #endif diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c old mode 100644 new mode 100755 index e462468..db0736d --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -72,9 +72,6 @@ struct a2dp_sep { struct avdtp *session; struct avdtp_stream *stream; guint suspend_timer; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gboolean remote_suspended; -#endif gboolean delay_reporting; gboolean locked; gboolean suspending; @@ -166,7 +163,6 @@ static void setup_free(struct a2dp_setup *s) avdtp_unref(s->session); g_slist_free_full(s->cb, g_free); g_slist_free_full(s->caps, g_free); - g_free(s); } @@ -211,21 +207,11 @@ static void finalize_setup_errno(struct a2dp_setup *s, int err, { GSourceFunc finalize; va_list args; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct avdtp_error *avdtp_err; -#else struct avdtp_error avdtp_err; -#endif if (err < 0) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - avdtp_err = g_new(struct avdtp_error, 1); - avdtp_error_init(avdtp_err, AVDTP_ERRNO, -err); - s->err = avdtp_err; -#else avdtp_error_init(&avdtp_err, AVDTP_ERRNO, -err); s->err = &avdtp_err; -#endif } va_start(args, cb1); @@ -239,6 +225,29 @@ static void finalize_setup_errno(struct a2dp_setup *s, int err, va_end(args); } +static int error_to_errno(struct avdtp_error *err) +{ + int perr; + + if (!err) + return 0; + + if (avdtp_error_category(err) != AVDTP_ERRNO) + return -EIO; + + perr = avdtp_error_posix_errno(err); + switch (perr) { + case EHOSTDOWN: + case ECONNABORTED: + return -perr; + default: + /* + * An unexpect error has occurred setup may be attempted again. + */ + return -EAGAIN; + } +} + static gboolean finalize_config(gpointer data) { struct a2dp_setup *s = data; @@ -253,8 +262,8 @@ static gboolean finalize_config(gpointer data) if (!cb->config_cb) continue; - cb->config_cb(s->session, s->sep, stream, s->err, - cb->user_data); + cb->config_cb(s->session, s->sep, stream, + error_to_errno(s->err), cb->user_data); setup_cb_free(cb); } @@ -274,7 +283,8 @@ static gboolean finalize_resume(gpointer data) if (!cb->resume_cb) continue; - cb->resume_cb(s->session, s->err, cb->user_data); + cb->resume_cb(s->session, error_to_errno(s->err), + cb->user_data); setup_cb_free(cb); } @@ -294,7 +304,8 @@ static gboolean finalize_suspend(gpointer data) if (!cb->suspend_cb) continue; - cb->suspend_cb(s->session, s->err, cb->user_data); + cb->suspend_cb(s->session, error_to_errno(s->err), + cb->user_data); setup_cb_free(cb); } @@ -330,7 +341,8 @@ static void finalize_discover(struct a2dp_setup *s) if (!cb->discover_cb) continue; - cb->discover_cb(s->session, s->seps, s->err, cb->user_data); + cb->discover_cb(s->session, s->seps, error_to_errno(s->err), + cb->user_data); setup_cb_free(cb); } } @@ -408,13 +420,6 @@ static void stream_state_changed(struct avdtp_stream *stream, return; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (new_state == AVDTP_STATE_STREAMING && sep->suspend_timer) { - g_source_remove(sep->suspend_timer); - sep->suspend_timer = 0; - } -#endif - if (new_state != AVDTP_STATE_IDLE) return; @@ -839,25 +844,12 @@ static gboolean start_ind(struct avdtp *session, struct avdtp_local_sep *sep, else DBG("Source %p: Start_Ind", sep); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!a2dp_sep->locked) { - a2dp_sep->session = avdtp_ref(session); - if(a2dp_sep->remote_suspended == FALSE) - a2dp_sep->suspend_timer = g_timeout_add_seconds(SUSPEND_TIMEOUT, - (GSourceFunc) suspend_timeout, - a2dp_sep); - else - a2dp_sep->remote_suspended = FALSE; - } -#else - if (!a2dp_sep->locked) { a2dp_sep->session = avdtp_ref(session); a2dp_sep->suspend_timer = g_timeout_add_seconds(SUSPEND_TIMEOUT, (GSourceFunc) suspend_timeout, a2dp_sep); } -#endif if (!a2dp_sep->starting) return TRUE; @@ -911,10 +903,6 @@ static gboolean suspend_ind(struct avdtp *session, struct avdtp_local_sep *sep, else DBG("Source %p: Suspend_Ind", sep); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - a2dp_sep->remote_suspended = TRUE; -#endif - if (a2dp_sep->suspend_timer) { g_source_remove(a2dp_sep->suspend_timer); a2dp_sep->suspend_timer = 0; @@ -1219,11 +1207,7 @@ static struct avdtp_sep_ind endpoint_ind = { .delayreport = endpoint_delayreport_ind, }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static sdp_record_t *a2dp_record(uint8_t type, gboolean sink_enabled) -#else static sdp_record_t *a2dp_record(uint8_t type) -#endif { sdp_list_t *svclass_id, *pfseq, *apseq, *root; uuid_t root_uuid, l2cap_uuid, avdtp_uuid, a2dp_uuid; @@ -1232,22 +1216,7 @@ static sdp_record_t *a2dp_record(uint8_t type) sdp_record_t *record; sdp_data_t *psm, *version, *features; uint16_t lp = AVDTP_UUID; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint16_t a2dp_ver, avdtp_ver, feat; - if (sink_enabled) { - DBG("A2DP record for Sink role"); - a2dp_ver = 0x0102; - avdtp_ver = 0x0103; - feat = 0x0002; - } else { - DBG("A2DP record for Source role"); - a2dp_ver = 0x0102; - avdtp_ver = 0x0103; - feat = 0x0001; - } -#else uint16_t a2dp_ver = 0x0103, avdtp_ver = 0x0103, feat = 0x000f; -#endif record = sdp_record_alloc(); if (!record) @@ -1431,13 +1400,6 @@ struct avdtp *a2dp_avdtp_get(struct btd_device *device) return NULL; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (chan->auth_id) { - DBG("auth is already going..."); - return NULL; - } -#endif - if (chan->session) return avdtp_ref(chan->session); @@ -1562,18 +1524,6 @@ static void confirm_cb(GIOChannel *io, gpointer data) if (!device) goto drop; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -{ - gboolean restricted = FALSE; - - restricted = device_is_profile_restricted(device, A2DP_SINK_UUID); - if (restricted) { - DBG("A2DP is restricted"); - goto drop; - } -} -#endif - chan = queue_find(server->channels, match_by_device, device); if (chan) { struct a2dp_setup *setup; @@ -1614,34 +1564,13 @@ static bool a2dp_server_listen(struct a2dp_server *server) if (server->io) return true; -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) - if (btd_adapter_get_a2dp_role(server->adapter) == BLUETOOTH_A2DP_SINK_ROLE) { - server->io = bt_io_listen(NULL, confirm_cb, server, NULL, &err, - BT_IO_OPT_SOURCE_BDADDR, - btd_adapter_get_address(server->adapter), - BT_IO_OPT_PSM, AVDTP_PSM, - BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, - BT_IO_OPT_IMTU, 895, - BT_IO_OPT_MASTER, true, - BT_IO_OPT_INVALID); - } else { - server->io = bt_io_listen(NULL, confirm_cb, server, NULL, &err, + server->io = bt_io_listen(NULL, confirm_cb, server, NULL, &err, BT_IO_OPT_SOURCE_BDADDR, btd_adapter_get_address(server->adapter), BT_IO_OPT_PSM, AVDTP_PSM, BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, BT_IO_OPT_MASTER, true, BT_IO_OPT_INVALID); - } -#else - server->io = bt_io_listen(NULL, confirm_cb, server, NULL, &err, - BT_IO_OPT_SOURCE_BDADDR, - btd_adapter_get_address(server->adapter), - BT_IO_OPT_PSM, AVDTP_PSM, - BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, - BT_IO_OPT_MASTER, true, - BT_IO_OPT_INVALID); -#endif if (server->io) return true; @@ -1768,14 +1697,7 @@ struct a2dp_sep *a2dp_add_sep(struct btd_adapter *adapter, uint8_t type, if (*record_id != 0) goto add; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (btd_adapter_get_a2dp_role(adapter) == BLUETOOTH_A2DP_SINK_ROLE) - record = a2dp_record(type, true); - else - record = a2dp_record(type, false); -#else record = a2dp_record(type); -#endif if (!record) { error("Unable to allocate new service record"); a2dp_unregister_sep(sep); @@ -1874,17 +1796,8 @@ done: static struct a2dp_sep *a2dp_find_sep(struct avdtp *session, GSList *list, const char *sender) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct a2dp_sep *selected_sep = NULL; -#endif - for (; list; list = list->next) { struct a2dp_sep *sep = list->data; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct avdtp_remote_sep *rsep; - struct avdtp_media_codec_capability *cap; - struct avdtp_service_capability *service; -#endif /* Use sender's endpoint if available */ if (sender) { @@ -1898,35 +1811,14 @@ static struct a2dp_sep *a2dp_find_sep(struct avdtp *session, GSList *list, continue; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - rsep = avdtp_find_remote_sep(session, sep->lsep); - if (rsep == NULL) - continue; - - service = avdtp_get_codec(rsep); - cap = (struct avdtp_media_codec_capability *) service->data; - - if (cap->media_codec_type != A2DP_CODEC_VENDOR) { - selected_sep = sep; - continue; - } -#else if (avdtp_find_remote_sep(session, sep->lsep) == NULL) continue; -#endif return sep; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (selected_sep) - return selected_sep; - else - return NULL; -#else return NULL; -#endif } static struct a2dp_sep *a2dp_select_sep(struct avdtp *session, uint8_t type, diff --git a/profiles/audio/a2dp.h b/profiles/audio/a2dp.h old mode 100644 new mode 100755 index 19d1877..2c388bb --- a/profiles/audio/a2dp.h +++ b/profiles/audio/a2dp.h @@ -53,17 +53,14 @@ struct a2dp_endpoint { }; typedef void (*a2dp_discover_cb_t) (struct avdtp *session, GSList *seps, - struct avdtp_error *err, - void *user_data); + int err, void *user_data); typedef void (*a2dp_select_cb_t) (struct avdtp *session, struct a2dp_sep *sep, GSList *caps, void *user_data); typedef void (*a2dp_config_cb_t) (struct avdtp *session, struct a2dp_sep *sep, - struct avdtp_stream *stream, - struct avdtp_error *err, + struct avdtp_stream *stream, int err, void *user_data); -typedef void (*a2dp_stream_cb_t) (struct avdtp *session, - struct avdtp_error *err, +typedef void (*a2dp_stream_cb_t) (struct avdtp *session, int err, void *user_data); struct a2dp_sep *a2dp_add_sep(struct btd_adapter *adapter, uint8_t type, diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c old mode 100644 new mode 100755 index 2a5f464..2a43d32 --- a/profiles/audio/avctp.c +++ b/profiles/audio/avctp.c @@ -293,8 +293,9 @@ static GSList *servers = NULL; static void auth_cb(DBusError *derr, void *user_data); static gboolean process_queue(gpointer user_data); static gboolean avctp_passthrough_rsp(struct avctp *session, uint8_t code, - uint8_t subunit, uint8_t *operands, - size_t operand_count, void *user_data); + uint8_t subunit, uint8_t transaction, + uint8_t *operands, size_t operand_count, + void *user_data); static int send_event(int fd, uint16_t type, uint16_t code, int32_t value) { @@ -320,31 +321,16 @@ static void send_key(int fd, uint16_t key, int pressed) static gboolean auto_release(gpointer user_data) { struct avctp *session = user_data; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint16_t op = session->key.op; -#endif + + session->key.timer = 0; DBG("AV/C: key press timeout"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (op != KEY_FASTFORWARD && op != KEY_REWIND) { - session->key.timer = 0; - send_key(session->uinput, op, 0); - } else { - return TRUE; - } -#else - session->key.timer = 0; send_key(session->uinput, session->key.op, 0); -#endif return FALSE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -extern void avrcp_stop_position_timer(void); -#endif - static void handle_press(struct avctp *session, uint16_t op) { if (session->key.timer > 0) { @@ -353,9 +339,8 @@ static void handle_press(struct avctp *session, uint16_t op) /* Only auto release if keys are different */ if (session->key.op == op) goto done; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + send_key(session->uinput, session->key.op, 0); -#endif } session->key.op = op; @@ -376,9 +361,6 @@ static void handle_release(struct avctp *session, uint16_t op) send_key(session->uinput, op, 0); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -extern void avrcp_stop_position_timer(void); -#endif static size_t handle_panel_passthrough(struct avctp *session, uint8_t transaction, uint8_t *code, @@ -433,13 +415,9 @@ static size_t handle_panel_passthrough(struct avctp *session, break; } - if (pressed) { + if (pressed) handle_press(session, key_map[i].uinput); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (key_map[i].avc == AVC_REWIND) - avrcp_stop_position_timer(); -#endif - } else + else handle_release(session, key_map[i].uinput); break; @@ -729,8 +707,8 @@ static void control_req_destroy(void *data) if (p->err == 0 || req->func == NULL) goto done; - req->func(session, AVC_CTYPE_REJECTED, req->subunit, NULL, 0, - req->user_data); + req->func(session, AVC_CTYPE_REJECTED, req->subunit, p->transaction, + NULL, 0, req->user_data); done: g_free(req->operands); @@ -813,11 +791,7 @@ static gboolean process_queue(void *user_data) return FALSE; chan->p = p; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - p->timeout = g_timeout_add_seconds(5, req_timeout, chan); -#else p->timeout = g_timeout_add_seconds(2, req_timeout, chan); -#endif return FALSE; @@ -856,9 +830,9 @@ static void control_response(struct avctp_channel *control, continue; if (req->func && req->func(control->session, avc->code, - avc->subunit_type, - operands, operand_count, - req->user_data)) + avc->subunit_type, p->transaction, + operands, operand_count, + req->user_data)) return; control->processed = g_slist_remove(control->processed, p); @@ -1394,15 +1368,9 @@ static void avctp_control_confirm(struct avctp *session, GIOChannel *chan, src = btd_adapter_get_address(device_get_adapter(dev)); dst = device_get_address(dev); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - session->auth_id = btd_request_authorization(src, dst, - AVRCP_TARGET_UUID, - auth_cb, session); -#else session->auth_id = btd_request_authorization(src, dst, AVRCP_REMOTE_UUID, auth_cb, session); -#endif if (session->auth_id == 0) goto drop; @@ -1466,16 +1434,6 @@ static void avctp_confirm_cb(GIOChannel *chan, gpointer data) if (!device) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char name[10]; - device_get_name(device, name, sizeof(name)); - DBG("name : %s", name); - if (g_str_equal(name, "PLT_M50")) { - DBG("Don't accept avrcp connection with this headset"); - return; - } -#endif - session = avctp_get_internal(device); if (session == NULL) return; @@ -1732,20 +1690,13 @@ static gboolean repeat_timeout(gpointer user_data) struct avctp *session = user_data; avctp_passthrough_release(session, session->key.op); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY avctp_passthrough_press(session, session->key.op); return TRUE; -#else - return FALSE; -#endif } static void release_pressed(struct avctp *session) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (session->key.op != AVC_FAST_FORWARD && session->key.op != AVC_REWIND) -#endif avctp_passthrough_release(session, session->key.op); if (session->key.timer > 0) @@ -1774,8 +1725,9 @@ static bool set_pressed(struct avctp *session, uint8_t op) } static gboolean avctp_passthrough_rsp(struct avctp *session, uint8_t code, - uint8_t subunit, uint8_t *operands, - size_t operand_count, void *user_data) + uint8_t subunit, uint8_t transaction, + uint8_t *operands, size_t operand_count, + void *user_data) { if (code != AVC_CTYPE_ACCEPTED) return FALSE; @@ -1796,23 +1748,7 @@ int avctp_send_passthrough(struct avctp *session, uint8_t op) return avctp_passthrough_press(session, op); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int avctp_send_release_passthrough(struct avctp *session, uint8_t op) -{ - DBG("+"); - - if (op != AVC_FAST_FORWARD && op != AVC_REWIND) - return FALSE; - /* Auto release if key pressed */ - if (session->key.timer > 0) - g_source_remove(session->key.timer); - session->key.timer = 0; - - DBG("-"); - return avctp_passthrough_release(session, op); -} -#endif int avctp_send_vendordep(struct avctp *session, uint8_t transaction, uint8_t code, uint8_t subunit, uint8_t *operands, size_t operand_count) diff --git a/profiles/audio/avctp.h b/profiles/audio/avctp.h old mode 100644 new mode 100755 index e86e9cc..68a2735 --- a/profiles/audio/avctp.h +++ b/profiles/audio/avctp.h @@ -132,8 +132,9 @@ typedef size_t (*avctp_control_pdu_cb) (struct avctp *session, uint8_t *subunit, uint8_t *operands, size_t operand_count, void *user_data); typedef gboolean (*avctp_rsp_cb) (struct avctp *session, uint8_t code, - uint8_t subunit, uint8_t *operands, - size_t operand_count, void *user_data); + uint8_t subunit, uint8_t transaction, + uint8_t *operands, size_t operand_count, + void *user_data); typedef gboolean (*avctp_browsing_rsp_cb) (struct avctp *session, uint8_t *operands, size_t operand_count, void *user_data); @@ -172,9 +173,6 @@ unsigned int avctp_register_browsing_pdu_handler(struct avctp *session, gboolean avctp_unregister_browsing_pdu_handler(unsigned int id); int avctp_send_passthrough(struct avctp *session, uint8_t op); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int avctp_send_release_passthrough(struct avctp *session, uint8_t op); -#endif int avctp_send_vendordep(struct avctp *session, uint8_t transaction, uint8_t code, uint8_t subunit, uint8_t *operands, size_t operand_count); diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c old mode 100644 new mode 100755 index b689416..4ec9cca --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -41,11 +41,6 @@ #include "lib/sdp_lib.h" #include "lib/uuid.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include -#include -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - #include "btio/btio.h" #include "src/log.h" #include "src/shared/util.h" @@ -53,14 +48,9 @@ #include "src/adapter.h" #include "src/device.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "src/service.h" -#endif - #include "avdtp.h" #include "sink.h" #include "source.h" -#include "../../profile.h" #define AVDTP_PSM 25 @@ -95,11 +85,7 @@ static unsigned int seids; #define AVDTP_MSG_TYPE_ACCEPT 0x02 #define AVDTP_MSG_TYPE_REJECT 0x03 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define REQ_TIMEOUT 10 -#else #define REQ_TIMEOUT 6 -#endif #define ABORT_TIMEOUT 2 #define DISCONNECT_TIMEOUT 1 #define START_TIMEOUT 1 @@ -844,23 +830,13 @@ static void handle_transport_connect(struct avdtp *session, GIOChannel *io, goto proceed; DBG("sk %d, omtu %d, send buffer size %d", sk, omtu, buf_size); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - min_buf_size = omtu * 10; -#else min_buf_size = omtu * 2; -#endif if (buf_size < min_buf_size) { DBG("send buffer size to be increassed to %d", min_buf_size); set_send_buffer_size(sk, min_buf_size); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else { - DBG("send buffer size to be decreassed to %d", - min_buf_size); - set_send_buffer_size(sk, min_buf_size); - } -#endif + proceed: if (!stream->open_acp && sep->cfm && sep->cfm->open) sep->cfm->open(session, sep, stream, NULL, sep->user_data); @@ -964,182 +940,11 @@ static void handle_unanswered_req(struct avdtp *session, pending_req_free(req); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean send_broadcom_a2dp_qos(const bdaddr_t *dst, gboolean qos_high) -{ - int dd; - int err = 0; - struct hci_conn_info_req *cr; - broadcom_qos_cp cp; - - dd = hci_open_dev(0); - - if (dd < 0) - return FALSE; - - cr = g_malloc0(sizeof(*cr) + sizeof(struct hci_conn_info)); - - cr->type = ACL_LINK; - bacpy(&cr->bdaddr, dst); - - err = ioctl(dd, HCIGETCONNINFO, cr); - if (err < 0) { - error("Fail to get HCIGETCOINFO"); - g_free(cr); - hci_close_dev(dd); - return FALSE; - } - - cp.handle = cr->conn_info->handle; - DBG("Handle %d", cp.handle); - g_free(cr); - - if (qos_high) - cp.priority = BRCM_QOS_PRIORITY_HIGH; - else - cp.priority = BRCM_QOS_PRIORITY_NORMAL; - - if (hci_send_cmd(dd, OGF_VENDOR_CMD, BROADCOM_QOS_CMD, - BROADCOM_QOS_CP_SIZE, &cp) < 0) { - hci_close_dev(dd); - return FALSE; - } - DBG("Send Broadcom Qos Patch %s", qos_high ? "High" : "Low"); - - hci_close_dev(dd); - - return TRUE; -} - -#ifdef TIZEN_FEATURE_BLUEZ_SPRD_QOS -static gboolean send_sprd_a2dp_qos(bdaddr_t *dst, gboolean qos_high) -{ - int dd; - int err = 0; - struct hci_conn_info_req *cr; - qos_setup_cp cp; - - dd = hci_open_dev(0); - - cr = g_malloc0(sizeof(*cr) + sizeof(struct hci_conn_info)); - - cr->type = ACL_LINK; - bacpy(&cr->bdaddr, dst); - - err = ioctl(dd, HCIGETCONNINFO, cr); - if (err < 0) { - error("Fail to get HCIGETCOINFO"); - g_free(cr); - hci_close_dev(dd); - return FALSE; - } - - cp.handle = cr->conn_info->handle; - cp.flags = 0x00; - DBG("Handle %d", cp.handle); - g_free(cr); - - if (qos_high) { - cp.qos.service_type = 0x02; - cp.qos.token_rate = 0X000000C8; - cp.qos.peak_bandwidth = 0X000000C8; - cp.qos.latency = 0x00000001; - cp.qos.delay_variation = 0xFFFFFFFF; - } else { - cp.qos.service_type = 0x01; - cp.qos.token_rate = 0X00000000; - cp.qos.peak_bandwidth = 0X00000000; - cp.qos.latency = 0x00000001; - cp.qos.delay_variation = 0xFFFFFFFF; - } - - if (hci_send_cmd(dd, OGF_LINK_POLICY, OCF_QOS_SETUP, - QOS_SETUP_CP_SIZE, &cp) < 0) { - hci_close_dev(dd); - return FALSE; - } - DBG("Send Spreadtrum Qos Patch %s", qos_high ? "High" : "Low"); - - hci_close_dev(dd); - - return TRUE; -} -#endif /* TIZEN_FEATURE_BLUEZ_SPRD_QOS */ - -static gboolean fix_role_to_master(const bdaddr_t *dst, gboolean fix_to_master) -{ - int dd; - int err = 0; - struct hci_conn_info_req *cr; - switch_role_cp sr_cp; - write_link_policy_cp lp_cp; - - dd = hci_open_dev(0); - if (dd < 0) { - error("hci_open_dev is failed"); - return FALSE; - } - - cr = g_malloc0(sizeof(*cr) + sizeof(struct hci_conn_info)); - - cr->type = ACL_LINK; - bacpy(&cr->bdaddr, dst); - err = ioctl(dd, HCIGETCONNINFO, cr); - if (err < 0) { - error("Fail to get HCIGETCOINFO : %d", err); - g_free(cr); - hci_close_dev(dd); - return FALSE; - } - - if (!(cr->conn_info->link_mode & HCI_LM_MASTER) && fix_to_master) { - DBG("Need to role switch"); - - bacpy(&sr_cp.bdaddr, dst); - sr_cp.role = 0x00; /* 0x00 : Master, 0x01 : Slave */ - if (hci_send_cmd(dd, OGF_LINK_POLICY, OCF_SWITCH_ROLE, - SWITCH_ROLE_CP_SIZE, &sr_cp) < 0) { - error("switch role is failed"); - g_free(cr); - hci_close_dev(dd); - return FALSE; - } - } - - lp_cp.handle = cr->conn_info->handle; - DBG("Handle %d", lp_cp.handle); - g_free(cr); - - lp_cp.policy = fix_to_master ? 0x00 : HCI_LP_SNIFF | HCI_LP_RSWITCH; - DBG("Request link policy : 0x%X", lp_cp.policy); - - if (hci_send_cmd(dd, OGF_LINK_POLICY, OCF_WRITE_LINK_POLICY, - WRITE_LINK_POLICY_CP_SIZE, &lp_cp) < 0) { - error("write link policy is failed : %d", lp_cp.policy); - hci_close_dev(dd); - return FALSE; - } - - hci_close_dev(dd); - - return TRUE; -} -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - static void avdtp_sep_set_state(struct avdtp *session, struct avdtp_local_sep *sep, avdtp_state_t state) { struct avdtp_stream *stream = sep->stream; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - const bdaddr_t *dst; -#if defined(TIZEN_FEATURE_BLUEZ_SPRD_QOS) - dst = device_get_address(session->device); -#else - if (TIZEN_FEATURE_BLUEZ_BRCM_QOS || TIZEN_FEATURE_BLUEZ_ROLE_CHANGE) - dst = device_get_address(session->device); -#endif -#endif avdtp_state_t old_state; struct avdtp_error err, *err_ptr = NULL; GSList *l; @@ -1170,38 +975,12 @@ static void avdtp_sep_set_state(struct avdtp *session, break; case AVDTP_STATE_OPEN: stream->starting = FALSE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (TIZEN_FEATURE_BLUEZ_BRCM_QOS) { - send_broadcom_a2dp_qos(dst, FALSE); - } else { -#if defined(TIZEN_FEATURE_BLUEZ_SPRD_QOS) - if (old_state == AVDTP_STATE_STREAMING) - send_sprd_a2dp_qos(dst, FALSE); -#endif - } - if (TIZEN_FEATURE_BLUEZ_ROLE_CHANGE) - fix_role_to_master(dst, FALSE); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - break; case AVDTP_STATE_STREAMING: if (stream->start_timer) { g_source_remove(stream->start_timer); stream->start_timer = 0; } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (TIZEN_FEATURE_BLUEZ_BRCM_QOS) { - send_broadcom_a2dp_qos(dst, TRUE); - } else { -#if defined(TIZEN_FEATURE_BLUEZ_SPRD_QOS) - if (old_state == AVDTP_STATE_OPEN) - send_sprd_a2dp_qos(dst, TRUE); -#endif - } - if (TIZEN_FEATURE_BLUEZ_ROLE_CHANGE) - fix_role_to_master(dst, TRUE); -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ stream->open_acp = FALSE; break; case AVDTP_STATE_CLOSING: @@ -1241,11 +1020,7 @@ static void avdtp_sep_set_state(struct avdtp *session, } } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void finalize_discovery(struct avdtp *session, int err) -#else static void finalize_discovery(struct avdtp *session, int err) -#endif { struct discover_callback *discover = session->discover; struct avdtp_error avdtp_err; @@ -1329,18 +1104,12 @@ static void avdtp_free(void *data) static void connection_lost(struct avdtp *session, int err) { char address[18]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_service *service; -#endif + + session = avdtp_ref(session); ba2str(device_get_address(session->device), address); DBG("Disconnected from %s", address); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - service = btd_device_get_service(session->device, A2DP_SINK_UUID); - if (service) - btd_service_connecting_complete(service, -err); -#endif g_slist_foreach(session->streams, (GFunc) release_stream, session); session->streams = NULL; @@ -1348,51 +1117,14 @@ static void connection_lost(struct avdtp *session, int err) avdtp_set_state(session, AVDTP_SESSION_STATE_DISCONNECTED); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("%p: ref=%d", session, session->ref); - if (err != EIO && session->ref > 0) /* link loss*/ - return; -#else - if (session->ref > 0) - return; -#endif - - avdtp_free(session); + avdtp_unref(session); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean disconnect_acl_timeout(gpointer user_data) -{ - struct btd_device *device = user_data; - - DBG(""); - - btd_device_disconnect(device); - - return FALSE; -} -#endif - static gboolean disconnect_timeout(gpointer user_data) { struct avdtp *session = user_data; struct btd_service *service; gboolean stream_setup; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_device *device = NULL; - struct btd_adapter *adapter = NULL; - const bdaddr_t *bdaddr = NULL; - - DBG(""); -#endif - -/* Fix : REVERSE_INULL */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (session->device == NULL) { - error("session device NOT found"); - return FALSE; - } -#endif session->dc_timer = 0; @@ -1411,83 +1143,19 @@ static gboolean disconnect_timeout(gpointer user_data) return FALSE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (session->device) { - adapter = device_get_adapter(session->device); - bdaddr = device_get_address(session->device); - if (adapter && bdaddr) - device = btd_adapter_find_device(adapter, bdaddr, BDADDR_BREDR); - if (!device) - error("device is NOT found"); - } -#endif - connection_lost(session, ETIMEDOUT); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device) - g_timeout_add(100, - disconnect_acl_timeout, - device); -#endif - return FALSE; } -#if defined TIZEN_FEATURE_BLUEZ_MODIFY -static void set_disconnect_timer_for_sink(struct avdtp *session, gboolean disconn) -{ - char name[6]; - - if (session->dc_timer) - remove_disconnect_timer(session); - - device_get_name(session->device, name, sizeof(name)); - DBG("name : [%s]", name); - if (g_str_equal(name, "VW BT") || g_str_equal(name, "VW MI") || - g_str_equal(name, "Seat ")) { - session->dc_timer = g_timeout_add_seconds(3, disconnect_timeout, - session); - } else if (g_str_equal(name, "CAR M")) { - session->dc_timer = g_timeout_add(200, disconnect_timeout, - session); - } else { - if (disconn == TRUE) - session->dc_timer = g_timeout_add(100, - disconnect_timeout, - session); - else - session->dc_timer = g_timeout_add_seconds(DISCONNECT_TIMEOUT, - disconnect_timeout, - session); - } -} -#endif - static void set_disconnect_timer(struct avdtp *session) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char name[6]; -#endif if (session->dc_timer) remove_disconnect_timer(session); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_get_name(session->device, name, sizeof(name)); - DBG("name : [%s]", name); - if (g_str_equal(name, "VW BT") || g_str_equal(name, "VW MI") || - g_str_equal(name, "Seat ")) { - session->dc_timer = g_timeout_add_seconds(3, disconnect_timeout, - session); - } else if (g_str_equal(name, "CAR M")) { - session->dc_timer = g_timeout_add(200, disconnect_timeout, - session); - } else { - session->dc_timer = g_timeout_add_seconds(DISCONNECT_TIMEOUT, - disconnect_timeout, - session); - } -#endif + session->dc_timer = g_timeout_add_seconds(DISCONNECT_TIMEOUT, + disconnect_timeout, + session); } void avdtp_unref(struct avdtp *session) @@ -1496,24 +1164,24 @@ void avdtp_unref(struct avdtp *session) return; session->ref--; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_adapter *adapter; - adapter = avdtp_get_adapter(session); -#endif DBG("%p: ref=%d", session, session->ref); if (session->ref > 0) return; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY - if (btd_adapter_get_a2dp_role(adapter) == BLUETOOTH_A2DP_SINK_ROLE) - set_disconnect_timer_for_sink(session, TRUE); - else + switch (session->state) { + case AVDTP_SESSION_STATE_CONNECTED: set_disconnect_timer(session); -#else - set_disconnect_timer(session); -#endif + break; + case AVDTP_SESSION_STATE_CONNECTING: + connection_lost(session, ECONNABORTED); + break; + case AVDTP_SESSION_STATE_DISCONNECTED: + default: + avdtp_free(session); + break; + } } struct avdtp *avdtp_ref(struct avdtp *session) @@ -1729,6 +1397,7 @@ static void setconf_cb(struct avdtp *session, struct avdtp_stream *stream, avdtp_send(session, session->in.transaction, AVDTP_MSG_TYPE_REJECT, AVDTP_SET_CONFIGURATION, &rej, sizeof(rej)); + stream_free(stream); return; } @@ -2052,8 +1721,7 @@ static gboolean avdtp_start_cmd(struct avdtp *session, uint8_t transaction, for (i = 0; i < seid_count; i++, seid++) { failed_seid = seid->seid; - sep = find_local_sep_by_seid(session, - req->first_seid.seid); + sep = find_local_sep_by_seid(session, seid->seid); if (!sep || !sep->stream) { err = AVDTP_BAD_ACP_SEID; goto failed; @@ -2164,8 +1832,7 @@ static gboolean avdtp_suspend_cmd(struct avdtp *session, uint8_t transaction, for (i = 0; i < seid_count; i++, seid++) { failed_seid = seid->seid; - sep = find_local_sep_by_seid(session, - req->first_seid.seid); + sep = find_local_sep_by_seid(session, seid->seid); if (!sep || !sep->stream) { err = AVDTP_BAD_ACP_SEID; goto failed; @@ -2496,21 +2163,6 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond, } if (session->in.message_type == AVDTP_MSG_TYPE_COMMAND) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_service *service; - - service = btd_device_get_service(session->device, A2DP_SINK_UUID); - if (service != NULL) { - DBG("A2dp state %d", btd_service_get_state( - btd_device_get_service(session->device, A2DP_SINK_UUID))); - - if (btd_service_get_state(btd_device_get_service(session->device, - A2DP_SINK_UUID)) == BTD_SERVICE_STATE_DISCONNECTING) { - DBG("avdtp:%p , disconnect timer is going on", session); - return FALSE; - } - } -#endif if (!avdtp_parse_cmd(session, session->in.transaction, session->in.signal_id, session->in.buf, @@ -2620,10 +2272,6 @@ static void avdtp_connect_cb(GIOChannel *chan, GError *err, gpointer user_data) struct avdtp *session = user_data; char address[18]; int err_no = EIO; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_adapter *adapter; - adapter = avdtp_get_adapter(session); -#endif if (err) { err_no = err->code; @@ -2672,16 +2320,8 @@ static void avdtp_connect_cb(GIOChannel *chan, GError *err, gpointer user_data) (GIOFunc) session_cb, session, NULL); - if (session->stream_setup) { -#if defined TIZEN_FEATURE_BLUEZ_MODIFY - if (btd_adapter_get_a2dp_role(adapter) == BLUETOOTH_A2DP_SINK_ROLE) - set_disconnect_timer_for_sink(session, FALSE); - else - set_disconnect_timer(session); -#else + if (session->stream_setup) set_disconnect_timer(session); -#endif - } } else if (session->pending_open) handle_transport_connect(session, chan, session->imtu, session->omtu); @@ -2745,26 +2385,10 @@ static GIOChannel *l2cap_connect(struct avdtp *session) GError *err = NULL; GIOChannel *io; const bdaddr_t *src; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_adapter *adapter; - adapter = avdtp_get_adapter(session); -#endif src = btd_adapter_get_address(device_get_adapter(session->device)); -#if defined TIZEN_FEATURE_BLUEZ_MODIFY - if (btd_adapter_get_a2dp_role(adapter) == BLUETOOTH_A2DP_SINK_ROLE) { - io = bt_io_connect(avdtp_connect_cb, session, - NULL, &err, - BT_IO_OPT_SOURCE_BDADDR, src, - BT_IO_OPT_DEST_BDADDR, - device_get_address(session->device), - BT_IO_OPT_PSM, AVDTP_PSM, - BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, - BT_IO_OPT_IMTU, 895, - BT_IO_OPT_INVALID); - } else { - io = bt_io_connect(avdtp_connect_cb, session, + io = bt_io_connect(avdtp_connect_cb, session, NULL, &err, BT_IO_OPT_SOURCE_BDADDR, src, BT_IO_OPT_DEST_BDADDR, @@ -2772,18 +2396,6 @@ static GIOChannel *l2cap_connect(struct avdtp *session) BT_IO_OPT_PSM, AVDTP_PSM, BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, BT_IO_OPT_INVALID); - } -#else - io = bt_io_connect(avdtp_connect_cb, session, - NULL, &err, - BT_IO_OPT_SOURCE_BDADDR, src, - BT_IO_OPT_DEST_BDADDR, - device_get_address(session->device), - BT_IO_OPT_PSM, AVDTP_PSM, - BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, - BT_IO_OPT_INVALID); -#endif - if (!io) { error("%s", err->message); g_error_free(err); @@ -3170,12 +2782,6 @@ static gboolean avdtp_abort_resp(struct avdtp *session, struct seid_rej *resp, int size) { struct avdtp_local_sep *sep = stream->lsep; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!sep) { - error("Error in getting sep"); - return FALSE; - } -#endif avdtp_sep_set_state(session, sep, AVDTP_STATE_ABORTING); @@ -3797,44 +3403,11 @@ int avdtp_start(struct avdtp *session, struct avdtp_stream *stream) /* If timer already active wait it */ if (stream->start_timer) return 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else { - char address[18]; - uint32_t timeout_sec = START_TIMEOUT; - - ba2str(device_get_address(session->device), address); - /* For Bose headset (Bose AE2w) 2 seconds timeout is required to avoid AVDTP ABORT_CMD */ - if (!strncasecmp(address, "00:0C:8A", 8)) - timeout_sec = 2; - /* For Gear Circle, HS3000 headset, this headset doesn't initiate start command and - * when we add timer for 1 second so idle may trigger callback after 1.2 sec or - * 1.5 sec. So, don't timer for this headset.*/ - if (!strncasecmp(address, "10:92:66", 8) || - !strncasecmp(address, "A8:9F:BA", 8) || - !strncasecmp(address, "00:26:B4", 8)) { - start_timeout(stream); - return 0; - } - /* Here we can't use Mac address as there are changing so check for name */ - char name[10]; - device_get_name(session->device, name, sizeof(name)); - DBG("name : %s", name); - if (g_str_equal(name, "HS3000")) { - start_timeout(stream); - return 0; - } - stream->start_timer = g_timeout_add_seconds(timeout_sec, - start_timeout, - stream); - return 0; - } -#else stream->start_timer = g_timeout_add_seconds(START_TIMEOUT, start_timeout, stream); return 0; -#endif } if (stream->close_int == TRUE) { @@ -3914,7 +3487,7 @@ int avdtp_abort(struct avdtp *session, struct avdtp_stream *stream) if (!stream && session->discover) { /* Don't call cb since it being aborted */ session->discover->cb = NULL; - finalize_discovery(session, -ECANCELED); + finalize_discovery(session, ECANCELED); return -EALREADY; } diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h old mode 100644 new mode 100755 index 54591aa..621a6e3 --- a/profiles/audio/avdtp.h +++ b/profiles/audio/avdtp.h @@ -230,10 +230,6 @@ int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb, gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void finalize_discovery(struct avdtp *session, int err); -#endif - unsigned int avdtp_stream_add_cb(struct avdtp *session, struct avdtp_stream *stream, avdtp_stream_state_cb cb, void *data); diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c old mode 100644 new mode 100755 index 4917a54..51a89b1 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -137,13 +137,9 @@ #define AVRCP_CHARSET_UTF8 106 #define AVRCP_BROWSING_TIMEOUT 1 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define AVRCP_CT_VERSION 0x0103 -#define AVRCP_TG_VERSION 0x0103 -#else #define AVRCP_CT_VERSION 0x0106 #define AVRCP_TG_VERSION 0x0105 -#endif + #define AVRCP_SCOPE_MEDIA_PLAYER_LIST 0x00 #define AVRCP_SCOPE_MEDIA_PLAYER_VFS 0x01 #define AVRCP_SCOPE_SEARCH 0x02 @@ -279,9 +275,6 @@ struct avrcp { uint8_t transaction; uint8_t transaction_events[AVRCP_EVENT_LAST + 1]; struct pending_pdu *pending_pdu; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint32_t playback_status_id; -#endif }; struct passthrough_handler { @@ -299,15 +292,6 @@ struct control_pdu_handler { static GSList *servers = NULL; static unsigned int avctp_id = 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_TARGET -static uint16_t adapter_avrcp_tg_ver = 0; -#endif -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_CONTROL -static uint16_t adapter_avrcp_ct_ver = 0; -#endif -#endif - /* Default feature bit mask for media player as per avctp.c:key_map */ static const uint8_t features[16] = { 0xF8, 0xBF, 0xFF, 0xBF, 0x1F, @@ -322,13 +306,6 @@ static uint32_t company_ids[] = { static void avrcp_register_notification(struct avrcp *session, uint8_t event); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static GList *player_list_settings(struct avrcp_player *player); -void avrcp_stop_position_timer(void); -unsigned int pos_timer_id = 0; -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_CONTROL static sdp_record_t *avrcp_ct_record(void) { sdp_list_t *svclass_id, *pfseq, *apseq, *apseq1, *root; @@ -338,23 +315,12 @@ static sdp_record_t *avrcp_ct_record(void) sdp_record_t *record; sdp_data_t *psm[2], *version, *features; uint16_t lp = AVCTP_CONTROL_PSM, ap = AVCTP_BROWSING_PSM; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint16_t avctp_ver = 0x0104; - uint16_t feat = 0; -#ifdef ENABLE_AVRCP_CATEGORY1 - feat = AVRCP_FEATURE_CATEGORY_1; -#endif -#ifdef ENABLE_AVRCP_CATEGORY2 - feat = feat | AVRCP_FEATURE_CATEGORY_2; -#endif -#else uint16_t avctp_ver = 0x0103; uint16_t feat = ( AVRCP_FEATURE_CATEGORY_1 | AVRCP_FEATURE_CATEGORY_2 | AVRCP_FEATURE_CATEGORY_3 | AVRCP_FEATURE_CATEGORY_4 | AVRCP_FEATURE_BROWSING); -#endif record = sdp_record_alloc(); if (!record) @@ -405,9 +371,6 @@ static sdp_record_t *avrcp_ct_record(void) /* Bluetooth Profile Descriptor List */ sdp_uuid16_create(&profile[0].uuid, AV_REMOTE_PROFILE_ID); profile[0].version = AVRCP_CT_VERSION; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter_avrcp_ct_ver = AVRCP_CT_VERSION; -#endif pfseq = sdp_list_append(NULL, &profile[0]); sdp_set_profile_descs(record, pfseq); @@ -433,9 +396,7 @@ static sdp_record_t *avrcp_ct_record(void) return record; } -#endif -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_TARGET static sdp_record_t *avrcp_tg_record(void) { sdp_list_t *svclass_id, *pfseq, *apseq, *root, *apseq_browsing; @@ -444,23 +405,9 @@ static sdp_record_t *avrcp_tg_record(void) sdp_list_t *aproto_control, *proto_control[2]; sdp_record_t *record; sdp_data_t *psm_control, *version, *features, *psm_browsing; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - sdp_list_t *aproto_browsing; -#endif - sdp_list_t *proto_browsing[2] = {0}; + sdp_list_t *aproto_browsing, *proto_browsing[2] = {0}; uint16_t lp = AVCTP_CONTROL_PSM; uint16_t lp_browsing = AVCTP_BROWSING_PSM; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint16_t avctp_ver = 0x0104; - uint16_t feat = 0; -#ifdef ENABLE_AVRCP_CATEGORY1 - feat = AVRCP_FEATURE_CATEGORY_1 | - AVRCP_FEATURE_PLAYER_SETTINGS; -#endif -#ifdef ENABLE_AVRCP_CATEGORY2 - feat = feat | AVRCP_FEATURE_CATEGORY_2; -#endif -#else uint16_t avctp_ver = 0x0103; uint16_t feat = ( AVRCP_FEATURE_CATEGORY_1 | AVRCP_FEATURE_CATEGORY_2 | @@ -468,7 +415,7 @@ static sdp_record_t *avrcp_tg_record(void) AVRCP_FEATURE_CATEGORY_4 | AVRCP_FEATURE_BROWSING | AVRCP_FEATURE_PLAYER_SETTINGS ); -#endif + record = sdp_record_alloc(); if (!record) return NULL; @@ -506,17 +453,12 @@ static sdp_record_t *avrcp_tg_record(void) proto_browsing[1] = sdp_list_append(proto_browsing[1], version); apseq_browsing = sdp_list_append(apseq_browsing, proto_browsing[1]); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY aproto_browsing = sdp_list_append(NULL, apseq_browsing); sdp_set_add_access_protos(record, aproto_browsing); -#endif /* Bluetooth Profile Descriptor List */ sdp_uuid16_create(&profile[0].uuid, AV_REMOTE_PROFILE_ID); profile[0].version = AVRCP_TG_VERSION; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter_avrcp_tg_ver = AVRCP_TG_VERSION; -#endif pfseq = sdp_list_append(NULL, &profile[0]); sdp_set_profile_descs(record, pfseq); @@ -529,9 +471,7 @@ static sdp_record_t *avrcp_tg_record(void) sdp_list_free(proto_browsing[0], NULL); sdp_list_free(proto_browsing[1], NULL); sdp_list_free(apseq_browsing, NULL); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY sdp_list_free(aproto_browsing, NULL); -#endif free(psm_control); free(version); @@ -545,7 +485,6 @@ static sdp_record_t *avrcp_tg_record(void) return record; } -#endif static unsigned int attr_get_max_val(uint8_t attr) { @@ -553,17 +492,9 @@ static unsigned int attr_get_max_val(uint8_t attr) case AVRCP_ATTRIBUTE_EQUALIZER: return AVRCP_EQUALIZER_ON; case AVRCP_ATTRIBUTE_REPEAT_MODE: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - return AVRCP_REPEAT_MODE_ALL; -#else return AVRCP_REPEAT_MODE_GROUP; -#endif case AVRCP_ATTRIBUTE_SHUFFLE: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - return AVRCP_SHUFFLE_ALL; -#else return AVRCP_SHUFFLE_GROUP; -#endif case AVRCP_ATTRIBUTE_SCAN: return AVRCP_SCAN_GROUP; } @@ -742,10 +673,6 @@ void avrcp_player_event(struct avrcp_player *player, uint8_t id, GSList *l; int attr; int val; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint32_t *position_val = NULL; - GList *settings; -#endif if (player->sessions == NULL) return; @@ -785,24 +712,6 @@ void avrcp_player_event(struct avrcp_player *player, uint8_t id, break; case AVRCP_EVENT_SETTINGS_CHANGED: size = 2; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - settings = player_list_settings(player); - pdu->params[1] = g_list_length(settings); - for (; settings; settings = settings->next) { - const char *key = settings->data; - - attr = attr_to_val(key); - if (attr < 0) - continue; - - val = player_get_setting(player, attr); - if (val < 0) - continue; - - pdu->params[size++] = attr; - pdu->params[size++] = val; - } -#else pdu->params[1] = 1; attr = attr_to_val(data); @@ -815,19 +724,7 @@ void avrcp_player_event(struct avrcp_player *player, uint8_t id, pdu->params[size++] = attr; pdu->params[size++] = val; -#endif /* __TIZEN__PATCH__ */ break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case AVRCP_EVENT_PLAYBACK_POS_CHANGED: - size = 5; - position_val = (uint32_t *) data; - *position_val = (*position_val & 0x000000ff) << 24 | - (*position_val & 0x0000ff00) << 8 | - (*position_val & 0x00ff0000) >> 8 | - (*position_val & 0xff000000) >> 24; - memcpy(&pdu->params[1], position_val, sizeof(uint32_t)); - break; -#endif case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: size = 5; memcpy(&pdu->params[1], &player->id, sizeof(uint16_t)); @@ -843,17 +740,6 @@ void avrcp_player_event(struct avrcp_player *player, uint8_t id, done: pdu->params_len = htons(size); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (id == AVRCP_EVENT_PLAYBACK_POS_CHANGED && - pos_timer_id > 0) { - /* Remove the timer function which was added for register notification. - * As we are sending changed event eariler then time interval. - */ - DBG("Removing the timer function added by register notification"); - g_source_remove(pos_timer_id); - pos_timer_id = 0; - } -#endif for (l = player->sessions; l; l = l->next) { struct avrcp *session = l->data; @@ -1034,10 +920,8 @@ static const char *attrval_to_str(uint8_t attr, uint8_t value) return "singletrack"; case AVRCP_REPEAT_MODE_ALL: return "alltracks"; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY case AVRCP_REPEAT_MODE_GROUP: return "group"; -#endif } break; @@ -1049,10 +933,8 @@ static const char *attrval_to_str(uint8_t attr, uint8_t value) return "off"; case AVRCP_SCAN_ALL: return "alltracks"; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY case AVRCP_SCAN_GROUP: return "group"; -#endif } break; @@ -1544,16 +1426,6 @@ static GList *player_list_settings(struct avrcp_player *player) return player->cb->list_settings(player->user_data); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static uint32_t player_get_playback_position(struct avrcp_player *player) -{ - if (player == NULL) - return UINT32_MAX; - - return player->cb->get_position(player->user_data); -} -#endif - static bool avrcp_handle_play(struct avrcp *session) { struct avrcp_player *player = target_get_player(session); @@ -1635,33 +1507,6 @@ static bool handle_passthrough(struct avctp *conn, uint8_t op, bool pressed, return handler->func(session); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void avrcp_stop_position_timer(void) -{ - if (pos_timer_id > 0) { - DBG("Removing position timer id"); - g_source_remove(pos_timer_id); - pos_timer_id = 0; - } -} -gboolean send_playback_position_event(gpointer user_data) -{ - struct avrcp_player *player = user_data; - uint32_t playback_position; - uint8_t play_status; - - play_status = player_get_status(player); - if (play_status != AVRCP_PLAY_STATUS_PLAYING) - return FALSE; - - playback_position = player_get_playback_position(player); - pos_timer_id = 0; - avrcp_player_event(player, AVRCP_EVENT_PLAYBACK_POS_CHANGED, - &playback_position); - return FALSE; -} -#endif - static uint8_t avrcp_handle_register_notification(struct avrcp *session, struct avrcp_header *pdu, uint8_t transaction) @@ -1670,11 +1515,6 @@ static uint8_t avrcp_handle_register_notification(struct avrcp *session, struct btd_device *dev = session->dev; uint16_t len = ntohs(pdu->params_len); uint64_t uid; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint32_t playback_interval; - uint32_t playback_position; - uint8_t play_status; -#endif GList *settings; /* @@ -1746,40 +1586,6 @@ static uint8_t avrcp_handle_register_notification(struct avrcp *session, len = 2; break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case AVRCP_EVENT_PLAYBACK_POS_CHANGED: - len = 5; - - /* time interval in seconds at which the change in playback position - shall be notified */ - memcpy(&playback_interval, &pdu->params[1], sizeof(uint32_t)); - playback_interval = ((playback_interval>>24)&0xff) | - ((playback_interval<<8)&0xff0000) | - ((playback_interval>>8)&0xff00) | - ((playback_interval<<24)&0xff000000); - - play_status = player_get_status(player); - - if (play_status != AVRCP_PLAY_STATUS_PLAYING) { - DBG("Play Pos Changed Event is skipped(%d)", play_status); - } else { - DBG("Playback interval : %d secs", playback_interval); - pos_timer_id = g_timeout_add_seconds( - playback_interval, - send_playback_position_event, player); - } - - /* retrieve current playback position for interim response */ - playback_position = player_get_playback_position(player); - playback_position = (playback_position & 0x000000ff) << 24 | - (playback_position & 0x0000ff00) << 8 | - (playback_position & 0x00ff0000) >> 8 | - (playback_position & 0xff000000) >> 24; - memcpy(&pdu->params[1], &playback_position, sizeof(uint32_t)); - - break; -#endif - default: /* All other events are not supported yet */ goto err; @@ -1876,7 +1682,6 @@ static uint8_t avrcp_handle_set_absolute_volume(struct avrcp *session, if (len != 1) goto err; - volume = pdu->params[0] & 0x7F; media_transport_update_device_volume(session->dev, volume); @@ -2271,8 +2076,8 @@ static const char *status_to_string(uint8_t status) } } -static gboolean avrcp_get_play_status_rsp(struct avctp *conn, - uint8_t code, uint8_t subunit, +static gboolean avrcp_get_play_status_rsp(struct avctp *conn, uint8_t code, + uint8_t subunit, uint8_t transaction, uint8_t *operands, size_t operand_count, void *user_data) { @@ -2335,8 +2140,8 @@ static const char *status_to_str(uint8_t status) } } -static gboolean avrcp_player_value_rsp(struct avctp *conn, - uint8_t code, uint8_t subunit, +static gboolean avrcp_player_value_rsp(struct avctp *conn, uint8_t code, + uint8_t subunit, uint8_t transaction, uint8_t *operands, size_t operand_count, void *user_data) { @@ -2405,8 +2210,8 @@ static void avrcp_get_current_player_value(struct avrcp *session, static gboolean avrcp_list_player_attributes_rsp(struct avctp *conn, uint8_t code, uint8_t subunit, - uint8_t *operands, size_t operand_count, - void *user_data) + uint8_t transaction, uint8_t *operands, + size_t operand_count, void *user_data) { uint8_t attrs[AVRCP_ATTRIBUTE_LAST]; struct avrcp *session = user_data; @@ -2492,6 +2297,7 @@ static void avrcp_parse_attribute_list(struct avrcp_player *player, static gboolean avrcp_get_element_attributes_rsp(struct avctp *conn, uint8_t code, uint8_t subunit, + uint8_t transaction, uint8_t *operands, size_t operand_count, void *user_data) @@ -2850,8 +2656,10 @@ static gboolean avrcp_set_browsed_player_rsp(struct avctp *conn, uint8_t len; len = pdu->params[i++]; + if (!len) + continue; - if (i + len > operand_count || len == 0) { + if (i + len > operand_count) { error("Invalid folder length"); break; } @@ -2985,6 +2793,83 @@ static void avrcp_set_player_value(struct avrcp *session, uint8_t attr, avrcp_player_value_rsp, session); } +static gboolean avrcp_set_addressed_player_rsp(struct avctp *conn, uint8_t code, + uint8_t subunit, uint8_t transaction, + uint8_t *operands, size_t operand_count, + void *user_data) +{ + struct avrcp *session = user_data; + struct avrcp_player *player = session->controller->player; + struct avrcp_header *pdu = (void *) operands; + + if (!pdu || code != AVC_CTYPE_ACCEPTED) + return FALSE; + + player->addressed = true; + + return FALSE; +} + +static void avrcp_set_addressed_player(struct avrcp *session, + struct avrcp_player *player) +{ + uint8_t buf[AVRCP_HEADER_LENGTH + 2]; + struct avrcp_header *pdu = (void *) buf; + uint16_t id; + + memset(buf, 0, sizeof(buf)); + + set_company_id(pdu->company_id, IEEEID_BTSIG); + pdu->pdu_id = AVRCP_SET_ADDRESSED_PLAYER; + pdu->packet_type = AVRCP_PACKET_TYPE_SINGLE; + id = htons(player->id); + memcpy(pdu->params, &id, 2); + pdu->params_len = htons(2); + + avctp_send_vendordep_req(session->conn, AVC_CTYPE_CONTROL, + AVC_SUBUNIT_PANEL, buf, sizeof(buf), + avrcp_set_addressed_player_rsp, + session); +} + +static void set_addressed_player(struct avrcp *session, + struct avrcp_player *player) +{ + if (!player || !player->id || player->addressed || + session->controller->version < 0x0104) + return; + + /* Set player as addressed */ + avrcp_set_addressed_player(session, player); +} + +static void set_browsed_player(struct avrcp *session, + struct avrcp_player *player) +{ + if (!player || !player->id || player->browsed) + return; + + if (media_player_get_browsable(player->user_data)) + avrcp_set_browsed_player(session, player); +} + +static void set_ct_player(struct avrcp *session, struct avrcp_player *player) +{ + struct btd_service *service; + + if (session->controller->player == player) + goto done; + + session->controller->player = player; + service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID); + control_set_player(service, player ? + media_player_get_path(player->user_data) : NULL); + +done: + set_addressed_player(session, player); + set_browsed_player(session, player); +} + static bool ct_set_setting(struct media_player *mp, const char *key, const char *value, void *user_data) { @@ -3000,6 +2885,8 @@ static bool ct_set_setting(struct media_player *mp, const char *key, if (session->controller->version < 0x0103) return false; + set_ct_player(session, player); + attr = attr_to_val(key); if (attr < 0) return false; @@ -3022,31 +2909,15 @@ static int ct_press(struct avrcp_player *player, uint8_t op) if (session == NULL) return -ENOTCONN; + set_ct_player(session, player); + err = avctp_send_passthrough(session->conn, op); if (err < 0) return err; return 0; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int ct_release(struct avrcp_player *player, uint8_t op) -{ - DBG("+"); - int err; - struct avrcp *session; - session = player->sessions->data; - if (session == NULL) - return -ENOTCONN; - - err = avctp_send_release_passthrough(session->conn, op); - if (err < 0) - return err; - - DBG("-"); - return 0; -} -#endif static int ct_play(struct media_player *mp, void *user_data) { struct avrcp_player *player = user_data; @@ -3081,43 +2952,7 @@ static int ct_previous(struct media_player *mp, void *user_data) return ct_press(player, AVC_BACKWARD); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int ct_press_fast_forward(struct media_player *mp, void *user_data) -{ - DBG("+"); - struct avrcp_player *player = user_data; - - DBG("-"); - return ct_press(player, AVC_FAST_FORWARD); -} - -static int ct_release_fast_forward(struct media_player *mp, void *user_data) -{ - DBG("+"); - struct avrcp_player *player = user_data; - - DBG("-"); - return ct_release(player, AVC_FAST_FORWARD); -} -static int ct_press_rewind(struct media_player *mp, void *user_data) -{ - DBG("+"); - struct avrcp_player *player = user_data; - - DBG("-"); - return ct_press(player, AVC_REWIND); -} - -static int ct_release_rewind(struct media_player *mp, void *user_data) -{ - DBG("+"); - struct avrcp_player *player = user_data; - - DBG("-"); - return ct_release(player, AVC_REWIND); -} -#else static int ct_fast_forward(struct media_player *mp, void *user_data) { struct avrcp_player *player = user_data; @@ -3131,7 +2966,7 @@ static int ct_rewind(struct media_player *mp, void *user_data) return ct_press(player, AVC_REWIND); } -#endif + static int ct_list_items(struct media_player *mp, const char *name, uint32_t start, uint32_t end, void *user_data) { @@ -3144,6 +2979,8 @@ static int ct_list_items(struct media_player *mp, const char *name, session = player->sessions->data; + set_ct_player(session, player); + if (g_str_has_prefix(name, "/NowPlaying")) player->scope = 0x03; else if (g_str_has_suffix(name, "/search")) @@ -3188,6 +3025,7 @@ static int ct_change_folder(struct media_player *mp, const char *path, uint8_t direction; session = player->sessions->data; + set_ct_player(session, player); player->change_path = g_strdup(path); direction = g_str_has_prefix(path, player->path) ? 0x01 : 0x00; @@ -3254,6 +3092,7 @@ static int ct_search(struct media_player *mp, const char *string, session = player->sessions->data; + set_ct_player(session, player); avrcp_search(session, string); return 0; @@ -3294,9 +3133,12 @@ static int ct_play_item(struct media_player *mp, const char *name, return -EBUSY; session = player->sessions->data; + set_ct_player(session, player); if (g_strrstr(name, "/NowPlaying")) player->scope = 0x03; + else if (g_strrstr(name, "/Search")) + player->scope = 0x02; else player->scope = 0x01; @@ -3346,6 +3188,7 @@ static int ct_add_to_nowplaying(struct media_player *mp, const char *name, else player->scope = 0x01; + set_ct_player(session, player); avrcp_add_to_nowplaying(session, uid); return 0; @@ -3359,7 +3202,7 @@ static gboolean avrcp_get_total_numberofitems_rsp(struct avctp *conn, struct avrcp *session = user_data; struct avrcp_player *player = session->controller->player; struct media_player *mp = player->user_data; - uint32_t num_of_items; + uint32_t num_of_items = 0; if (pdu == NULL) return -ETIMEDOUT; @@ -3405,6 +3248,7 @@ static int ct_get_total_numberofitems(struct media_player *mp, const char *name, struct avrcp *session; session = player->sessions->data; + set_ct_player(session, player); if (session->controller->version != 0x0106) { error("version not supported"); @@ -3430,15 +3274,8 @@ static const struct media_player_callback ct_cbs = { .stop = ct_stop, .next = ct_next, .previous = ct_previous, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - .press_fast_forward = ct_press_fast_forward, - .release_fast_forward = ct_release_fast_forward, - .press_rewind = ct_press_rewind, - .release_rewind = ct_release_rewind, -#else .fast_forward = ct_fast_forward, .rewind = ct_rewind, -#endif .list_items = ct_list_items, .change_folder = ct_change_folder, .search = ct_search, @@ -3447,15 +3284,6 @@ static const struct media_player_callback ct_cbs = { .total_items = ct_get_total_numberofitems, }; -static void set_ct_player(struct avrcp *session, struct avrcp_player *player) -{ - struct btd_service *service; - - session->controller->player = player; - service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID); - control_set_player(service, media_player_get_path(player->user_data)); -} - static struct avrcp_player *create_ct_player(struct avrcp *session, uint16_t id) { @@ -3464,6 +3292,7 @@ static struct avrcp_player *create_ct_player(struct avrcp *session, const char *path; player = g_new0(struct avrcp_player, 1); + player->id = id; player->sessions = g_slist_prepend(player->sessions, session); path = device_get_path(session->dev); @@ -3555,8 +3384,8 @@ avrcp_parse_media_player_item(struct avrcp *session, uint8_t *operands, media_player_set_name(mp, name); } - if (session->controller->player == player && !player->browsed) - avrcp_set_browsed_player(session, player); + if (player->addressed) + set_browsed_player(session, player); return player; } @@ -3568,10 +3397,6 @@ static void player_destroy(gpointer data) if (player->destroy) player->destroy(player->user_data); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - avrcp_stop_position_timer(); -#endif - if (player->changed_id > 0) g_source_remove(player->changed_id); @@ -3587,6 +3412,10 @@ static void player_remove(gpointer data) struct avrcp_player *player = data; GSList *l; + /* Don't remove reserved player */ + if (!player->id) + return; + for (l = player->sessions; l; l = l->next) { struct avrcp *session = l->data; struct avrcp_data *controller = session->controller; @@ -3650,6 +3479,10 @@ static gboolean avrcp_get_media_player_list_rsp(struct avctp *conn, g_slist_free_full(removed, player_remove); + /* There should always be an active player */ + if (!session->controller->player) + create_ct_player(session, 0); + return FALSE; } @@ -3771,6 +3604,7 @@ static void avrcp_addressed_player_changed(struct avrcp *session, return; } + player->addressed = true; player->uid_counter = get_be16(&pdu->params[3]); set_ct_player(session, player); @@ -3787,8 +3621,8 @@ static void avrcp_uids_changed(struct avrcp *session, struct avrcp_header *pdu) player->uid_counter = get_be16(&pdu->params[1]); } -static gboolean avrcp_handle_event(struct avctp *conn, - uint8_t code, uint8_t subunit, +static gboolean avrcp_handle_event(struct avctp *conn, uint8_t code, + uint8_t subunit, uint8_t transaction, uint8_t *operands, size_t operand_count, void *user_data) { @@ -3796,16 +3630,30 @@ static gboolean avrcp_handle_event(struct avctp *conn, struct avrcp_header *pdu = (void *) operands; uint8_t event; - if ((code != AVC_CTYPE_INTERIM && code != AVC_CTYPE_CHANGED) || - pdu == NULL) + if (!pdu) return FALSE; + if ((code != AVC_CTYPE_INTERIM && code != AVC_CTYPE_CHANGED)) { + if (pdu->params[0] == AVRCP_STATUS_ADDRESSED_PLAYER_CHANGED && + code == AVC_CTYPE_REJECTED) { + int i; + + /* Lookup event by transaction */ + for (i = 0; i <= AVRCP_EVENT_LAST; i++) { + if (session->transaction_events[i] == + transaction) { + event = i; + goto changed; + } + } + } + return FALSE; + } + event = pdu->params[0]; if (code == AVC_CTYPE_CHANGED) { - session->registered_events ^= (1 << event); - avrcp_register_notification(session, event); - return FALSE; + goto changed; } switch (event) { @@ -3836,8 +3684,15 @@ static gboolean avrcp_handle_event(struct avctp *conn, } session->registered_events |= (1 << event); + session->transaction_events[event] = transaction; return TRUE; + +changed: + session->registered_events ^= (1 << event); + session->transaction_events[event] = 0; + avrcp_register_notification(session, event); + return FALSE; } static void avrcp_register_notification(struct avrcp *session, uint8_t event) @@ -3869,42 +3724,8 @@ static void avrcp_register_notification(struct avrcp *session, uint8_t event) avrcp_handle_event, session); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static char *avrcp_event_to_string(uint8_t event) -{ - - switch (event) { - case AVRCP_EVENT_STATUS_CHANGED: - return "AVRCP EVENT STATUS CHANGED"; - case AVRCP_EVENT_TRACK_CHANGED: - return "AVRCP EVENT TRACK CHANGED"; - case AVRCP_EVENT_SETTINGS_CHANGED: - return "AVRCP EVENT SETTINGS CHANGED"; - case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: - return "AVRCP EVENT ADDRESSED PLAYER CHANGED"; - case AVRCP_EVENT_UIDS_CHANGED: - return "AVRCP EVENT UIDS CHANGED"; - case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED: - return "AVRCP EVENT AVAILABLE PLAYERS CHANGED"; - case AVRCP_EVENT_VOLUME_CHANGED: - return "AVRCP EVENT VOLUME CHANGED"; - default: - return "Unknown Event"; - } -} - -static gboolean avrcp_get_playback_status(gpointer user_data) -{ - struct avrcp *session = user_data; - - avrcp_get_play_status(session); - - return TRUE; -} -#endif - -static gboolean avrcp_get_capabilities_resp(struct avctp *conn, - uint8_t code, uint8_t subunit, +static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t code, + uint8_t subunit, uint8_t transaction, uint8_t *operands, size_t operand_count, void *user_data) { @@ -3930,29 +3751,26 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, uint8_t event = pdu->params[1 + count]; events |= (1 << event); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("Supported Event %s", avrcp_event_to_string(event)); -#endif + switch (event) { case AVRCP_EVENT_STATUS_CHANGED: case AVRCP_EVENT_TRACK_CHANGED: case AVRCP_EVENT_PLAYBACK_POS_CHANGED: case AVRCP_EVENT_SETTINGS_CHANGED: -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: case AVRCP_EVENT_UIDS_CHANGED: case AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED: - /* These events above are controller specific */ - if (!session->controller) + /* These events above requires a player */ + if (!session->controller || + !session->controller->player) break; case AVRCP_EVENT_VOLUME_CHANGED: -#endif avrcp_register_notification(session, event); break; } } - if (!session->controller) + if (!session->controller || !session->controller->player) return FALSE; if (!(events & (1 << AVRCP_EVENT_SETTINGS_CHANGED))) @@ -3963,12 +3781,7 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn, if (!(events & (1 << AVRCP_EVENT_STATUS_CHANGED))) avrcp_get_element_attributes(session); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((events & (1 << AVRCP_EVENT_STATUS_CHANGED)) == 0) { - session->playback_status_id = g_timeout_add_seconds(1, - avrcp_get_playback_status, session); - } -#endif + return FALSE; } @@ -4080,7 +3893,6 @@ static void avrcp_connect_browsing(struct avrcp *session) session); } -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_TARGET static void target_init(struct avrcp *session) { struct avrcp_server *server = session->server; @@ -4107,23 +3919,13 @@ static void target_init(struct avrcp *session) session->supported_events |= (1 << AVRCP_EVENT_STATUS_CHANGED) | (1 << AVRCP_EVENT_TRACK_CHANGED) | -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY (1 << AVRCP_EVENT_TRACK_REACHED_START) | (1 << AVRCP_EVENT_TRACK_REACHED_END) | -#endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - (1 << AVRCP_EVENT_PLAYBACK_POS_CHANGED) | -#endif (1 << AVRCP_EVENT_SETTINGS_CHANGED); if (target->version < 0x0104) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (adapter_avrcp_tg_ver < 0x0104) - return; -#endif - session->supported_events |= (1 << AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED) | (1 << AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED) | @@ -4138,9 +3940,7 @@ static void target_init(struct avrcp *session) avrcp_connect_browsing(session); } -#endif -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_CONTROL static void controller_init(struct avrcp *session) { struct avrcp_player *player; @@ -4155,21 +3955,15 @@ static void controller_init(struct avrcp *session) DBG("%p version 0x%04x", controller, controller->version); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((controller->version >= 0x0104) && (adapter_avrcp_ct_ver >= 0x0104)) - session->supported_events |= (1 << AVRCP_EVENT_VOLUME_CHANGED); -#endif - service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID); btd_service_connecting_complete(service, 0); /* Only create player if category 1 is supported */ - if (!(controller->features & AVRCP_FEATURE_CATEGORY_1)) - return; - - player = create_ct_player(session, 0); - if (player == NULL) - return; + if (controller->features & AVRCP_FEATURE_CATEGORY_1) { + player = create_ct_player(session, 0); + if (player == NULL) + return; + } if (controller->version < 0x0103) return; @@ -4179,17 +3973,11 @@ static void controller_init(struct avrcp *session) if (controller->version < 0x0104) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (adapter_avrcp_ct_ver < 0x0104) - return; -#endif - if (!(controller->features & AVRCP_FEATURE_BROWSING)) return; avrcp_connect_browsing(session); } -#endif static void session_init_control(struct avrcp *session) { @@ -4203,14 +3991,12 @@ static void session_init_control(struct avrcp *session) handle_vendordep_pdu, session); session->control_handlers = control_handlers; -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_CONTROL + if (btd_device_get_service(session->dev, AVRCP_TARGET_UUID) != NULL) controller_init(session); -#endif -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_TARGET + if (btd_device_get_service(session->dev, AVRCP_REMOTE_UUID) != NULL) target_init(session); -#endif } static void controller_destroy(struct avrcp *session) @@ -4244,14 +4030,6 @@ static void session_destroy(struct avrcp *session, int err) server->sessions = g_slist_remove(server->sessions, session); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (session->playback_status_id > 0) { - DBG("Removing the timer for playback status polling"); - g_source_remove(session->playback_status_id); - session->playback_status_id = 0; - } -#endif - session_abort_pending_pdu(session); service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID); @@ -4461,8 +4239,8 @@ void avrcp_unregister_player(struct avrcp_player *player) player_destroy(player); } -static gboolean avrcp_handle_set_volume(struct avctp *conn, - uint8_t code, uint8_t subunit, +static gboolean avrcp_handle_set_volume(struct avctp *conn, uint8_t code, + uint8_t subunit, uint8_t transaction, uint8_t *operands, size_t operand_count, void *user_data) { @@ -4572,19 +4350,9 @@ static int avrcp_connect(struct btd_service *service) { struct btd_device *dev = btd_service_get_device(service); const char *path = device_get_path(dev); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char name[10]; -#endif + DBG("path %s", path); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_get_name(dev, name, sizeof(name)); - DBG("name : %s", name); - if (g_str_equal(name, "PLT_M50")) { - DBG("Don't initiate avrcp connection with this headset"); - return -ENOTSUP; - } -#endif return control_connect(service); } @@ -4612,7 +4380,6 @@ static void avrcp_target_remove(struct btd_service *service) control_unregister(service); } -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_TARGET static void avrcp_target_server_remove(struct btd_profile *p, struct btd_adapter *adapter) { @@ -4632,9 +4399,7 @@ static void avrcp_target_server_remove(struct btd_profile *p, if (server->ct_record_id == 0) avrcp_server_unregister(server); } -#endif -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_TARGET static int avrcp_target_server_probe(struct btd_profile *p, struct btd_adapter *adapter) { @@ -4669,7 +4434,6 @@ done: return 0; } -#endif static struct btd_profile avrcp_target_profile = { .name = "audio-avrcp-target", @@ -4680,10 +4444,9 @@ static struct btd_profile avrcp_target_profile = { .connect = avrcp_connect, .disconnect = avrcp_disconnect, -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_TARGET + .adapter_probe = avrcp_target_server_probe, .adapter_remove = avrcp_target_server_remove, -#endif }; static int avrcp_controller_probe(struct btd_service *service) @@ -4700,7 +4463,6 @@ static void avrcp_controller_remove(struct btd_service *service) control_unregister(service); } -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_CONTROL static void avrcp_controller_server_remove(struct btd_profile *p, struct btd_adapter *adapter) { @@ -4720,9 +4482,7 @@ static void avrcp_controller_server_remove(struct btd_profile *p, if (server->tg_record_id == 0) avrcp_server_unregister(server); } -#endif -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_CONTROL static int avrcp_controller_server_probe(struct btd_profile *p, struct btd_adapter *adapter) { @@ -4757,7 +4517,6 @@ done: return 0; } -#endif static struct btd_profile avrcp_controller_profile = { .name = "avrcp-controller", @@ -4768,10 +4527,9 @@ static struct btd_profile avrcp_controller_profile = { .connect = avrcp_connect, .disconnect = avrcp_disconnect, -#ifdef TIZEN_FEATURE_BLUEZ_AVRCP_CONTROL + .adapter_probe = avrcp_controller_server_probe, .adapter_remove = avrcp_controller_server_remove, -#endif }; static int avrcp_init(void) diff --git a/profiles/audio/avrcp.h b/profiles/audio/avrcp.h old mode 100644 new mode 100755 diff --git a/profiles/audio/control.c b/profiles/audio/control.c old mode 100644 new mode 100755 diff --git a/profiles/audio/control.h b/profiles/audio/control.h old mode 100644 new mode 100755 diff --git a/profiles/audio/media.c b/profiles/audio/media.c old mode 100644 new mode 100755 index c1ada49..23d1561 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -44,10 +44,6 @@ #include "src/dbus-common.h" #include "src/profile.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "src/service.h" -#endif - #include "src/uuid-helper.h" #include "src/log.h" #include "src/error.h" @@ -58,30 +54,13 @@ #include "transport.h" #include "a2dp.h" #include "avrcp.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "sink.h" -#endif - #define MEDIA_INTERFACE "org.bluez.Media1" #define MEDIA_ENDPOINT_INTERFACE "org.bluez.MediaEndpoint1" #define MEDIA_PLAYER_INTERFACE "org.mpris.MediaPlayer2.Player" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define A2DP_SINK_ROLE "sink" -#define A2DP_SOURCE_ROLE "source" -#endif - #define REQUEST_TIMEOUT (3 * 1000) /* 3 seconds */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define SINK_SUSPEND_TIMEOUT 4 /* 4 seconds */ - -unsigned int suspend_timer_id = 0; -static gboolean a2dp_sink_support = false; -static gboolean a2dp_source_support = true; -#endif - struct media_adapter { struct btd_adapter *btd_adapter; GSList *endpoints; /* Endpoints list */ @@ -123,9 +102,6 @@ struct media_player { guint watch; guint properties_watch; guint seek_watch; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - guint sink_watch; -#endif char *status; uint32_t position; uint32_t duration; @@ -141,26 +117,6 @@ struct media_player { static GSList *adapters = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean set_avrcp_status = FALSE; -static gboolean send_track_changed_event = FALSE; - -gboolean current_delay_reporting = false; -struct media_endpoint *source_endpoint = NULL; -struct media_endpoint *sink_endpoint = NULL; - -static int media_set_sink_callback(struct btd_device *device, - struct media_player *mp); -static void media_sink_state_changed_cb(struct btd_service *service, - sink_state_t old_state, - sink_state_t new_state, - void *user_data); -void media_stop_suspend_timer(void); -struct media_player *media_adapter_get_player(struct media_adapter *adapter); -static struct media_adapter *find_adapter(struct btd_device *device); -static uint32_t get_position(void *user_data); -#endif - static void endpoint_request_free(struct endpoint_request *request) { if (request->call) @@ -243,9 +199,7 @@ static void media_endpoint_remove(struct media_endpoint *endpoint) if (endpoint->sep) { a2dp_remove_sep(endpoint->sep); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY return; -#endif } info("Endpoint unregistered: sender=%s path=%s", endpoint->sender, @@ -274,9 +228,6 @@ static void clear_configuration(struct media_endpoint *endpoint, { DBusMessage *msg; const char *path; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct media_player *mp; -#endif msg = dbus_message_new_method_call(endpoint->sender, endpoint->path, MEDIA_ENDPOINT_INTERFACE, @@ -292,14 +243,6 @@ static void clear_configuration(struct media_endpoint *endpoint, g_dbus_send_message(btd_get_dbus_connection(), msg); done: endpoint->transports = g_slist_remove(endpoint->transports, transport); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((mp = media_adapter_get_player(endpoint->adapter))) - if (mp->sink_watch) { - sink_remove_state_cb(mp->sink_watch); - mp->sink_watch = 0; - } - media_stop_suspend_timer(); -#endif media_transport_destroy(transport); } @@ -462,141 +405,6 @@ static struct media_transport *find_device_transport( return match->data; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct media_player * media_adapter_get_player(struct media_adapter * adapter) -{ - GSList *l; - DBG(" "); - - for (l = adapter->players; l; l = l->next) { - struct media_player *mp = l->data; - if (mp != NULL) - return mp; - } - return NULL; -} - -void media_stop_suspend_timer(void) -{ - if (suspend_timer_id > 0) { - DBG("Removing sink suspend timer"); - g_source_remove(suspend_timer_id); - suspend_timer_id = 0; - } -} - -gboolean media_reset_mp_status(gpointer user_data) -{ - struct media_player *mp = user_data; - DBG(" "); - - /* PlayBackStatus already reset; so return */ - if (g_strcmp0(mp->status, "playing") != 0) - return FALSE; - - mp->position = get_position(mp); - g_timer_start(mp->timer); - - g_free(mp->status); - mp->status = g_strdup("paused"); - suspend_timer_id = 0; - avrcp_player_event(mp->player, AVRCP_EVENT_STATUS_CHANGED, mp->status); - - return FALSE; -} - -static void media_sink_state_changed_cb(struct btd_service *service, - sink_state_t old_state, - sink_state_t new_state, - void *user_data) -{ - struct media_player *mp = user_data; - DBG(" "); - - /* Check if A2DP streaming is suspended */ - if ((old_state == SINK_STATE_PLAYING) && - (new_state == SINK_STATE_CONNECTED)) { - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_device *device = btd_service_get_device(service); - char name[20] = {0,}; -#endif - - /* Check AVRCP play back status */ - if (g_strcmp0(mp->status, "playing") != 0) - return; - - media_stop_suspend_timer(); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_get_name(device, name, sizeof(name)); - DBG("Name : %s", name); - - if (g_str_has_prefix(name, "LG HBS") != TRUE) { -#endif - /* PlayBackStatus is still PLAYING; start a timer */ - suspend_timer_id = g_timeout_add_seconds(SINK_SUSPEND_TIMEOUT, - media_reset_mp_status, mp); - DBG("SINK SUSPEND TIMEOUT started"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } -#endif - } - - /* Check if A2DP streaming is started */ - if ((old_state == SINK_STATE_CONNECTED) && - (new_state == SINK_STATE_PLAYING)) { - - struct btd_device *device = btd_service_get_device(service); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char name[20] = {0,}; -#else - char name[20]; -#endif - - media_stop_suspend_timer(); - - /* NULL packet streaming during initial connection */ - if (set_avrcp_status == FALSE) { - set_avrcp_status = TRUE; - return; - } - - /* Check for BMW, Audi, VW car kit */ - device_get_name(device, name, sizeof(name)); - DBG("Name : %s", name); - if ((g_str_has_prefix(name, "BMW") == TRUE) || - (g_str_has_prefix(name, "Audi") == TRUE) || - (g_str_has_prefix(name, "VW BT") == TRUE)) { - - /* Check AVRCP play back status */ - if (g_strcmp0(mp->status, "playing") == 0) - return; - - g_free(mp->status); - mp->status = g_strdup("playing"); - avrcp_player_event(mp->player, - AVRCP_EVENT_STATUS_CHANGED, mp->status); - } - } -} - -static int media_set_sink_callback(struct btd_device *device, - struct media_player *mp) -{ - struct btd_service *service; - DBG(" "); - - service = btd_device_get_service(device, A2DP_SINK_UUID); - if (service == NULL) - return -EINVAL; - - mp->sink_watch = sink_add_state_cb(service, media_sink_state_changed_cb, mp); - - return 0; -} -#endif - struct a2dp_config_data { struct a2dp_setup *setup; a2dp_endpoint_config_t cb; @@ -615,10 +423,6 @@ static gboolean set_configuration(struct media_endpoint *endpoint, const char *path; DBusMessageIter iter; struct media_transport *transport; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct media_adapter *adapter; - struct media_player *mp; -#endif transport = find_device_transport(endpoint, device); @@ -639,13 +443,6 @@ static gboolean set_configuration(struct media_endpoint *endpoint, return FALSE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - set_avrcp_status = FALSE; - adapter = find_adapter(device); - if ((mp = media_adapter_get_player(adapter))) - media_set_sink_callback(device, mp); -#endif - endpoint->transports = g_slist_append(endpoint->transports, transport); dbus_message_iter_init_append(msg, &iter); @@ -737,6 +534,7 @@ static void config_cb(struct media_endpoint *endpoint, void *ret, int size, { struct a2dp_config_data *data = user_data; gboolean *ret_value = ret; + data->cb(data->setup, ret_value ? *ret_value : FALSE); } @@ -802,11 +600,7 @@ static gboolean endpoint_init_a2dp_source(struct media_endpoint *endpoint, endpoint->sep = a2dp_add_sep(endpoint->adapter->btd_adapter, AVDTP_SEP_TYPE_SOURCE, endpoint->codec, delay_reporting, &a2dp_endpoint, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - endpoint, NULL, err); -#else endpoint, a2dp_destroy_endpoint, err); -#endif if (endpoint->sep == NULL) return FALSE; @@ -820,11 +614,7 @@ static gboolean endpoint_init_a2dp_sink(struct media_endpoint *endpoint, endpoint->sep = a2dp_add_sep(endpoint->adapter->btd_adapter, AVDTP_SEP_TYPE_SINK, endpoint->codec, delay_reporting, &a2dp_endpoint, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - endpoint, NULL, err); -#else endpoint, a2dp_destroy_endpoint, err); -#endif if (endpoint->sep == NULL) return FALSE; @@ -954,31 +744,13 @@ static struct media_endpoint *media_endpoint_create(struct media_adapter *adapte endpoint->adapter = adapter; - if (strcasecmp(uuid, A2DP_SOURCE_UUID) == 0) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - source_endpoint = endpoint; - if (btd_adapter_get_a2dp_role(adapter->btd_adapter) == BLUETOOTH_A2DP_SINK_ROLE) - return endpoint; - else - succeeded = endpoint_init_a2dp_source(endpoint, - delay_reporting, err); -#else + if (strcasecmp(uuid, A2DP_SOURCE_UUID) == 0) succeeded = endpoint_init_a2dp_source(endpoint, delay_reporting, err); -#endif - } else if (strcasecmp(uuid, A2DP_SINK_UUID) == 0) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - sink_endpoint = endpoint; - if (btd_adapter_get_a2dp_role(adapter->btd_adapter) == BLUETOOTH_A2DP_SOURCE_ROLE) - return endpoint; - else - succeeded = endpoint_init_a2dp_sink(endpoint, - delay_reporting, err); -#else + else if (strcasecmp(uuid, A2DP_SINK_UUID) == 0) succeeded = endpoint_init_a2dp_sink(endpoint, delay_reporting, err); -#endif - } else if (strcasecmp(uuid, HFP_AG_UUID) == 0 || + else if (strcasecmp(uuid, HFP_AG_UUID) == 0 || strcasecmp(uuid, HSP_AG_UUID) == 0) succeeded = TRUE; else if (strcasecmp(uuid, HFP_HS_UUID) == 0 || @@ -1015,36 +787,6 @@ static struct media_endpoint *media_endpoint_create(struct media_adapter *adapte return endpoint; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int parse_a2dp_uuid(DBusMessageIter *props, const char **uuid) -{ - gboolean has_uuid = FALSE; - - while (dbus_message_iter_get_arg_type(props) == DBUS_TYPE_DICT_ENTRY) { - const char *key; - DBusMessageIter value, entry; - int var; - - dbus_message_iter_recurse(props, &entry); - dbus_message_iter_get_basic(&entry, &key); - - dbus_message_iter_next(&entry); - dbus_message_iter_recurse(&entry, &value); - - var = dbus_message_iter_get_arg_type(&value); - if (strcasecmp(key, "UUID") == 0) { - if (var != DBUS_TYPE_STRING) - return -EINVAL; - dbus_message_iter_get_basic(&value, uuid); - has_uuid = TRUE; - } - dbus_message_iter_next(props); - } - - return has_uuid ? 0 : -EINVAL; -} -#endif - static int parse_properties(DBusMessageIter *props, const char **uuid, gboolean *delay_reporting, uint8_t *codec, uint8_t **capabilities, int *size) @@ -1095,42 +837,6 @@ static int parse_properties(DBusMessageIter *props, const char **uuid, return (has_uuid && has_codec) ? 0 : -EINVAL; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *a2dp_select_role(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct media_adapter *adapter = data; - DBusMessageIter args, props; - const char *a2dp_role; - gboolean ret; - int err; - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &a2dp_role, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (!g_strcmp0(a2dp_role, A2DP_SINK_ROLE)) { - btd_adapter_set_a2dp_role(adapter->btd_adapter, BLUETOOTH_A2DP_SINK_ROLE); - a2dp_remove_sep(source_endpoint->sep); - ret = endpoint_init_a2dp_sink(sink_endpoint, current_delay_reporting, NULL); - if (!ret) - DBG("could not init a2dp sink"); - } else if (!g_strcmp0(a2dp_role, A2DP_SOURCE_ROLE)) { - btd_adapter_set_a2dp_role(adapter->btd_adapter, BLUETOOTH_A2DP_SOURCE_ROLE); - a2dp_remove_sep(sink_endpoint->sep); - ret = endpoint_init_a2dp_source(source_endpoint, current_delay_reporting, NULL); - if (!ret) - DBG("could not init a2dp source"); - } else { - DBG("invalid a2dp role"); - return btd_error_invalid_args(msg); - } - - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} -#endif - static DBusMessage *register_endpoint(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -1142,15 +848,7 @@ static DBusMessage *register_endpoint(DBusConnection *conn, DBusMessage *msg, uint8_t *capabilities; int size = 0; int err; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (btd_adapter_get_a2dp_role(adapter->btd_adapter) == BLUETOOTH_A2DP_SINK_ROLE) { - a2dp_sink_support = true; - a2dp_source_support = false; - } else { - a2dp_sink_support = false; - a2dp_source_support = true; - } -#endif + sender = dbus_message_get_sender(msg); dbus_message_iter_init(msg, &args); @@ -1168,9 +866,7 @@ static DBusMessage *register_endpoint(DBusConnection *conn, DBusMessage *msg, if (parse_properties(&props, &uuid, &delay_reporting, &codec, &capabilities, &size) < 0) return btd_error_invalid_args(msg); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - current_delay_reporting = delay_reporting; -#endif + if (media_endpoint_create(adapter, sender, path, uuid, delay_reporting, codec, capabilities, size, &err) == NULL) { if (err == -EPROTONOSUPPORT) @@ -1265,13 +961,6 @@ static void media_player_free(gpointer data) if (mp->settings) g_hash_table_unref(mp->settings); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - media_stop_suspend_timer(); - - if (mp->sink_watch) - sink_remove_state_cb(mp->sink_watch); -#endif - g_timer_destroy(mp->timer); g_free(mp->sender); g_free(mp->path); @@ -1329,6 +1018,9 @@ static const char *get_player_name(void *user_data) { struct media_player *mp = user_data; + if (!mp->name) + return "Player"; + return mp->name; } @@ -1434,11 +1126,6 @@ static uint64_t get_uid(void *user_data) if (mp->track == NULL) return UINT64_MAX; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!g_hash_table_lookup(mp->track, "Title")) - return UINT64_MAX; -#endif - return 0; } @@ -1617,9 +1304,6 @@ static void media_player_exit(DBusConnection *connection, void *user_data) static gboolean set_status(struct media_player *mp, DBusMessageIter *iter) { const char *value; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint32_t playback_position; -#endif if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING) return FALSE; @@ -1637,49 +1321,26 @@ static gboolean set_status(struct media_player *mp, DBusMessageIter *iter) mp->status = g_strdup(value); avrcp_player_event(mp->player, AVRCP_EVENT_STATUS_CHANGED, mp->status); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (strcasecmp(mp->status, "reverse-seek") != 0 && - strcasecmp(mp->status, "playing") != 0) { - playback_position = get_position(mp); - avrcp_player_event(mp->player, AVRCP_EVENT_PLAYBACK_POS_CHANGED, - &playback_position); - } -#endif return TRUE; } static gboolean set_position(struct media_player *mp, DBusMessageIter *iter) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint32_t value; -#else uint64_t value; const char *status; -#endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint32_t playback_position; -#endif -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INT64) - return FALSE; -#else - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT32) - return FALSE; -#endif + return FALSE; + dbus_message_iter_get_basic(iter, &value); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY value /= 1000; -#endif - DBG("Value %d", value); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + if (value > get_position(mp)) status = "forward-seek"; else status = "reverse-seek"; -#endif mp->position = value; g_timer_start(mp->timer); @@ -1689,12 +1350,6 @@ static gboolean set_position(struct media_player *mp, DBusMessageIter *iter) if (!mp->position) { avrcp_player_event(mp->player, AVRCP_EVENT_TRACK_REACHED_START, NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - playback_position = get_position(mp); - avrcp_player_event(mp->player, AVRCP_EVENT_PLAYBACK_POS_CHANGED, - &playback_position); -#endif - return TRUE; } @@ -1705,23 +1360,11 @@ static gboolean set_position(struct media_player *mp, DBusMessageIter *iter) if (mp->position == UINT32_MAX || mp->position >= mp->duration) { avrcp_player_event(mp->player, AVRCP_EVENT_TRACK_REACHED_END, NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - playback_position = get_position(mp); - avrcp_player_event(mp->player, AVRCP_EVENT_PLAYBACK_POS_CHANGED, - &playback_position); -#endif return TRUE; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY /* Send a status change to force resync the position */ avrcp_player_event(mp->player, AVRCP_EVENT_STATUS_CHANGED, status); -#endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - playback_position = get_position(mp); - avrcp_player_event(mp->player, AVRCP_EVENT_PLAYBACK_POS_CHANGED, - &playback_position); -#endif return TRUE; } @@ -1729,15 +1372,6 @@ static gboolean set_position(struct media_player *mp, DBusMessageIter *iter) static void set_metadata(struct media_player *mp, const char *key, const char *value) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - const char *current_value = NULL; - - current_value = g_hash_table_lookup(mp->track, key); - - if ((g_strcmp0(value, current_value) != 0) && - (send_track_changed_event == FALSE)) - send_track_changed_event = TRUE; -#endif DBG("%s=%s", key, value); g_hash_table_replace(mp->track, g_strdup(key), g_strdup(value)); } @@ -1797,9 +1431,7 @@ static gboolean parse_int64_metadata(struct media_player *mp, const char *key, dbus_message_iter_get_basic(iter, &value); if (strcasecmp(key, "Duration") == 0) { -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY value /= 1000; -#endif mp->duration = value; } @@ -1840,9 +1472,6 @@ static gboolean parse_player_metadata(struct media_player *mp, int ctype; gboolean title = FALSE; uint64_t uid; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint32_t playback_position; -#endif ctype = dbus_message_iter_get_arg_type(iter); if (ctype != DBUS_TYPE_ARRAY) @@ -1850,13 +1479,11 @@ static gboolean parse_player_metadata(struct media_player *mp, dbus_message_iter_recurse(iter, &dict); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (mp->track != NULL) g_hash_table_unref(mp->track); mp->track = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); -#endif while ((ctype = dbus_message_iter_get_arg_type(&dict)) != DBUS_TYPE_INVALID) { @@ -1894,11 +1521,6 @@ static gboolean parse_player_metadata(struct media_player *mp, } else if (strcasecmp(key, "mpris:length") == 0) { if (!parse_int64_metadata(mp, "Duration", &var)) return FALSE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } else if (strcasecmp(key, "xesam:totalTracks") == 0) { - if (!parse_int32_metadata(mp, "NumberOfTracks", &var)) - return FALSE; -#endif } else if (strcasecmp(key, "xesam:trackNumber") == 0) { if (!parse_int32_metadata(mp, "TrackNumber", &var)) return FALSE; @@ -1912,25 +1534,13 @@ static gboolean parse_player_metadata(struct media_player *mp, g_hash_table_insert(mp->track, g_strdup("Title"), g_strdup("")); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (send_track_changed_event) { - uid = get_uid(mp); - avrcp_player_event(mp->player, - AVRCP_EVENT_TRACK_CHANGED, &uid); - send_track_changed_event = FALSE; - - playback_position = get_position(mp); - avrcp_player_event(mp->player, - AVRCP_EVENT_PLAYBACK_POS_CHANGED, &playback_position); - } -#else mp->position = 0; g_timer_start(mp->timer); uid = get_uid(mp); avrcp_player_event(mp->player, AVRCP_EVENT_TRACK_CHANGED, &uid); avrcp_player_event(mp->player, AVRCP_EVENT_TRACK_REACHED_START, NULL); -#endif + return TRUE; } @@ -2181,10 +1791,6 @@ static struct media_player *media_player_create(struct media_adapter *adapter, mp->settings = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - mp->track = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, - g_free); -#endif adapter->players = g_slist_append(adapter->players, mp); @@ -2265,10 +1871,6 @@ static const GDBusMethodTable media_methods[] = { NULL, register_player) }, { GDBUS_METHOD("UnregisterPlayer", GDBUS_ARGS({ "player", "o" }), NULL, unregister_player) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_METHOD("SelectRole", - GDBUS_ARGS({ "role", "s" }), NULL, a2dp_select_role) }, -#endif { }, }; diff --git a/profiles/audio/media.h b/profiles/audio/media.h old mode 100644 new mode 100755 diff --git a/profiles/audio/player.c b/profiles/audio/player.c old mode 100644 new mode 100755 index e39f04a..7944b49 --- a/profiles/audio/player.c +++ b/profiles/audio/player.c @@ -534,83 +534,7 @@ static DBusMessage *media_player_previous(DBusConnection *conn, return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *media_player_press_fast_forward(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - DBG("+"); - struct media_player *mp = data; - struct player_callback *cb = mp->cb; - int err; - - if (cb->cbs->press_fast_forward == NULL) - return btd_error_not_supported(msg); - - err = cb->cbs->press_fast_forward(mp, cb->user_data); - if (err < 0) - return btd_error_failed(msg, strerror(-err)); - - DBG("-"); - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} - -static DBusMessage *media_player_release_fast_forward(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - DBG("+"); - struct media_player *mp = data; - struct player_callback *cb = mp->cb; - int err; - - if (cb->cbs->release_fast_forward == NULL) - return btd_error_not_supported(msg); - - err = cb->cbs->release_fast_forward(mp, cb->user_data); - if (err < 0) - return btd_error_failed(msg, strerror(-err)); - - DBG("-"); - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} - -static DBusMessage *media_player_press_rewind(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - DBG("+"); - struct media_player *mp = data; - struct player_callback *cb = mp->cb; - int err; - - if (cb->cbs->press_rewind == NULL) - return btd_error_not_supported(msg); - err = cb->cbs->press_rewind(mp, cb->user_data); - if (err < 0) - return btd_error_failed(msg, strerror(-err)); - - DBG("-"); - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} - -static DBusMessage *media_player_release_rewind(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - DBG("+"); - struct media_player *mp = data; - struct player_callback *cb = mp->cb; - int err; - - if (cb->cbs->release_rewind == NULL) - return btd_error_not_supported(msg); - - err = cb->cbs->release_rewind(mp, cb->user_data); - if (err < 0) - return btd_error_failed(msg, strerror(-err)); - - DBG("-"); - return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); -} -#else static DBusMessage *media_player_fast_forward(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -644,7 +568,7 @@ static DBusMessage *media_player_rewind(DBusConnection *conn, DBusMessage *msg, return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } -#endif + static void parse_folder_list(gpointer data, gpointer user_data) { struct media_item *item = data; @@ -801,15 +725,8 @@ static const GDBusMethodTable media_player_methods[] = { { GDBUS_METHOD("Stop", NULL, NULL, media_player_stop) }, { GDBUS_METHOD("Next", NULL, NULL, media_player_next) }, { GDBUS_METHOD("Previous", NULL, NULL, media_player_previous) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_METHOD("PressFastForward", NULL, NULL, media_player_press_fast_forward) }, - { GDBUS_METHOD("ReleaseFastForward", NULL, NULL, media_player_release_fast_forward) }, - { GDBUS_METHOD("PressRewind", NULL, NULL, media_player_press_rewind) }, - { GDBUS_METHOD("ReleaseRewind", NULL, NULL, media_player_release_rewind) }, -#else { GDBUS_METHOD("FastForward", NULL, NULL, media_player_fast_forward) }, { GDBUS_METHOD("Rewind", NULL, NULL, media_player_rewind) }, -#endif { } }; @@ -1185,10 +1102,8 @@ static const GDBusMethodTable media_folder_methods[] = { }; static const GDBusPropertyTable media_folder_properties[] = { - { "Name", "s", get_folder_name, NULL, folder_name_exists, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "NumberOfItems", "u", get_items, NULL, items_exists, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Name", "s", get_folder_name, NULL, folder_name_exists }, + { "NumberOfItems", "u", get_items, NULL, items_exists }, { } }; @@ -1413,37 +1328,18 @@ void media_player_set_metadata(struct media_player *mp, struct media_item *item, const char *key, void *data, size_t len) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *value; - char *end, *temp; -#else char *value, *curval; -#endif value = g_strndup(data, len); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - temp = value; - while (g_utf8_validate(temp, -1, (const gchar **)&end) == FALSE) { - temp = g_utf8_find_next_char(end, NULL); - if (temp == NULL) { - *end = '\0'; - break; - } - strcpy(end, temp); - temp = end; - } -#endif - DBG("%s: %s", key, value); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY curval = g_hash_table_lookup(mp->track, key); if (g_strcmp0(curval, value) == 0) { g_free(value); return; } -#endif + if (mp->process_id == 0) { g_hash_table_remove_all(mp->track); mp->process_id = g_idle_add(process_metadata_changed, mp); @@ -1508,9 +1404,14 @@ void media_player_set_browsable(struct media_player *mp, bool enabled) "Browsable"); } +bool media_player_get_browsable(struct media_player *mp) +{ + return mp->browsable; +} + void media_player_set_searchable(struct media_player *mp, bool enabled) { - if (mp->browsable == enabled) + if (mp->searchable == enabled) return; DBG("%s", enabled ? "true" : "false"); @@ -1582,12 +1483,15 @@ static DBusMessage *media_item_play(DBusConnection *conn, DBusMessage *msg, struct media_item *item = data; struct media_player *mp = item->player; struct player_callback *cb = mp->cb; + const char *path; int err; if (!item->playable || !cb->cbs->play_item) return btd_error_not_supported(msg); - err = cb->cbs->play_item(mp, item->path, item->uid, cb->user_data); + path = mp->search && mp->scope == mp->search ? "/Search" : item->path; + + err = cb->cbs->play_item(mp, path, item->uid, cb->user_data); if (err < 0) return btd_error_failed(msg, strerror(-err)); diff --git a/profiles/audio/player.h b/profiles/audio/player.h old mode 100644 new mode 100755 index 280a8ac..54e395a --- a/profiles/audio/player.h +++ b/profiles/audio/player.h @@ -52,15 +52,8 @@ struct media_player_callback { int (*stop) (struct media_player *mp, void *user_data); int (*next) (struct media_player *mp, void *user_data); int (*previous) (struct media_player *mp, void *user_data); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - int (*press_fast_forward) (struct media_player *mp, void *user_data); - int (*release_fast_forward) (struct media_player *mp, void *user_data); - int (*press_rewind) (struct media_player *mp, void *user_data); - int (*release_rewind) (struct media_player *mp, void *user_data); -#else int (*fast_forward) (struct media_player *mp, void *user_data); int (*rewind) (struct media_player *mp, void *user_data); -#endif int (*list_items) (struct media_player *mp, const char *name, uint32_t start, uint32_t end, void *user_data); int (*change_folder) (struct media_player *mp, const char *path, @@ -92,6 +85,7 @@ void media_player_set_type(struct media_player *mp, const char *type); void media_player_set_subtype(struct media_player *mp, const char *subtype); void media_player_set_name(struct media_player *mp, const char *name); void media_player_set_browsable(struct media_player *mp, bool enabled); +bool media_player_get_browsable(struct media_player *mp); void media_player_set_searchable(struct media_player *mp, bool enabled); void media_player_set_folder(struct media_player *mp, const char *path, uint32_t items); diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c old mode 100644 new mode 100755 index 4843bbe..7cac210 --- a/profiles/audio/sink.c +++ b/profiles/audio/sink.c @@ -106,17 +106,9 @@ static void sink_set_state(struct sink *sink, sink_state_t new_state) if (new_state != SINK_STATE_DISCONNECTED) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - btd_service_disconnecting_complete(service, 0); -#endif - if (sink->session) { avdtp_unref(sink->session); sink->session = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - sink->connect_id = 0; - sink->disconnect_id = 0; -#endif } } @@ -156,9 +148,7 @@ static void stream_state_changed(struct avdtp_stream *stream, switch (new_state) { case AVDTP_STATE_IDLE: -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY btd_service_disconnecting_complete(sink->service, 0); -#endif if (sink->disconnect_id > 0) { a2dp_cancel(sink->disconnect_id); @@ -190,8 +180,8 @@ static void stream_state_changed(struct avdtp_stream *stream, } static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, - struct avdtp_stream *stream, - struct avdtp_error *err, void *user_data) + struct avdtp_stream *stream, int err, + void *user_data) { struct sink *sink = user_data; @@ -202,16 +192,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, avdtp_unref(sink->session); sink->session = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (err && avdtp_error_category(err) == AVDTP_ERRNO - && avdtp_error_posix_errno(err) != EHOSTDOWN) -#else - if (avdtp_error_category(err) == AVDTP_ERRNO - && avdtp_error_posix_errno(err) != EHOSTDOWN) -#endif - btd_service_connecting_complete(sink->service, -EAGAIN); - else - btd_service_connecting_complete(sink->service, -EIO); + btd_service_connecting_complete(sink->service, err); } static void select_complete(struct avdtp *session, struct a2dp_sep *sep, @@ -236,25 +217,17 @@ failed: sink->session = NULL; } -static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp_error *err, - void *user_data) +static void discovery_complete(struct avdtp *session, GSList *seps, int err, + void *user_data) { struct sink *sink = user_data; - int id, perr; + int id; sink->connect_id = 0; if (err) { avdtp_unref(sink->session); sink->session = NULL; - - perr = -avdtp_error_posix_errno(err); - if (perr != -EHOSTDOWN) { - if (avdtp_error_category(err) == AVDTP_ERRNO) - perr = -EAGAIN; - else - perr = -EIO; - } goto failed; } @@ -263,7 +236,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp id = a2dp_select_capabilities(sink->session, AVDTP_SEP_TYPE_SINK, NULL, select_complete, sink); if (id == 0) { - perr = -EIO; + err = -EIO; goto failed; } @@ -271,7 +244,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp return; failed: - btd_service_connecting_complete(sink->service, perr); + btd_service_connecting_complete(sink->service, err); avdtp_unref(sink->session); sink->session = NULL; } @@ -301,7 +274,6 @@ int sink_connect(struct btd_service *service) { struct sink *sink = btd_service_get_user_data(service); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (!sink->session) sink->session = a2dp_avdtp_get(btd_service_get_device(service)); @@ -309,7 +281,6 @@ int sink_connect(struct btd_service *service) DBG("Unable to get a session"); return -EIO; } -#endif if (sink->connect_id > 0 || sink->disconnect_id > 0) return -EBUSY; @@ -320,16 +291,6 @@ int sink_connect(struct btd_service *service) if (sink->stream_state >= AVDTP_STATE_OPEN) return -EALREADY; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!sink->session) - sink->session = a2dp_avdtp_get(btd_service_get_device(service)); - - if (!sink->session) { - DBG("Unable to get a session"); - return -EIO; - } -#endif - if (!sink_setup_stream(service, NULL)) { DBG("Failed to create a stream"); return -EIO; @@ -348,16 +309,8 @@ static void sink_free(struct btd_service *service) avdtp_stream_remove_cb(sink->session, sink->stream, sink->cb_id); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (sink->session) { - /* We need to clear the avdtp discovery procedure */ - finalize_discovery(sink->session, ECANCELED); - avdtp_unref(sink->session); - } -#else if (sink->session) avdtp_unref(sink->session); -#endif if (sink->connect_id > 0) { btd_service_connecting_complete(sink->service, -ECANCELED); @@ -443,13 +396,13 @@ int sink_disconnect(struct btd_service *service) /* cancel pending connect */ if (sink->connect_id > 0) { + avdtp_unref(sink->session); + sink->session = NULL; + a2dp_cancel(sink->connect_id); sink->connect_id = 0; btd_service_disconnecting_complete(sink->service, 0); - avdtp_unref(sink->session); - sink->session = NULL; - return 0; } diff --git a/profiles/audio/sink.h b/profiles/audio/sink.h old mode 100644 new mode 100755 diff --git a/profiles/audio/source.c b/profiles/audio/source.c old mode 100644 new mode 100755 index 372b132..4081e19 --- a/profiles/audio/source.c +++ b/profiles/audio/source.c @@ -177,8 +177,8 @@ static void stream_state_changed(struct avdtp_stream *stream, } static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, - struct avdtp_stream *stream, - struct avdtp_error *err, void *user_data) + struct avdtp_stream *stream, int err, + void *user_data) { struct source *source = user_data; @@ -189,11 +189,7 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, avdtp_unref(source->session); source->session = NULL; - if (avdtp_error_category(err) == AVDTP_ERRNO - && avdtp_error_posix_errno(err) != EHOSTDOWN) - btd_service_connecting_complete(source->service, -EAGAIN); - else - btd_service_connecting_complete(source->service, -EIO); + btd_service_connecting_complete(source->service, err); } static void select_complete(struct avdtp *session, struct a2dp_sep *sep, @@ -221,34 +217,26 @@ failed: source->session = NULL; } -static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp_error *err, - void *user_data) +static void discovery_complete(struct avdtp *session, GSList *seps, int err, + void *user_data) { struct source *source = user_data; - int id, perr; + int id; source->connect_id = 0; if (err) { avdtp_unref(source->session); source->session = NULL; - - perr = -avdtp_error_posix_errno(err); - if (perr != -EHOSTDOWN) { - if (avdtp_error_category(err) == AVDTP_ERRNO) - perr = -EAGAIN; - else - perr = -EIO; - } goto failed; } DBG("Discovery complete"); - id = a2dp_select_capabilities(source->session, AVDTP_SEP_TYPE_SOURCE, NULL, - select_complete, source); + id = a2dp_select_capabilities(source->session, AVDTP_SEP_TYPE_SOURCE, + NULL, select_complete, source); if (id == 0) { - perr = -EIO; + err = -EIO; goto failed; } @@ -256,7 +244,7 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp return; failed: - btd_service_connecting_complete(source->service, perr); + btd_service_connecting_complete(source->service, err); avdtp_unref(source->session); source->session = NULL; } @@ -400,13 +388,13 @@ int source_disconnect(struct btd_service *service) /* cancel pending connect */ if (source->connect_id > 0) { + avdtp_unref(source->session); + source->session = NULL; + a2dp_cancel(source->connect_id); source->connect_id = 0; btd_service_disconnecting_complete(source->service, 0); - avdtp_unref(source->session); - source->session = NULL; - return 0; } diff --git a/profiles/audio/source.h b/profiles/audio/source.h old mode 100644 new mode 100755 diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c old mode 100644 new mode 100755 index 4121e52..b9d357e --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -283,8 +283,8 @@ static gboolean media_transport_set_fd(struct media_transport *transport, return TRUE; } -static void a2dp_resume_complete(struct avdtp *session, - struct avdtp_error *err, void *user_data) +static void a2dp_resume_complete(struct avdtp *session, int err, + void *user_data) { struct media_owner *owner = user_data; struct media_request *req = owner->pending; @@ -362,8 +362,8 @@ static guint resume_a2dp(struct media_transport *transport, return id; } -static void a2dp_suspend_complete(struct avdtp *session, - struct avdtp_error *err, void *user_data) +static void a2dp_suspend_complete(struct avdtp *session, int err, + void *user_data) { struct media_owner *owner = user_data; struct media_transport *transport = owner->transport; diff --git a/profiles/audio/transport.h b/profiles/audio/transport.h old mode 100644 new mode 100755 diff --git a/profiles/battery/bas.c b/profiles/battery/bas.c old mode 100644 new mode 100755 diff --git a/profiles/battery/bas.h b/profiles/battery/bas.h old mode 100644 new mode 100755 diff --git a/profiles/cups/cups.h b/profiles/cups/cups.h old mode 100644 new mode 100755 diff --git a/profiles/cups/hcrp.c b/profiles/cups/hcrp.c old mode 100644 new mode 100755 diff --git a/profiles/cups/main.c b/profiles/cups/main.c old mode 100644 new mode 100755 diff --git a/profiles/cups/sdp.c b/profiles/cups/sdp.c old mode 100644 new mode 100755 diff --git a/profiles/cups/spp.c b/profiles/cups/spp.c old mode 100644 new mode 100755 diff --git a/profiles/cyclingspeed/cyclingspeed.c b/profiles/cyclingspeed/cyclingspeed.c deleted file mode 100644 index e447725..0000000 --- a/profiles/cyclingspeed/cyclingspeed.c +++ /dev/null @@ -1,1266 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Tieto Poland - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/plugin.h" -#include "src/adapter.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/service.h" -#include "src/dbus-common.h" -#include "src/shared/util.h" -#include "src/error.h" -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" -#include "src/attio.h" -#include "src/log.h" - -/* min length for ATT indication or notification: opcode (1b) + handle (2b) */ -#define ATT_HDR_LEN 3 - -#define ATT_TIMEOUT 30 - -#define CYCLINGSPEED_INTERFACE "org.bluez.CyclingSpeed1" -#define CYCLINGSPEED_MANAGER_INTERFACE "org.bluez.CyclingSpeedManager1" -#define CYCLINGSPEED_WATCHER_INTERFACE "org.bluez.CyclingSpeedWatcher1" - -#define WHEEL_REV_SUPPORT 0x01 -#define CRANK_REV_SUPPORT 0x02 -#define MULTI_SENSOR_LOC_SUPPORT 0x04 - -#define WHEEL_REV_PRESENT 0x01 -#define CRANK_REV_PRESENT 0x02 - -#define SET_CUMULATIVE_VALUE 0x01 -#define START_SENSOR_CALIBRATION 0x02 -#define UPDATE_SENSOR_LOC 0x03 -#define REQUEST_SUPPORTED_SENSOR_LOC 0x04 -#define RESPONSE_CODE 0x10 - -#define RSP_SUCCESS 0x01 -#define RSP_NOT_SUPPORTED 0x02 -#define RSP_INVALID_PARAM 0x03 -#define RSP_FAILED 0x04 - -struct csc; - -struct controlpoint_req { - struct csc *csc; - uint8_t opcode; - guint timeout; - GDBusPendingReply reply_id; - DBusMessage *msg; - - uint8_t pending_location; -}; - -struct csc_adapter { - struct btd_adapter *adapter; - GSList *devices; /* list of registered devices */ - GSList *watchers; -}; - -struct csc { - struct btd_device *dev; - struct csc_adapter *cadapter; - - GAttrib *attrib; - guint attioid; - /* attio id for measurement characteristics value notifications */ - guint attio_measurement_id; - /* attio id for SC Control Point characteristics value indications */ - guint attio_controlpoint_id; - - struct att_range *svc_range; - - uint16_t measurement_ccc_handle; - uint16_t controlpoint_val_handle; - - uint16_t feature; - gboolean has_location; - uint8_t location; - uint8_t num_locations; - uint8_t *locations; - - struct controlpoint_req *pending_req; -}; - -struct watcher { - struct csc_adapter *cadapter; - guint id; - char *srv; - char *path; -}; - -struct measurement { - struct csc *csc; - - bool has_wheel_rev; - uint32_t wheel_rev; - uint16_t last_wheel_time; - - bool has_crank_rev; - uint16_t crank_rev; - uint16_t last_crank_time; -}; - -struct characteristic { - struct csc *csc; - char uuid[MAX_LEN_UUID_STR + 1]; -}; - -static GSList *csc_adapters = NULL; - -static const char * const location_enum[] = { - "other", "top-of-shoe", "in-shoe", "hip", "front-wheel", "left-crank", - "right-crank", "left-pedal", "right-pedal", "front-hub", - "rear-dropout", "chainstay", "rear-wheel", "rear-hub" -}; - -static const char *location2str(uint8_t value) -{ - if (value < G_N_ELEMENTS(location_enum)) - return location_enum[value]; - - info("Body Sensor Location [%d] is RFU", value); - - return location_enum[0]; -} - -static int str2location(const char *location) -{ - size_t i; - - for (i = 0; i < G_N_ELEMENTS(location_enum); i++) - if (!strcmp(location_enum[i], location)) - return i; - - return -1; -} - -static int cmp_adapter(gconstpointer a, gconstpointer b) -{ - const struct csc_adapter *cadapter = a; - const struct btd_adapter *adapter = b; - - if (adapter == cadapter->adapter) - return 0; - - return -1; -} - -static int cmp_device(gconstpointer a, gconstpointer b) -{ - const struct csc *csc = a; - const struct btd_device *dev = b; - - if (dev == csc->dev) - return 0; - - return -1; -} - -static int cmp_watcher(gconstpointer a, gconstpointer b) -{ - const struct watcher *watcher = a; - const struct watcher *match = b; - int ret; - - ret = g_strcmp0(watcher->srv, match->srv); - if (ret != 0) - return ret; - - return g_strcmp0(watcher->path, match->path); -} - -static struct csc_adapter *find_csc_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(csc_adapters, adapter, cmp_adapter); - - if (!l) - return NULL; - - return l->data; -} - -static void destroy_watcher(gpointer user_data) -{ - struct watcher *watcher = user_data; - - g_free(watcher->path); - g_free(watcher->srv); - g_free(watcher); -} - -static struct watcher *find_watcher(GSList *list, const char *sender, - const char *path) -{ - struct watcher *match; - GSList *l; - - match = g_new0(struct watcher, 1); - match->srv = g_strdup(sender); - match->path = g_strdup(path); - - l = g_slist_find_custom(list, match, cmp_watcher); - destroy_watcher(match); - - if (l != NULL) - return l->data; - - return NULL; -} - -static void remove_watcher(gpointer user_data) -{ - struct watcher *watcher = user_data; - - g_dbus_remove_watch(btd_get_dbus_connection(), watcher->id); -} - -static void destroy_csc_adapter(gpointer user_data) -{ - struct csc_adapter *cadapter = user_data; - - g_slist_free_full(cadapter->watchers, remove_watcher); - - g_free(cadapter); -} - -static void destroy_csc(gpointer user_data) -{ - struct csc *csc = user_data; - - if (csc->attioid > 0) - btd_device_remove_attio_callback(csc->dev, csc->attioid); - - if (csc->attrib != NULL) { - g_attrib_unregister(csc->attrib, csc->attio_measurement_id); - g_attrib_unregister(csc->attrib, csc->attio_controlpoint_id); - g_attrib_unref(csc->attrib); - } - - btd_device_unref(csc->dev); - g_free(csc->svc_range); - g_free(csc->locations); - g_free(csc); -} - -static void char_write_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - char *msg = user_data; - - if (status != 0) - error("%s failed", msg); - - g_free(msg); -} - -static gboolean controlpoint_timeout(gpointer user_data) -{ - struct controlpoint_req *req = user_data; - - if (req->opcode == UPDATE_SENSOR_LOC) { - g_dbus_pending_property_error(req->reply_id, - ERROR_INTERFACE ".Failed", - "Operation failed (timeout)"); - } else if (req->opcode == SET_CUMULATIVE_VALUE) { - DBusMessage *reply; - - reply = btd_error_failed(req->msg, - "Operation failed (timeout)"); - - g_dbus_send_message(btd_get_dbus_connection(), reply); - - dbus_message_unref(req->msg); - } - - req->csc->pending_req = NULL; - g_free(req); - - return FALSE; -} - -static void controlpoint_write_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct controlpoint_req *req = user_data; - - if (status == 0) { - req->timeout = g_timeout_add_seconds(ATT_TIMEOUT, - controlpoint_timeout, - req); - return; - } - - error("SC Control Point write failed (opcode=%d)", req->opcode); - - if (req->opcode == UPDATE_SENSOR_LOC) { - g_dbus_pending_property_error(req->reply_id, - ERROR_INTERFACE ".Failed", - "Operation failed (%d)", status); - } else if (req->opcode == SET_CUMULATIVE_VALUE) { - DBusMessage *reply; - - reply = btd_error_failed(req->msg, "Operation failed"); - - g_dbus_send_message(btd_get_dbus_connection(), reply); - - dbus_message_unref(req->msg); - } - - req->csc->pending_req = NULL; - g_free(req); -} - -static void read_supported_locations(struct csc *csc) -{ - struct controlpoint_req *req; - - req = g_new0(struct controlpoint_req, 1); - req->csc = csc; - req->opcode = REQUEST_SUPPORTED_SENSOR_LOC; - - csc->pending_req = req; - - gatt_write_char(csc->attrib, csc->controlpoint_val_handle, - &req->opcode, sizeof(req->opcode), - controlpoint_write_cb, req); -} - -static void read_feature_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct csc *csc = user_data; - uint8_t value[2]; - ssize_t vlen; - - if (status) { - error("CSC Feature read failed: %s", att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, len, value, sizeof(value)); - if (vlen < 0) { - error("Protocol error"); - return; - } - - if (vlen != sizeof(value)) { - error("Invalid value length for CSC Feature"); - return; - } - - csc->feature = get_le16(value); - - if ((csc->feature & MULTI_SENSOR_LOC_SUPPORT) - && (csc->locations == NULL)) - read_supported_locations(csc); -} - -static void read_location_cb(guint8 status, const guint8 *pdu, - guint16 len, gpointer user_data) -{ - struct csc *csc = user_data; - uint8_t value; - ssize_t vlen; - - if (status) { - error("Sensor Location read failed: %s", att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, len, &value, sizeof(value)); - if (vlen < 0) { - error("Protocol error"); - return; - } - - if (vlen != sizeof(value)) { - error("Invalid value length for Sensor Location"); - return; - } - - csc->has_location = TRUE; - csc->location = value; - - g_dbus_emit_property_changed(btd_get_dbus_connection(), - device_get_path(csc->dev), - CYCLINGSPEED_INTERFACE, "Location"); -} - -static void discover_desc_cb(guint8 status, GSList *descs, gpointer user_data) -{ - struct characteristic *ch = user_data; - struct gatt_desc *desc; - uint8_t attr_val[2]; - char *msg = NULL; - - if (status != 0) { - error("Discover %s descriptors failed: %s", ch->uuid, - att_ecode2str(status)); - goto done; - } - - /* There will be only one descriptor on list and it will be CCC */ - desc = descs->data; - - if (g_strcmp0(ch->uuid, CSC_MEASUREMENT_UUID) == 0) { - ch->csc->measurement_ccc_handle = desc->handle; - - if (g_slist_length(ch->csc->cadapter->watchers) == 0) { - put_le16(0x0000, attr_val); - msg = g_strdup("Disable measurement"); - } else { - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, - attr_val); - msg = g_strdup("Enable measurement"); - } - } else if (g_strcmp0(ch->uuid, SC_CONTROL_POINT_UUID) == 0) { - put_le16(GATT_CLIENT_CHARAC_CFG_IND_BIT, attr_val); - msg = g_strdup("Enable SC Control Point indications"); - } else { - goto done; - } - - gatt_write_char(ch->csc->attrib, desc->handle, attr_val, - sizeof(attr_val), char_write_cb, msg); - -done: - g_free(ch); -} - -static void discover_desc(struct csc *csc, struct gatt_char *c, - struct gatt_char *c_next) -{ - struct characteristic *ch; - uint16_t start, end; - bt_uuid_t uuid; - - start = c->value_handle + 1; - - if (c_next != NULL) { - if (start == c_next->handle) - return; - end = c_next->handle - 1; - } else if (c->value_handle != csc->svc_range->end) { - end = csc->svc_range->end; - } else { - return; - } - - ch = g_new0(struct characteristic, 1); - ch->csc = csc; - memcpy(ch->uuid, c->uuid, sizeof(c->uuid)); - - bt_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID); - - gatt_discover_desc(csc->attrib, start, end, &uuid, discover_desc_cb, - ch); -} - -static void update_watcher(gpointer data, gpointer user_data) -{ - struct watcher *w = data; - struct measurement *m = user_data; - struct csc *csc = m->csc; - const char *path = device_get_path(csc->dev); - DBusMessageIter iter; - DBusMessageIter dict; - DBusMessage *msg; - - msg = dbus_message_new_method_call(w->srv, w->path, - CYCLINGSPEED_WATCHER_INTERFACE, "MeasurementReceived"); - if (msg == NULL) - return; - - dbus_message_iter_init_append(msg, &iter); - - dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH , &path); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - if (m->has_wheel_rev) { - dict_append_entry(&dict, "WheelRevolutions", - DBUS_TYPE_UINT32, &m->wheel_rev); - dict_append_entry(&dict, "LastWheelEventTime", - DBUS_TYPE_UINT16, &m->last_wheel_time); - } - - if (m->has_crank_rev) { - dict_append_entry(&dict, "CrankRevolutions", - DBUS_TYPE_UINT16, &m->crank_rev); - dict_append_entry(&dict, "LastCrankEventTime", - DBUS_TYPE_UINT16, &m->last_crank_time); - } - - dbus_message_iter_close_container(&iter, &dict); - - dbus_message_set_no_reply(msg, TRUE); - g_dbus_send_message(btd_get_dbus_connection(), msg); -} - -static void process_measurement(struct csc *csc, const uint8_t *pdu, - uint16_t len) -{ - struct measurement m; - uint8_t flags; - - flags = *pdu; - - pdu++; - len--; - - memset(&m, 0, sizeof(m)); - - if ((flags & WHEEL_REV_PRESENT) && (csc->feature & WHEEL_REV_SUPPORT)) { - if (len < 6) { - error("Wheel revolutions data fields missing"); - return; - } - - m.has_wheel_rev = true; - m.wheel_rev = get_le32(pdu); - m.last_wheel_time = get_le16(pdu + 4); - pdu += 6; - len -= 6; - } - - if ((flags & CRANK_REV_PRESENT) && (csc->feature & CRANK_REV_SUPPORT)) { - if (len < 4) { - error("Crank revolutions data fields missing"); - return; - } - - m.has_crank_rev = true; - m.crank_rev = get_le16(pdu); - m.last_crank_time = get_le16(pdu + 2); - pdu += 4; - len -= 4; - } - - /* Notify all registered watchers */ - m.csc = csc; - g_slist_foreach(csc->cadapter->watchers, update_watcher, &m); -} - -static void measurement_notify_handler(const uint8_t *pdu, uint16_t len, - gpointer user_data) -{ - struct csc *csc = user_data; - - /* should be at least opcode (1b) + handle (2b) */ - if (len < 3) { - error("Invalid PDU received"); - return; - } - - process_measurement(csc, pdu + 3, len - 3); -} - -static void controlpoint_property_reply(struct controlpoint_req *req, - uint8_t code) -{ - switch (code) { - case RSP_SUCCESS: - g_dbus_pending_property_success(req->reply_id); - break; - - case RSP_NOT_SUPPORTED: - g_dbus_pending_property_error(req->reply_id, - ERROR_INTERFACE ".NotSupported", - "Feature is not supported"); - break; - - case RSP_INVALID_PARAM: - g_dbus_pending_property_error(req->reply_id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - break; - - case RSP_FAILED: - g_dbus_pending_property_error(req->reply_id, - ERROR_INTERFACE ".Failed", - "Operation failed"); - break; - - default: - g_dbus_pending_property_error(req->reply_id, - ERROR_INTERFACE ".Failed", - "Operation failed (%d)", code); - break; - } -} - -static void controlpoint_method_reply(struct controlpoint_req *req, - uint8_t code) -{ - DBusMessage *reply; - - switch (code) { - case RSP_SUCCESS: - reply = dbus_message_new_method_return(req->msg); - break; - case RSP_NOT_SUPPORTED: - reply = btd_error_not_supported(req->msg); - break; - case RSP_INVALID_PARAM: - reply = btd_error_invalid_args(req->msg); - break; - case RSP_FAILED: - reply = btd_error_failed(req->msg, "Failed"); - break; - default: - reply = btd_error_failed(req->msg, "Unknown error"); - break; - } - - g_dbus_send_message(btd_get_dbus_connection(), reply); - - dbus_message_unref(req->msg); -} - -static void controlpoint_ind_handler(const uint8_t *pdu, uint16_t len, - gpointer user_data) -{ - struct csc *csc = user_data; - struct controlpoint_req *req = csc->pending_req; - uint8_t opcode; - uint8_t req_opcode; - uint8_t rsp_code; - uint8_t *opdu; - uint16_t olen; - size_t plen; - - if (len < ATT_HDR_LEN) { - error("Invalid PDU received"); - return; - } - - /* skip ATT header */ - pdu += ATT_HDR_LEN; - len -= ATT_HDR_LEN; - - if (len < 1) { - error("Op Code missing"); - goto done; - } - - opcode = *pdu; - pdu++; - len--; - - if (opcode != RESPONSE_CODE) { - DBG("Unsupported Op Code received (%d)", opcode); - goto done; - } - - if (len < 2) { - error("Invalid Response Code PDU received"); - goto done; - } - - req_opcode = *pdu; - rsp_code = *(pdu + 1); - pdu += 2; - len -= 2; - - if (req == NULL || req->opcode != req_opcode) { - DBG("Indication received without pending request"); - goto done; - } - - switch (req->opcode) { - case SET_CUMULATIVE_VALUE: - controlpoint_method_reply(req, rsp_code); - break; - - case REQUEST_SUPPORTED_SENSOR_LOC: - if (rsp_code == RSP_SUCCESS) { - csc->num_locations = len; - csc->locations = g_memdup(pdu, len); - } else { - error("Failed to read Supported Sendor Locations"); - } - break; - - case UPDATE_SENSOR_LOC: - csc->location = req->pending_location; - - controlpoint_property_reply(req, rsp_code); - - g_dbus_emit_property_changed(btd_get_dbus_connection(), - device_get_path(csc->dev), - CYCLINGSPEED_INTERFACE, "Location"); - break; - } - - csc->pending_req = NULL; - g_source_remove(req->timeout); - g_free(req); - -done: - opdu = g_attrib_get_buffer(csc->attrib, &plen); - olen = enc_confirmation(opdu, plen); - if (olen > 0) - g_attrib_send(csc->attrib, 0, opdu, olen, NULL, NULL, NULL); -} - -static void discover_char_cb(uint8_t status, GSList *chars, void *user_data) -{ - struct csc *csc = user_data; - uint16_t feature_val_handle = 0; - - if (status) { - error("Discover CSCS characteristics: %s", - att_ecode2str(status)); - return; - } - - for (; chars; chars = chars->next) { - struct gatt_char *c = chars->data; - struct gatt_char *c_next = - (chars->next ? chars->next->data : NULL); - - if (g_strcmp0(c->uuid, CSC_MEASUREMENT_UUID) == 0) { - csc->attio_measurement_id = - g_attrib_register(csc->attrib, - ATT_OP_HANDLE_NOTIFY, c->value_handle, - measurement_notify_handler, csc, NULL); - - discover_desc(csc, c, c_next); - } else if (g_strcmp0(c->uuid, CSC_FEATURE_UUID) == 0) { - feature_val_handle = c->value_handle; - } else if (g_strcmp0(c->uuid, SENSOR_LOCATION_UUID) == 0) { - DBG("Sensor Location supported"); - gatt_read_char(csc->attrib, c->value_handle, - read_location_cb, csc); - } else if (g_strcmp0(c->uuid, SC_CONTROL_POINT_UUID) == 0) { - DBG("SC Control Point supported"); - csc->controlpoint_val_handle = c->value_handle; - - csc->attio_controlpoint_id = g_attrib_register( - csc->attrib, ATT_OP_HANDLE_IND, - c->value_handle, - controlpoint_ind_handler, csc, NULL); - - discover_desc(csc, c, c_next); - } - } - - if (feature_val_handle > 0) - gatt_read_char(csc->attrib, feature_val_handle, - read_feature_cb, csc); -} - -static void enable_measurement(gpointer data, gpointer user_data) -{ - struct csc *csc = data; - uint16_t handle = csc->measurement_ccc_handle; - uint8_t value[2]; - char *msg; - - if (csc->attrib == NULL || !handle) - return; - - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value); - msg = g_strdup("Enable measurement"); - - gatt_write_char(csc->attrib, handle, value, sizeof(value), - char_write_cb, msg); -} - -static void disable_measurement(gpointer data, gpointer user_data) -{ - struct csc *csc = data; - uint16_t handle = csc->measurement_ccc_handle; - uint8_t value[2]; - char *msg; - - if (csc->attrib == NULL || !handle) - return; - - put_le16(0x0000, value); - msg = g_strdup("Disable measurement"); - - gatt_write_char(csc->attrib, handle, value, sizeof(value), - char_write_cb, msg); -} - -static void attio_connected_cb(GAttrib *attrib, gpointer user_data) -{ - struct csc *csc = user_data; - - DBG(""); - - csc->attrib = g_attrib_ref(attrib); - - gatt_discover_char(csc->attrib, csc->svc_range->start, - csc->svc_range->end, NULL, - discover_char_cb, csc); -} - -static void attio_disconnected_cb(gpointer user_data) -{ - struct csc *csc = user_data; - - DBG(""); - - if (csc->attio_measurement_id > 0) { - g_attrib_unregister(csc->attrib, csc->attio_measurement_id); - csc->attio_measurement_id = 0; - } - - if (csc->attio_controlpoint_id > 0) { - g_attrib_unregister(csc->attrib, csc->attio_controlpoint_id); - csc->attio_controlpoint_id = 0; - } - - g_attrib_unref(csc->attrib); - csc->attrib = NULL; -} - -static void watcher_exit_cb(DBusConnection *conn, void *user_data) -{ - struct watcher *watcher = user_data; - struct csc_adapter *cadapter = watcher->cadapter; - - DBG("cycling watcher [%s] disconnected", watcher->path); - - cadapter->watchers = g_slist_remove(cadapter->watchers, watcher); - g_dbus_remove_watch(conn, watcher->id); - - if (g_slist_length(cadapter->watchers) == 0) - g_slist_foreach(cadapter->devices, disable_measurement, 0); -} - -static DBusMessage *register_watcher(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct csc_adapter *cadapter = data; - struct watcher *watcher; - const char *sender = dbus_message_get_sender(msg); - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(cadapter->watchers, sender, path); - if (watcher != NULL) - return btd_error_already_exists(msg); - - watcher = g_new0(struct watcher, 1); - watcher->cadapter = cadapter; - watcher->id = g_dbus_add_disconnect_watch(conn, sender, watcher_exit_cb, - watcher, destroy_watcher); - watcher->srv = g_strdup(sender); - watcher->path = g_strdup(path); - - if (g_slist_length(cadapter->watchers) == 0) - g_slist_foreach(cadapter->devices, enable_measurement, 0); - - cadapter->watchers = g_slist_prepend(cadapter->watchers, watcher); - - DBG("cycling watcher [%s] registered", path); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *unregister_watcher(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct csc_adapter *cadapter = data; - struct watcher *watcher; - const char *sender = dbus_message_get_sender(msg); - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(cadapter->watchers, sender, path); - if (watcher == NULL) - return btd_error_does_not_exist(msg); - - cadapter->watchers = g_slist_remove(cadapter->watchers, watcher); - g_dbus_remove_watch(conn, watcher->id); - - if (g_slist_length(cadapter->watchers) == 0) - g_slist_foreach(cadapter->devices, disable_measurement, 0); - - DBG("cycling watcher [%s] unregistered", path); - - return dbus_message_new_method_return(msg); -} - -static const GDBusMethodTable cyclingspeed_manager_methods[] = { - { GDBUS_METHOD("RegisterWatcher", - GDBUS_ARGS({ "agent", "o" }), NULL, - register_watcher) }, - { GDBUS_METHOD("UnregisterWatcher", - GDBUS_ARGS({ "agent", "o" }), NULL, - unregister_watcher) }, - { } -}; - -static int csc_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter) -{ - struct csc_adapter *cadapter; - - cadapter = g_new0(struct csc_adapter, 1); - cadapter->adapter = adapter; - - if (!g_dbus_register_interface(btd_get_dbus_connection(), - adapter_get_path(adapter), - CYCLINGSPEED_MANAGER_INTERFACE, - cyclingspeed_manager_methods, - NULL, NULL, cadapter, - destroy_csc_adapter)) { - error("D-Bus failed to register %s interface", - CYCLINGSPEED_MANAGER_INTERFACE); - destroy_csc_adapter(cadapter); - return -EIO; - } - - csc_adapters = g_slist_prepend(csc_adapters, cadapter); - - return 0; -} - -static void csc_adapter_remove(struct btd_profile *p, - struct btd_adapter *adapter) -{ - struct csc_adapter *cadapter; - - cadapter = find_csc_adapter(adapter); - if (cadapter == NULL) - return; - - csc_adapters = g_slist_remove(csc_adapters, cadapter); - - g_dbus_unregister_interface(btd_get_dbus_connection(), - adapter_get_path(cadapter->adapter), - CYCLINGSPEED_MANAGER_INTERFACE); -} - -static gboolean property_get_location(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct csc *csc = data; - const char *loc; - - if (!csc->has_location) - return FALSE; - - loc = location2str(csc->location); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &loc); - - return TRUE; -} - -static void property_set_location(const GDBusPropertyTable *property, - DBusMessageIter *iter, - GDBusPendingPropertySet id, void *data) -{ - struct csc *csc = data; - char *loc; - int loc_val; - uint8_t att_val[2]; - struct controlpoint_req *req; - - if (csc->pending_req != NULL) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InProgress", - "Operation already in progress"); - return; - } - - if (!(csc->feature & MULTI_SENSOR_LOC_SUPPORT)) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".NotSupported", - "Feature is not supported"); - return; - } - - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - dbus_message_iter_get_basic(iter, &loc); - - loc_val = str2location(loc); - - if (loc_val < 0) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - req = g_new(struct controlpoint_req, 1); - req->csc = csc; - req->reply_id = id; - req->opcode = UPDATE_SENSOR_LOC; - req->pending_location = loc_val; - - csc->pending_req = req; - - att_val[0] = UPDATE_SENSOR_LOC; - att_val[1] = loc_val; - - gatt_write_char(csc->attrib, csc->controlpoint_val_handle, att_val, - sizeof(att_val), controlpoint_write_cb, req); -} - -static gboolean property_exists_location(const GDBusPropertyTable *property, - void *data) -{ - struct csc *csc = data; - - return csc->has_location; -} - -static gboolean property_get_locations(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct csc *csc = data; - DBusMessageIter entry; - int i; - - if (!(csc->feature & MULTI_SENSOR_LOC_SUPPORT)) - return FALSE; - - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, - DBUS_TYPE_STRING_AS_STRING, &entry); - for (i = 0; i < csc->num_locations; i++) { - char *loc = g_strdup(location2str(csc->locations[i])); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &loc); - g_free(loc); - } - - dbus_message_iter_close_container(iter, &entry); - - return TRUE; -} - -static gboolean property_exists_locations(const GDBusPropertyTable *property, - void *data) -{ - struct csc *csc = data; - - return !!(csc->feature & MULTI_SENSOR_LOC_SUPPORT); -} - -static gboolean property_get_wheel_rev_sup(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct csc *csc = data; - dbus_bool_t val; - - val = !!(csc->feature & WHEEL_REV_SUPPORT); - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val); - - return TRUE; -} - -static gboolean property_get_multi_loc_sup(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct csc *csc = data; - dbus_bool_t val; - - val = !!(csc->feature & MULTI_SENSOR_LOC_SUPPORT); - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val); - - return TRUE; -} - -static const GDBusPropertyTable cyclingspeed_device_properties[] = { - { "Location", "s", property_get_location, property_set_location, - property_exists_location }, - { "SupportedLocations", "as", property_get_locations, NULL, - property_exists_locations }, - { "WheelRevolutionDataSupported", "b", property_get_wheel_rev_sup }, - { "MultipleLocationsSupported", "b", property_get_multi_loc_sup }, - { } -}; - -static DBusMessage *set_cumulative_wheel_rev(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct csc *csc = data; - dbus_uint32_t value; - struct controlpoint_req *req; - uint8_t att_val[5]; /* uint8 opcode + uint32 value */ - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &value, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (csc->pending_req != NULL) - return btd_error_in_progress(msg); - - req = g_new(struct controlpoint_req, 1); - req->csc = csc; - req->opcode = SET_CUMULATIVE_VALUE; - req->msg = dbus_message_ref(msg); - - csc->pending_req = req; - - att_val[0] = SET_CUMULATIVE_VALUE; - put_le32(value, att_val + 1); - - gatt_write_char(csc->attrib, csc->controlpoint_val_handle, att_val, - sizeof(att_val), controlpoint_write_cb, req); - - return NULL; -} - -static const GDBusMethodTable cyclingspeed_device_methods[] = { - { GDBUS_ASYNC_METHOD("SetCumulativeWheelRevolutions", - GDBUS_ARGS({ "value", "u" }), NULL, - set_cumulative_wheel_rev) }, - { } -}; - -static int csc_device_probe(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct btd_adapter *adapter; - struct csc_adapter *cadapter; - struct csc *csc; - struct gatt_primary *prim; - - prim = btd_device_get_primary(device, CYCLING_SC_UUID); - if (prim == NULL) - return -EINVAL; - - adapter = device_get_adapter(device); - - cadapter = find_csc_adapter(adapter); - if (cadapter == NULL) - return -1; - - csc = g_new0(struct csc, 1); - csc->dev = btd_device_ref(device); - csc->cadapter = cadapter; - - if (!g_dbus_register_interface(btd_get_dbus_connection(), - device_get_path(device), - CYCLINGSPEED_INTERFACE, - cyclingspeed_device_methods, - NULL, - cyclingspeed_device_properties, - csc, destroy_csc)) { - error("D-Bus failed to register %s interface", - CYCLINGSPEED_INTERFACE); - destroy_csc(csc); - return -EIO; - } - - csc->svc_range = g_new0(struct att_range, 1); - csc->svc_range->start = prim->range.start; - csc->svc_range->end = prim->range.end; - - cadapter->devices = g_slist_prepend(cadapter->devices, csc); - - csc->attioid = btd_device_add_attio_callback(device, attio_connected_cb, - attio_disconnected_cb, csc); - - return 0; -} - -static void csc_device_remove(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct btd_adapter *adapter; - struct csc_adapter *cadapter; - struct csc *csc; - GSList *l; - - adapter = device_get_adapter(device); - - cadapter = find_csc_adapter(adapter); - if (cadapter == NULL) - return; - - l = g_slist_find_custom(cadapter->devices, device, cmp_device); - if (l == NULL) - return; - - csc = l->data; - - cadapter->devices = g_slist_remove(cadapter->devices, csc); - - g_dbus_unregister_interface(btd_get_dbus_connection(), - device_get_path(device), - CYCLINGSPEED_INTERFACE); -} - -static struct btd_profile cscp_profile = { - .name = "Cycling Speed and Cadence GATT Driver", - .remote_uuid = CYCLING_SC_UUID, - - .adapter_probe = csc_adapter_probe, - .adapter_remove = csc_adapter_remove, - - .device_probe = csc_device_probe, - .device_remove = csc_device_remove, -}; - -static int cyclingspeed_init(void) -{ - return btd_profile_register(&cscp_profile); -} - -static void cyclingspeed_exit(void) -{ - btd_profile_unregister(&cscp_profile); -} - -BLUETOOTH_PLUGIN_DEFINE(cyclingspeed, VERSION, - BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - cyclingspeed_init, cyclingspeed_exit) diff --git a/profiles/deviceinfo/deviceinfo.c b/profiles/deviceinfo/deviceinfo.c old mode 100644 new mode 100755 index d1f51a0..fa94efe --- a/profiles/deviceinfo/deviceinfo.c +++ b/profiles/deviceinfo/deviceinfo.c @@ -88,7 +88,7 @@ static void handle_characteristic(struct gatt_db_attribute *attr, bt_string_to_uuid(&pnpid_uuid, PNPID_UUID); if (!gatt_db_attribute_get_char_data(attr, NULL, &value_handle, NULL, - &uuid)) { + NULL, &uuid)) { error("Failed to obtain characteristic data"); return; } @@ -111,17 +111,17 @@ static void foreach_deviceinfo_service(struct gatt_db_attribute *attr, gatt_db_service_foreach_char(attr, handle_characteristic, device); } -static int deviceinfo_driver_probe(struct btd_service *service) +static int deviceinfo_probe(struct btd_service *service) { return 0; } -static void deviceinfo_driver_remove(struct btd_service *service) +static void deviceinfo_remove(struct btd_service *service) { } -static int deviceinfo_driver_accept(struct btd_service *service) +static int deviceinfo_accept(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct gatt_db *db = btd_device_get_gatt_db(device); @@ -136,6 +136,15 @@ static int deviceinfo_driver_accept(struct btd_service *service) gatt_db_foreach_service(db, &deviceinfo_uuid, foreach_deviceinfo_service, device); + btd_service_connecting_complete(service, 0); + + return 0; +} + +static int deviceinfo_disconnect(struct btd_service *service) +{ + btd_service_disconnecting_complete(service, 0); + return 0; } @@ -143,9 +152,10 @@ static struct btd_profile deviceinfo_profile = { .name = "deviceinfo", .remote_uuid = DEVICE_INFORMATION_UUID, .external = true, - .device_probe = deviceinfo_driver_probe, - .device_remove = deviceinfo_driver_remove, - .accept = deviceinfo_driver_accept, + .device_probe = deviceinfo_probe, + .device_remove = deviceinfo_remove, + .accept = deviceinfo_accept, + .disconnect = deviceinfo_disconnect, }; static int deviceinfo_init(void) diff --git a/profiles/deviceinfo/dis.c b/profiles/deviceinfo/dis.c old mode 100644 new mode 100755 diff --git a/profiles/deviceinfo/dis.h b/profiles/deviceinfo/dis.h old mode 100644 new mode 100755 diff --git a/profiles/gap/gas.c b/profiles/gap/gas.c old mode 100644 new mode 100755 index 256a9be..47c8c25 --- a/profiles/gap/gas.c +++ b/profiles/gap/gas.c @@ -57,8 +57,6 @@ struct gas { struct gatt_db_attribute *attr; }; -static GSList *devices; - static void gas_free(struct gas *gas) { gatt_db_unref(gas->db); @@ -67,14 +65,6 @@ static void gas_free(struct gas *gas) g_free(gas); } -static int cmp_device(gconstpointer a, gconstpointer b) -{ - const struct gas *gas = a; - const struct btd_device *device = b; - - return gas->device == device ? 0 : -1; -} - static char *name2utf8(const uint8_t *name, uint16_t len) { char utf8_name[HCI_MAX_NAME_LENGTH + 2]; @@ -164,40 +154,6 @@ static void handle_appearance(struct gas *gas, uint16_t value_handle) DBG("Failed to send request to read appearance"); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void read_rpa_res_characteristic_value_cb(bool success, uint8_t att_ecode, - const uint8_t *value, uint16_t length, - void *user_data) -{ - struct gas *gas = user_data; - uint8_t rpa_res_support; - - if (!success) { - DBG("Reading RPA Resolution Char Value failed with ATT error: %u", att_ecode); - return; - } - - /* The RPA Resolution Char Value value is a 8-bit unsigned integer */ - if (length != 1) { - DBG("Malformed RPA resolution char value"); - return; - } - - rpa_res_support = *value; - - DBG("GAP RPA Resolution Char Value: %d", rpa_res_support); - - device_set_rpa_res_char_value(gas->device, rpa_res_support); -} - -static void handle_rpa_res_characteristic_value(struct gas *gas, uint16_t value_handle) -{ - if (!bt_gatt_client_read_value(gas->client, value_handle, - read_rpa_res_characteristic_value_cb, gas, NULL)) - DBG("Failed to send request to read RPA resolution Char Value"); -} -#endif - static bool uuid_cmp(uint16_t u16, const bt_uuid_t *uuid) { bt_uuid_t lhs; @@ -215,7 +171,7 @@ static void handle_characteristic(struct gatt_db_attribute *attr, bt_uuid_t uuid; if (!gatt_db_attribute_get_char_data(attr, NULL, &value_handle, NULL, - &uuid)) { + NULL, &uuid)) { error("Failed to obtain characteristic data"); return; } @@ -224,10 +180,6 @@ static void handle_characteristic(struct gatt_db_attribute *attr, handle_device_name(gas, value_handle); else if (uuid_cmp(GATT_CHARAC_APPEARANCE, &uuid)) handle_appearance(gas, value_handle); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (uuid_cmp(GATT_CHARAC_CENTRAL_RPA_RESOLUTION, &uuid)) - handle_rpa_res_characteristic_value(gas, value_handle); -#endif else { char uuid_str[MAX_LEN_UUID_STR]; @@ -243,19 +195,17 @@ static void handle_gap_service(struct gas *gas) gatt_db_service_foreach_char(gas->attr, handle_characteristic, gas); } -static int gap_driver_probe(struct btd_service *service) +static int gap_probe(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); - struct gas *gas; - GSList *l; + struct gas *gas = btd_service_get_user_data(service); char addr[18]; ba2str(device_get_address(device), addr); DBG("GAP profile probe (%s)", addr); /* Ignore, if we were probed for this device already */ - l = g_slist_find_custom(devices, device, cmp_device); - if (l) { + if (gas) { error("Profile probed twice for the same device!"); return -1; } @@ -265,30 +215,26 @@ static int gap_driver_probe(struct btd_service *service) return -1; gas->device = btd_device_ref(device); - devices = g_slist_append(devices, gas); + btd_service_set_user_data(service, gas); return 0; } -static void gap_driver_remove(struct btd_service *service) +static void gap_remove(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct gas *gas; - GSList *l; char addr[18]; ba2str(device_get_address(device), addr); DBG("GAP profile remove (%s)", addr); - l = g_slist_find_custom(devices, device, cmp_device); - if (!l) { + gas = btd_service_get_user_data(service); + if (!gas) { error("GAP service not handled by profile"); return; } - gas = l->data; - - devices = g_slist_remove(devices, gas); gas_free(gas); } @@ -305,32 +251,32 @@ static void foreach_gap_service(struct gatt_db_attribute *attr, void *user_data) handle_gap_service(gas); } -static int gap_driver_accept(struct btd_service *service) +static void gas_reset(struct gas *gas) +{ + gas->attr = NULL; + gatt_db_unref(gas->db); + gas->db = NULL; + bt_gatt_client_unref(gas->client); + gas->client = NULL; +} + +static int gap_accept(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct gatt_db *db = btd_device_get_gatt_db(device); struct bt_gatt_client *client = btd_device_get_gatt_client(device); - struct gas *gas; - GSList *l; + struct gas *gas = btd_service_get_user_data(service); char addr[18]; bt_uuid_t gap_uuid; ba2str(device_get_address(device), addr); DBG("GAP profile accept (%s)", addr); - l = g_slist_find_custom(devices, device, cmp_device); - if (!l) { + if (!gas) { error("GAP service not handled by profile"); return -1; } - gas = l->data; - - /* Clean-up any old client/db and acquire the new ones */ - gas->attr = NULL; - gatt_db_unref(gas->db); - bt_gatt_client_unref(gas->client); - gas->db = gatt_db_ref(db); gas->client = bt_gatt_client_ref(client); @@ -338,24 +284,40 @@ static int gap_driver_accept(struct btd_service *service) bt_uuid16_create(&gap_uuid, GAP_UUID16); gatt_db_foreach_service(db, &gap_uuid, foreach_gap_service, gas); + if (!gas->attr) { + error("GAP attribute not found"); + gas_reset(gas); + return -1; + } + + btd_service_connecting_complete(service, 0); + + return 0; +} + +static int gap_disconnect(struct btd_service *service) +{ + struct gas *gas = btd_service_get_user_data(service); + + gas_reset(gas); + + btd_service_disconnecting_complete(service, 0); + return 0; } static struct btd_profile gap_profile = { .name = "gap-profile", .remote_uuid = GAP_UUID, - .device_probe = gap_driver_probe, - .device_remove = gap_driver_remove, - .accept = gap_driver_accept + .device_probe = gap_probe, + .device_remove = gap_remove, + .accept = gap_accept, + .disconnect = gap_disconnect, }; static int gap_init(void) { - devices = NULL; - - btd_profile_register(&gap_profile); - - return 0; + return btd_profile_register(&gap_profile); } static void gap_exit(void) diff --git a/profiles/health/hdp.c b/profiles/health/hdp.c old mode 100644 new mode 100755 diff --git a/profiles/health/hdp.h b/profiles/health/hdp.h old mode 100644 new mode 100755 diff --git a/profiles/health/hdp_main.c b/profiles/health/hdp_main.c old mode 100644 new mode 100755 diff --git a/profiles/health/hdp_manager.c b/profiles/health/hdp_manager.c old mode 100644 new mode 100755 diff --git a/profiles/health/hdp_manager.h b/profiles/health/hdp_manager.h old mode 100644 new mode 100755 diff --git a/profiles/health/hdp_types.h b/profiles/health/hdp_types.h old mode 100644 new mode 100755 diff --git a/profiles/health/hdp_util.c b/profiles/health/hdp_util.c old mode 100644 new mode 100755 diff --git a/profiles/health/hdp_util.h b/profiles/health/hdp_util.h old mode 100644 new mode 100755 diff --git a/profiles/health/mcap.c b/profiles/health/mcap.c old mode 100644 new mode 100755 diff --git a/profiles/health/mcap.h b/profiles/health/mcap.h old mode 100644 new mode 100755 diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c deleted file mode 100644 index 9e8c499..0000000 --- a/profiles/heartrate/heartrate.c +++ /dev/null @@ -1,870 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Tieto Poland - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/plugin.h" -#include "src/adapter.h" -#include "src/dbus-common.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/shared/util.h" -#include "src/service.h" -#include "src/error.h" -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" -#include "src/attio.h" -#include "src/log.h" - -#define HEART_RATE_INTERFACE "org.bluez.HeartRate1" -#define HEART_RATE_MANAGER_INTERFACE "org.bluez.HeartRateManager1" -#define HEART_RATE_WATCHER_INTERFACE "org.bluez.HeartRateWatcher1" - -#define HR_VALUE_FORMAT 0x01 -#define SENSOR_CONTACT_DETECTED 0x02 -#define SENSOR_CONTACT_SUPPORT 0x04 -#define ENERGY_EXP_STATUS 0x08 -#define RR_INTERVAL 0x10 - -struct heartrate_adapter { - struct btd_adapter *adapter; - GSList *devices; - GSList *watchers; -}; - -struct heartrate { - struct btd_device *dev; - struct heartrate_adapter *hradapter; - GAttrib *attrib; - guint attioid; - guint attionotid; - - struct att_range *svc_range; /* primary svc range */ - - uint16_t measurement_ccc_handle; - uint16_t hrcp_val_handle; - - gboolean has_location; - uint8_t location; -}; - -struct watcher { - struct heartrate_adapter *hradapter; - guint id; - char *srv; - char *path; -}; - -struct measurement { - struct heartrate *hr; - uint16_t value; - gboolean has_energy; - uint16_t energy; - gboolean has_contact; - gboolean contact; - uint16_t num_interval; - uint16_t *interval; -}; - -static GSList *heartrate_adapters = NULL; - -static const char * const location_enum[] = { - "other", - "chest", - "wrist", - "finger", - "hand", - "earlobe", - "foot", -}; - -static const char *location2str(uint8_t value) -{ - if (value < G_N_ELEMENTS(location_enum)) - return location_enum[value]; - - error("Body Sensor Location [%d] is RFU", value); - - return NULL; -} - -static int cmp_adapter(gconstpointer a, gconstpointer b) -{ - const struct heartrate_adapter *hradapter = a; - const struct btd_adapter *adapter = b; - - if (adapter == hradapter->adapter) - return 0; - - return -1; -} - -static int cmp_device(gconstpointer a, gconstpointer b) -{ - const struct heartrate *hr = a; - const struct btd_device *dev = b; - - if (dev == hr->dev) - return 0; - - return -1; -} - -static int cmp_watcher(gconstpointer a, gconstpointer b) -{ - const struct watcher *watcher = a; - const struct watcher *match = b; - int ret; - - ret = g_strcmp0(watcher->srv, match->srv); - if (ret != 0) - return ret; - - return g_strcmp0(watcher->path, match->path); -} - -static struct heartrate_adapter * -find_heartrate_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(heartrate_adapters, adapter, - cmp_adapter); - if (!l) - return NULL; - - return l->data; -} - -static void destroy_watcher(gpointer user_data) -{ - struct watcher *watcher = user_data; - - g_free(watcher->path); - g_free(watcher->srv); - g_free(watcher); -} - -static struct watcher *find_watcher(GSList *list, const char *sender, - const char *path) -{ - struct watcher *match; - GSList *l; - - match = g_new0(struct watcher, 1); - match->srv = g_strdup(sender); - match->path = g_strdup(path); - - l = g_slist_find_custom(list, match, cmp_watcher); - destroy_watcher(match); - - if (l != NULL) - return l->data; - - return NULL; -} - -static void destroy_heartrate(gpointer user_data) -{ - struct heartrate *hr = user_data; - - if (hr->attioid > 0) - btd_device_remove_attio_callback(hr->dev, hr->attioid); - - if (hr->attrib != NULL) { - g_attrib_unregister(hr->attrib, hr->attionotid); - g_attrib_unref(hr->attrib); - } - - btd_device_unref(hr->dev); - g_free(hr->svc_range); - g_free(hr); -} - -static void remove_watcher(gpointer user_data) -{ - struct watcher *watcher = user_data; - - g_dbus_remove_watch(btd_get_dbus_connection(), watcher->id); -} - -static void destroy_heartrate_adapter(gpointer user_data) -{ - struct heartrate_adapter *hradapter = user_data; - - g_slist_free_full(hradapter->watchers, remove_watcher); - - g_free(hradapter); -} - -static void read_sensor_location_cb(guint8 status, const guint8 *pdu, - guint16 len, gpointer user_data) -{ - struct heartrate *hr = user_data; - uint8_t value; - ssize_t vlen; - - if (status != 0) { - error("Body Sensor Location read failed: %s", - att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, len, &value, sizeof(value)); - if (vlen < 0) { - error("Protocol error"); - return; - } - - if (vlen != sizeof(value)) { - error("Invalid length for Body Sensor Location"); - return; - } - - hr->has_location = TRUE; - hr->location = value; -} - -static void char_write_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - char *msg = user_data; - - if (status != 0) - error("%s failed", msg); - - g_free(msg); -} - -static void update_watcher(gpointer data, gpointer user_data) -{ - struct watcher *w = data; - struct measurement *m = user_data; - struct heartrate *hr = m->hr; - const char *path = device_get_path(hr->dev); - DBusMessageIter iter; - DBusMessageIter dict; - DBusMessage *msg; - - msg = dbus_message_new_method_call(w->srv, w->path, - HEART_RATE_WATCHER_INTERFACE, "MeasurementReceived"); - if (msg == NULL) - return; - - dbus_message_iter_init_append(msg, &iter); - - dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH , &path); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - dict_append_entry(&dict, "Value", DBUS_TYPE_UINT16, &m->value); - - if (m->has_energy) - dict_append_entry(&dict, "Energy", DBUS_TYPE_UINT16, - &m->energy); - - if (m->has_contact) - dict_append_entry(&dict, "Contact", DBUS_TYPE_BOOLEAN, - &m->contact); - - if (m->num_interval > 0) - dict_append_array(&dict, "Interval", DBUS_TYPE_UINT16, - &m->interval, m->num_interval); - - dbus_message_iter_close_container(&iter, &dict); - - dbus_message_set_no_reply(msg, TRUE); - g_dbus_send_message(btd_get_dbus_connection(), msg); -} - -static void process_measurement(struct heartrate *hr, const uint8_t *pdu, - uint16_t len) -{ - struct measurement m; - uint8_t flags; - - flags = *pdu; - - pdu++; - len--; - - memset(&m, 0, sizeof(m)); - - if (flags & HR_VALUE_FORMAT) { - if (len < 2) { - error("Heart Rate Measurement field missing"); - return; - } - - m.value = get_le16(pdu); - pdu += 2; - len -= 2; - } else { - if (len < 1) { - error("Heart Rate Measurement field missing"); - return; - } - - m.value = *pdu; - pdu++; - len--; - } - - if (flags & ENERGY_EXP_STATUS) { - if (len < 2) { - error("Energy Expended field missing"); - return; - } - - m.has_energy = TRUE; - m.energy = get_le16(pdu); - pdu += 2; - len -= 2; - } - - if (flags & RR_INTERVAL) { - int i; - - if (len == 0 || (len % 2 != 0)) { - error("RR-Interval field malformed"); - return; - } - - m.num_interval = len / 2; - m.interval = g_new(uint16_t, m.num_interval); - - for (i = 0; i < m.num_interval; pdu += 2, i++) - m.interval[i] = get_le16(pdu); - } - - if (flags & SENSOR_CONTACT_SUPPORT) { - m.has_contact = TRUE; - m.contact = !!(flags & SENSOR_CONTACT_DETECTED); - } - - /* Notify all registered watchers */ - m.hr = hr; - g_slist_foreach(hr->hradapter->watchers, update_watcher, &m); - - g_free(m.interval); -} - -static void notify_handler(const uint8_t *pdu, uint16_t len, gpointer user_data) -{ - struct heartrate *hr = user_data; - - /* should be at least opcode (1b) + handle (2b) */ - if (len < 3) { - error("Invalid PDU received"); - return; - } - - process_measurement(hr, pdu + 3, len - 3); -} - -static void discover_ccc_cb(uint8_t status, GSList *descs, void *user_data) -{ - struct heartrate *hr = user_data; - struct gatt_desc *desc; - uint8_t attr_val[2]; - char *msg; - - if (status != 0) { - error("Discover Heart Rate Measurement descriptors failed: %s", - att_ecode2str(status)); - return; - } - - /* There will be only one descriptor on list and it will be CCC */ - desc = descs->data; - - hr->measurement_ccc_handle = desc->handle; - - if (g_slist_length(hr->hradapter->watchers) == 0) { - put_le16(0x0000, attr_val); - msg = g_strdup("Disable measurement"); - } else { - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, attr_val); - msg = g_strdup("Enable measurement"); - } - - gatt_write_char(hr->attrib, desc->handle, attr_val, sizeof(attr_val), - char_write_cb, msg); -} - -static void discover_measurement_ccc(struct heartrate *hr, - struct gatt_char *c, struct gatt_char *c_next) -{ - uint16_t start, end; - bt_uuid_t uuid; - - start = c->value_handle + 1; - - if (c_next != NULL) { - if (start == c_next->handle) - return; - end = c_next->handle - 1; - } else if (c->value_handle != hr->svc_range->end) { - end = hr->svc_range->end; - } else { - return; - } - - bt_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID); - - gatt_discover_desc(hr->attrib, start, end, &uuid, discover_ccc_cb, hr); -} - -static void discover_char_cb(uint8_t status, GSList *chars, void *user_data) -{ - struct heartrate *hr = user_data; - - if (status) { - error("Discover HRS characteristics failed: %s", - att_ecode2str(status)); - return; - } - - for (; chars; chars = chars->next) { - struct gatt_char *c = chars->data; - - if (g_strcmp0(c->uuid, HEART_RATE_MEASUREMENT_UUID) == 0) { - struct gatt_char *c_next = - (chars->next ? chars->next->data : NULL); - - hr->attionotid = g_attrib_register(hr->attrib, - ATT_OP_HANDLE_NOTIFY, - c->value_handle, - notify_handler, hr, NULL); - - discover_measurement_ccc(hr, c, c_next); - } else if (g_strcmp0(c->uuid, BODY_SENSOR_LOCATION_UUID) == 0) { - DBG("Body Sensor Location supported"); - - gatt_read_char(hr->attrib, c->value_handle, - read_sensor_location_cb, hr); - } else if (g_strcmp0(c->uuid, - HEART_RATE_CONTROL_POINT_UUID) == 0) { - DBG("Heart Rate Control Point supported"); - hr->hrcp_val_handle = c->value_handle; - } - } -} - -static void enable_measurement(gpointer data, gpointer user_data) -{ - struct heartrate *hr = data; - uint16_t handle = hr->measurement_ccc_handle; - uint8_t value[2]; - char *msg; - - if (hr->attrib == NULL || !handle) - return; - - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value); - msg = g_strdup("Enable measurement"); - - gatt_write_char(hr->attrib, handle, value, sizeof(value), - char_write_cb, msg); -} - -static void disable_measurement(gpointer data, gpointer user_data) -{ - struct heartrate *hr = data; - uint16_t handle = hr->measurement_ccc_handle; - uint8_t value[2]; - char *msg; - - if (hr->attrib == NULL || !handle) - return; - - put_le16(0x0000, value); - msg = g_strdup("Disable measurement"); - - gatt_write_char(hr->attrib, handle, value, sizeof(value), - char_write_cb, msg); -} - -static void attio_connected_cb(GAttrib *attrib, gpointer user_data) -{ - struct heartrate *hr = user_data; - - DBG(""); - - hr->attrib = g_attrib_ref(attrib); - - gatt_discover_char(hr->attrib, hr->svc_range->start, hr->svc_range->end, - NULL, discover_char_cb, hr); -} - -static void attio_disconnected_cb(gpointer user_data) -{ - struct heartrate *hr = user_data; - - DBG(""); - - if (hr->attionotid > 0) { - g_attrib_unregister(hr->attrib, hr->attionotid); - hr->attionotid = 0; - } - - g_attrib_unref(hr->attrib); - hr->attrib = NULL; -} - -static void watcher_exit_cb(DBusConnection *conn, void *user_data) -{ - struct watcher *watcher = user_data; - struct heartrate_adapter *hradapter = watcher->hradapter; - - DBG("heartrate watcher [%s] disconnected", watcher->path); - - hradapter->watchers = g_slist_remove(hradapter->watchers, watcher); - g_dbus_remove_watch(conn, watcher->id); - - if (g_slist_length(hradapter->watchers) == 0) - g_slist_foreach(hradapter->devices, disable_measurement, 0); -} - -static DBusMessage *register_watcher(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct heartrate_adapter *hradapter = data; - struct watcher *watcher; - const char *sender = dbus_message_get_sender(msg); - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(hradapter->watchers, sender, path); - if (watcher != NULL) - return btd_error_already_exists(msg); - - watcher = g_new0(struct watcher, 1); - watcher->hradapter = hradapter; - watcher->id = g_dbus_add_disconnect_watch(conn, sender, watcher_exit_cb, - watcher, destroy_watcher); - watcher->srv = g_strdup(sender); - watcher->path = g_strdup(path); - - if (g_slist_length(hradapter->watchers) == 0) - g_slist_foreach(hradapter->devices, enable_measurement, 0); - - hradapter->watchers = g_slist_prepend(hradapter->watchers, watcher); - - DBG("heartrate watcher [%s] registered", path); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *unregister_watcher(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct heartrate_adapter *hradapter = data; - struct watcher *watcher; - const char *sender = dbus_message_get_sender(msg); - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(hradapter->watchers, sender, path); - if (watcher == NULL) - return btd_error_does_not_exist(msg); - - hradapter->watchers = g_slist_remove(hradapter->watchers, watcher); - g_dbus_remove_watch(conn, watcher->id); - - if (g_slist_length(hradapter->watchers) == 0) - g_slist_foreach(hradapter->devices, disable_measurement, 0); - - DBG("heartrate watcher [%s] unregistered", path); - - return dbus_message_new_method_return(msg); -} - -static const GDBusMethodTable heartrate_manager_methods[] = { - { GDBUS_METHOD("RegisterWatcher", - GDBUS_ARGS({ "agent", "o" }), NULL, - register_watcher) }, - { GDBUS_METHOD("UnregisterWatcher", - GDBUS_ARGS({ "agent", "o" }), NULL, - unregister_watcher) }, - { } -}; - -static gboolean property_get_location(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct heartrate *hr = data; - char *loc; - - if (!hr->has_location) - return FALSE; - - loc = g_strdup(location2str(hr->location)); - - if (loc == NULL) - return FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &loc); - - g_free(loc); - - return TRUE; -} - -static gboolean property_exists_location(const GDBusPropertyTable *property, - void *data) -{ - struct heartrate *hr = data; - - if (!hr->has_location || location2str(hr->location) == NULL) - return FALSE; - - return TRUE; -} - -static gboolean property_get_reset_supported(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct heartrate *hr = data; - dbus_bool_t has_reset = !!hr->hrcp_val_handle; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &has_reset); - - return TRUE; -} - -static DBusMessage *hrcp_reset(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct heartrate *hr = data; - uint8_t value; - char *vmsg; - - if (!hr->hrcp_val_handle) - return btd_error_not_supported(msg); - - if (!hr->attrib) - return btd_error_not_available(msg); - - value = 0x01; - vmsg = g_strdup("Reset Control Point"); - gatt_write_char(hr->attrib, hr->hrcp_val_handle, &value, - sizeof(value), char_write_cb, vmsg); - - DBG("Energy Expended Value has been reset"); - - return dbus_message_new_method_return(msg); -} - -static const GDBusMethodTable heartrate_device_methods[] = { - { GDBUS_METHOD("Reset", NULL, NULL, hrcp_reset) }, - { } -}; - -static const GDBusPropertyTable heartrate_device_properties[] = { - { "Location", "s", property_get_location, NULL, - property_exists_location }, - { "ResetSupported", "b", property_get_reset_supported }, - { } -}; - -static int heartrate_adapter_register(struct btd_adapter *adapter) -{ - struct heartrate_adapter *hradapter; - - hradapter = g_new0(struct heartrate_adapter, 1); - hradapter->adapter = adapter; - - if (!g_dbus_register_interface(btd_get_dbus_connection(), - adapter_get_path(adapter), - HEART_RATE_MANAGER_INTERFACE, - heartrate_manager_methods, - NULL, NULL, hradapter, - destroy_heartrate_adapter)) { - error("D-Bus failed to register %s interface", - HEART_RATE_MANAGER_INTERFACE); - destroy_heartrate_adapter(hradapter); - return -EIO; - } - - heartrate_adapters = g_slist_prepend(heartrate_adapters, hradapter); - - return 0; -} - -static void heartrate_adapter_unregister(struct btd_adapter *adapter) -{ - struct heartrate_adapter *hradapter; - - hradapter = find_heartrate_adapter(adapter); - if (hradapter == NULL) - return; - - heartrate_adapters = g_slist_remove(heartrate_adapters, hradapter); - - g_dbus_unregister_interface(btd_get_dbus_connection(), - adapter_get_path(hradapter->adapter), - HEART_RATE_MANAGER_INTERFACE); -} - -static int heartrate_device_register(struct btd_device *device, - struct gatt_primary *prim) -{ - struct btd_adapter *adapter; - struct heartrate_adapter *hradapter; - struct heartrate *hr; - - adapter = device_get_adapter(device); - - hradapter = find_heartrate_adapter(adapter); - - if (hradapter == NULL) - return -1; - - hr = g_new0(struct heartrate, 1); - hr->dev = btd_device_ref(device); - hr->hradapter = hradapter; - - if (!g_dbus_register_interface(btd_get_dbus_connection(), - device_get_path(device), - HEART_RATE_INTERFACE, - heartrate_device_methods, - NULL, - heartrate_device_properties, - hr, destroy_heartrate)) { - error("D-Bus failed to register %s interface", - HEART_RATE_INTERFACE); - destroy_heartrate(hr); - return -EIO; - } - - hr->svc_range = g_new0(struct att_range, 1); - hr->svc_range->start = prim->range.start; - hr->svc_range->end = prim->range.end; - - hradapter->devices = g_slist_prepend(hradapter->devices, hr); - - hr->attioid = btd_device_add_attio_callback(device, attio_connected_cb, - attio_disconnected_cb, hr); - - return 0; -} - -static void heartrate_device_unregister(struct btd_device *device) -{ - struct btd_adapter *adapter; - struct heartrate_adapter *hradapter; - struct heartrate *hr; - GSList *l; - - adapter = device_get_adapter(device); - - hradapter = find_heartrate_adapter(adapter); - if (hradapter == NULL) - return; - - l = g_slist_find_custom(hradapter->devices, device, cmp_device); - if (l == NULL) - return; - - hr = l->data; - - hradapter->devices = g_slist_remove(hradapter->devices, hr); - - g_dbus_unregister_interface(btd_get_dbus_connection(), - device_get_path(device), HEART_RATE_INTERFACE); -} - -static int heartrate_adapter_probe(struct btd_profile *p, - struct btd_adapter *adapter) -{ - return heartrate_adapter_register(adapter); -} - -static void heartrate_adapter_remove(struct btd_profile *p, - struct btd_adapter *adapter) -{ - heartrate_adapter_unregister(adapter); -} - -static int heartrate_device_probe(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct gatt_primary *prim; - - prim = btd_device_get_primary(device, HEART_RATE_UUID); - if (prim == NULL) - return -EINVAL; - - return heartrate_device_register(device, prim); -} - -static void heartrate_device_remove(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - - heartrate_device_unregister(device); -} - -static struct btd_profile hrp_profile = { - .name = "Heart Rate GATT Driver", - .remote_uuid = HEART_RATE_UUID, - - .device_probe = heartrate_device_probe, - .device_remove = heartrate_device_remove, - - .adapter_probe = heartrate_adapter_probe, - .adapter_remove = heartrate_adapter_remove, -}; - -static int heartrate_init(void) -{ - return btd_profile_register(&hrp_profile); -} - -static void heartrate_exit(void) -{ - btd_profile_unregister(&hrp_profile); -} - -BLUETOOTH_PLUGIN_DEFINE(heartrate, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - heartrate_init, heartrate_exit) diff --git a/profiles/iap/main.c b/profiles/iap/main.c old mode 100644 new mode 100755 diff --git a/profiles/input/device.c b/profiles/input/device.c old mode 100644 new mode 100755 index c84445a..a494ea2 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -87,9 +87,6 @@ struct input_device { uint8_t report_req_pending; guint report_req_timer; uint32_t report_rsp_id; -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - char *role; -#endif }; static int idle_timeout = 0; @@ -311,6 +308,7 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data if (hidp_recv_intr_data(chan, idev) && (cond == G_IO_IN)) return TRUE; } + ba2str(&idev->dst, address); DBG("Device %s disconnected", address); @@ -335,12 +333,8 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data btd_service_disconnecting_complete(idev->service, 0); /* Enter the auto-reconnect mode if needed */ -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (idev->role == NULL) - input_device_enter_reconnect_mode(idev); -#else input_device_enter_reconnect_mode(idev); -#endif + return FALSE; } @@ -528,6 +522,7 @@ static gboolean ctrl_watch_cb(GIOChannel *chan, GIOCondition cond, gpointer data /* Close interrupt channel */ if (idev->intr_io && !(cond & G_IO_NVAL)) g_io_channel_shutdown(idev->intr_io, TRUE, NULL); + return FALSE; } @@ -1007,21 +1002,10 @@ cleanup: static bool is_connected(struct input_device *idev) { -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (idev->role == NULL) { - if (idev->uhid) - return (idev->intr_io != NULL && idev->ctrl_io != NULL); - else - return ioctl_is_connected(idev); - } else { - return (idev->intr_io != NULL && idev->ctrl_io != NULL); - } -#else if (idev->uhid) return (idev->intr_io != NULL && idev->ctrl_io != NULL); else return ioctl_is_connected(idev); -#endif } static int connection_disconnect(struct input_device *idev, uint32_t flags) @@ -1032,14 +1016,9 @@ static int connection_disconnect(struct input_device *idev, uint32_t flags) /* Standard HID disconnect */ if (idev->intr_io) g_io_channel_shutdown(idev->intr_io, TRUE, NULL); - if (idev->ctrl_io) g_io_channel_shutdown(idev->ctrl_io, TRUE, NULL); -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (idev->role != NULL) - btd_service_disconnecting_complete(idev->service, 0); -#endif if (idev->uhid) return 0; else @@ -1052,17 +1031,10 @@ static int input_device_connected(struct input_device *idev) if (idev->intr_io == NULL || idev->ctrl_io == NULL) return -ENOTCONN; -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (idev->role == NULL) { - err = hidp_add_connection(idev); - if (err < 0) - return err; - } -#else + err = hidp_add_connection(idev); if (err < 0) return err; -#endif btd_service_connecting_complete(idev->service, 0); @@ -1080,19 +1052,11 @@ static void interrupt_connect_cb(GIOChannel *chan, GError *conn_err, err = -EIO; goto failed; } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (idev->role == NULL) { - err = input_device_connected(idev); - if (err < 0) - goto failed; - } else { - btd_service_connecting_complete(idev->service, 0); - } -#else + err = input_device_connected(idev); if (err < 0) goto failed; -#endif + if (idev->uhid) cond |= G_IO_IN; @@ -1145,6 +1109,7 @@ static void control_connect_cb(GIOChannel *chan, GError *conn_err, g_error_free(err); goto failed; } + idev->intr_io = io; if (idev->uhid) @@ -1265,9 +1230,7 @@ int input_device_connect(struct btd_service *service) DBG(""); idev = btd_service_get_user_data(service); -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - DBG("Role=%s", idev->role); -#endif + if (idev->ctrl_io) return -EBUSY; @@ -1288,9 +1251,7 @@ int input_device_disconnect(struct btd_service *service) flags = device_is_temporary(idev->device) ? (1 << HIDP_VIRTUAL_CABLE_UNPLUG) : 0; -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - DBG("Role=%s", idev->role); -#endif + err = connection_disconnect(idev, flags); if (err < 0) return err; @@ -1367,27 +1328,6 @@ static struct input_device *input_device_new(struct btd_service *service) return idev; } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -static struct input_device *input_device_role_new(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - const char *path = device_get_path(device); - struct btd_adapter *adapter = device_get_adapter(device); - struct input_device *idev; - - idev = g_new0(struct input_device, 1); - bacpy(&idev->src, btd_adapter_get_address(adapter)); - bacpy(&idev->dst, device_get_address(device)); - idev->service = btd_service_ref(service); - idev->device = btd_device_ref(device); - idev->path = g_strdup(path); - idev->role = g_strdup("device"); - idev->disable_sdp = 0; - idev->uhid = NULL; - return idev; -} -#endif - static gboolean property_get_reconnect_mode( const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) @@ -1405,37 +1345,6 @@ static const GDBusPropertyTable input_properties[] = { { } }; -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -static DBusMessage *hid_device_fd(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct input_device *idev = user_data; - GError *gerr = NULL; - DBusMessage *reply; - int ctrl_fd = -1; - int intr_fd = -1; - if (idev->ctrl_io == NULL || idev->intr_io == NULL) { - DBG("Return error reply"); - reply = g_dbus_create_error(msg, ERROR_INTERFACE ".InputError", - "%s", "NotConnected"); - g_error_free(gerr); - } else { - ctrl_fd = g_io_channel_unix_get_fd(idev->ctrl_io); - intr_fd = g_io_channel_unix_get_fd(idev->intr_io); - reply = g_dbus_create_reply(msg, DBUS_TYPE_UNIX_FD, - &ctrl_fd, DBUS_TYPE_UNIX_FD, &intr_fd ,DBUS_TYPE_INVALID); - } - - return reply; -} -static const GDBusMethodTable input_device_methods[] = { - { GDBUS_ASYNC_METHOD("GetFD", - NULL, GDBUS_ARGS({ "fd", "h" } , {"fd", "h"}), - hid_device_fd) }, - { } -}; -#endif - int input_device_register(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); @@ -1472,34 +1381,6 @@ int input_device_register(struct btd_service *service) return 0; } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -int input_device_role_register(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - const char *path = device_get_path(device); - struct input_device *idev; - - DBG("%s", path); - - idev = input_device_role_new(service); - if (!idev) - return -EINVAL; - if (g_dbus_register_interface(btd_get_dbus_connection(), - idev->path, INPUT_INTERFACE, - input_device_methods, NULL, - NULL, idev, - NULL) == FALSE) { - error("Unable to register %s interface", INPUT_INTERFACE); - input_device_free(idev); - return -EINVAL; - } - btd_service_set_user_data(service, idev); - - return 0; -} - -#endif - static struct input_device *find_device(const bdaddr_t *src, const bdaddr_t *dst) { @@ -1517,25 +1398,6 @@ static struct input_device *find_device(const bdaddr_t *src, return btd_service_get_user_data(service); } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -static struct input_device *find_device_role(const bdaddr_t *src, - const bdaddr_t *dst) -{ - struct btd_device *device; - struct btd_service *service; - - device = btd_adapter_find_device(adapter_find(src), dst, BDADDR_BREDR); - if (device == NULL) - return NULL; - - service = btd_device_get_service(device, HID_DEVICE_UUID); - if (service == NULL) - return NULL; - - return btd_service_get_user_data(service); -} -#endif - void input_device_unregister(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); @@ -1550,19 +1412,6 @@ void input_device_unregister(struct btd_service *service) input_device_free(idev); } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -void input_device_role_unregister(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - const char *path = device_get_path(device); - struct input_device *idev = btd_service_get_user_data(service); - - DBG("%s", path); - - input_device_free(idev); -} -#endif - static int input_device_connadd(struct input_device *idev) { int err; @@ -1594,16 +1443,6 @@ bool input_device_exists(const bdaddr_t *src, const bdaddr_t *dst) return false; } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -bool input_device_role_exists(const bdaddr_t *src, const bdaddr_t *dst) -{ - if (find_device_role(src, dst)) - return true; - - return false; -} -#endif - int input_device_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm, GIOChannel *io) { @@ -1641,58 +1480,6 @@ int input_device_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm, return 0; } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -int input_device_role_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm, - GIOChannel *io) -{ - struct input_device *idev = find_device_role(src, dst); - GIOCondition cond = G_IO_HUP | G_IO_ERR | G_IO_NVAL; - - DBG("idev %p psm %d", idev, psm); - - if (!idev) - return -ENOENT; - - switch (psm) { - case L2CAP_PSM_HIDP_CTRL: - if (idev->ctrl_io) - return -EALREADY; - idev->ctrl_io = g_io_channel_ref(io); - idev->ctrl_watch = g_io_add_watch(idev->ctrl_io, cond, - ctrl_watch_cb, idev); - break; - case L2CAP_PSM_HIDP_INTR: - if (idev->intr_io) - return -EALREADY; - idev->intr_io = g_io_channel_ref(io); - idev->intr_watch = g_io_add_watch(idev->intr_io, cond, - intr_watch_cb, idev); - break; - } - if (idev->intr_io && idev->ctrl_io) { - btd_service_connecting_complete(idev->service, 0); - } - return 0; -} - -int input_device_role_close_channels(const bdaddr_t *src, const bdaddr_t *dst) -{ - struct input_device *idev = find_device(src, dst); - - if (!idev) - return -ENOENT; - - if (idev->intr_io) - g_io_channel_shutdown(idev->intr_io, TRUE, NULL); - - if (idev->ctrl_io) - g_io_channel_shutdown(idev->ctrl_io, TRUE, NULL); - - return 0; -} - -#endif - int input_device_close_channels(const bdaddr_t *src, const bdaddr_t *dst) { struct input_device *idev = find_device(src, dst); diff --git a/profiles/input/device.h b/profiles/input/device.h old mode 100644 new mode 100755 index 20aba31..51a9aee --- a/profiles/input/device.h +++ b/profiles/input/device.h @@ -33,15 +33,6 @@ void input_enable_userspace_hid(bool state); int input_device_register(struct btd_service *service); void input_device_unregister(struct btd_service *service); -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -int input_device_role_register(struct btd_service *service); -void input_device_role_unregister(struct btd_service *service); -bool input_device_role_exists(const bdaddr_t *src, const bdaddr_t *dst); -int input_device_role_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm, - GIOChannel *io); -int input_device_role_close_channels(const bdaddr_t *src, const bdaddr_t *dst); -#endif - bool input_device_exists(const bdaddr_t *src, const bdaddr_t *dst); int input_device_set_channel(const bdaddr_t *src, const bdaddr_t *dst, int psm, GIOChannel *io); diff --git a/profiles/input/hidp_defs.h b/profiles/input/hidp_defs.h old mode 100644 new mode 100755 diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c old mode 100644 new mode 100755 index 1df1799..e376c2b --- a/profiles/input/hog-lib.c +++ b/profiles/input/hog-lib.c @@ -315,8 +315,6 @@ static void report_value_cb(const guint8 *pdu, guint16 len, gpointer user_data) error("bt_uhid_send: %s (%d)", strerror(-err), -err); return; } - - DBG("HoG report (%u bytes)", ev.u.input.size); } static void report_ccc_written_cb(guint8 status, const guint8 *pdu, @@ -1020,7 +1018,7 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen, return; } - strcpy((char *) ev.u.create.name, hog->name); + strncpy((char *) ev.u.create.name, hog->name, sizeof(ev.u.create.name)); ev.u.create.vendor = hog->vendor; ev.u.create.product = hog->product; ev.u.create.version = hog->version; diff --git a/profiles/input/hog-lib.h b/profiles/input/hog-lib.h old mode 100644 new mode 100755 diff --git a/profiles/input/hog.c b/profiles/input/hog.c old mode 100644 new mode 100755 index 4dba83f..9836a6c --- a/profiles/input/hog.c +++ b/profiles/input/hog.c @@ -54,7 +54,6 @@ #include "suspend.h" #include "attrib/att.h" #include "attrib/gattrib.h" -#include "src/attio.h" #include "attrib/gatt.h" #include "hog-lib.h" @@ -69,24 +68,6 @@ struct hog_device { static gboolean suspend_supported = FALSE; static struct queue *devices = NULL; -static void attio_connected_cb(GAttrib *attrib, gpointer user_data) -{ - struct hog_device *dev = user_data; - - DBG("HoG connected"); - - bt_hog_attach(dev->hog, attrib); -} - -static void attio_disconnected_cb(gpointer user_data) -{ - struct hog_device *dev = user_data; - - DBG("HoG disconnected"); - - bt_hog_detach(dev->hog); -} - static struct hog_device *hog_device_new(struct btd_device *device, struct gatt_primary *prim) { @@ -107,17 +88,13 @@ static struct hog_device *hog_device_new(struct btd_device *device, product, version); dev = new0(struct hog_device, 1); - dev->device = btd_device_ref(device); dev->hog = bt_hog_new_default(name, vendor, product, version, prim); + if (!dev->hog) { + free(dev); + return NULL; + } - /* - * TODO: Remove attio callback and use .accept once using - * bt_gatt_client. - */ - dev->attioid = btd_device_add_attio_callback(device, - attio_connected_cb, - attio_disconnected_cb, - dev); + dev->device = btd_device_ref(device); if (!devices) devices = queue_new(); @@ -137,7 +114,6 @@ static void hog_device_free(void *data) devices = NULL; } - btd_device_remove_attio_callback(dev->device, dev->attioid); btd_device_unref(dev->device); bt_hog_unref(dev->hog); free(dev); @@ -189,6 +165,9 @@ static int hog_probe(struct btd_service *service) continue; dev = hog_device_new(device, prim); + if (!dev) + break; + btd_service_set_user_data(service, dev); return 0; } @@ -207,11 +186,39 @@ static void hog_remove(struct btd_service *service) hog_device_free(dev); } +static int hog_accept(struct btd_service *service) +{ + struct hog_device *dev = btd_service_get_user_data(service); + struct btd_device *device = btd_service_get_device(service); + GAttrib *attrib = btd_device_get_attrib(device); + + /* TODO: Replace GAttrib with bt_gatt_client */ + bt_hog_attach(dev->hog, attrib); + + btd_service_connecting_complete(service, 0); + + return 0; +} + +static int hog_disconnect(struct btd_service *service) +{ + struct hog_device *dev = btd_service_get_user_data(service); + + bt_hog_detach(dev->hog); + + btd_service_disconnecting_complete(service, 0); + + return 0; +} + static struct btd_profile hog_profile = { .name = "input-hog", .remote_uuid = HOG_UUID, .device_probe = hog_probe, .device_remove = hog_remove, + .accept = hog_accept, + .disconnect = hog_disconnect, + .auto_connect = true, }; static int hog_init(void) diff --git a/profiles/input/input.conf b/profiles/input/input.conf old mode 100644 new mode 100755 diff --git a/profiles/input/manager.c b/profiles/input/manager.c old mode 100644 new mode 100755 index 6d96c86..1d31b06 --- a/profiles/input/manager.c +++ b/profiles/input/manager.c @@ -53,19 +53,7 @@ static void hid_server_remove(struct btd_profile *p, { server_stop(btd_adapter_get_address(adapter)); } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -static int hid_device_probe(struct btd_profile *p, struct btd_adapter *adapter) -{ - DBG("hid device probe"); - return server_start(btd_adapter_get_address(adapter)); -} -static void hid_device_remove(struct btd_profile *p, - struct btd_adapter *adapter) -{ - server_stop(btd_adapter_get_address(adapter)); -} -#endif static struct btd_profile input_profile = { .name = "input-hid", .local_uuid = HID_UUID, @@ -81,23 +69,7 @@ static struct btd_profile input_profile = { .adapter_probe = hid_server_probe, .adapter_remove = hid_server_remove, }; -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -static struct btd_profile input_device_profile = { - .name = "hid-device", - .local_uuid = HID_DEVICE_UUID, - .remote_uuid = HID_DEVICE_UUID, - .auto_connect = false, - .connect = input_device_connect, - .disconnect = input_device_disconnect, - - .device_probe = input_device_role_register, - .device_remove = input_device_role_unregister, - - .adapter_probe = hid_device_probe, - .adapter_remove = hid_device_remove, -}; -#endif static GKeyFile *load_config_file(const char *file) { GKeyFile *keyfile; @@ -145,9 +117,7 @@ static int input_init(void) } btd_profile_register(&input_profile); -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - btd_profile_register(&input_device_profile); -#endif + if (config) g_key_file_free(config); @@ -157,9 +127,6 @@ static int input_init(void) static void input_exit(void) { btd_profile_unregister(&input_profile); -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - btd_profile_unregister(&input_device_profile); -#endif } BLUETOOTH_PLUGIN_DEFINE(input, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, diff --git a/profiles/input/server.c b/profiles/input/server.c old mode 100644 new mode 100755 index 2ee3b9b..eb3fcf8 --- a/profiles/input/server.c +++ b/profiles/input/server.c @@ -57,9 +57,6 @@ struct input_server { GIOChannel *ctrl; GIOChannel *intr; struct confirm_data *confirm; -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - char *role; -#endif }; static int server_cmp(gconstpointer s, gconstpointer user_data) @@ -185,14 +182,7 @@ static void connect_event_cb(GIOChannel *chan, GError *err, gpointer data) sixaxis_browse_sdp(&src, &dst, chan, psm); return; } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (ret == -ENOENT) { - DBG("Connection request for device role"); - ret = input_device_role_set_channel(&src, &dst, psm, chan); - if (ret == 0) - return; - } -#endif + error("Refusing input device connect: %s (%d)", strerror(-ret), -ret); /* Send unplug virtual cable to unknown devices */ @@ -218,15 +208,8 @@ static void auth_callback(DBusError *derr, void *user_data) } if (!input_device_exists(&server->src, &confirm->dst) && - !dev_is_sixaxis(&server->src, &confirm->dst)) { -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (!input_device_role_exists(&server->src, &confirm->dst)) { - return; - } -#else + !dev_is_sixaxis(&server->src, &confirm->dst)) return; -#endif - } if (!bt_io_accept(confirm->io, connect_event_cb, server, NULL, &err)) { error("bt_io_accept: %s", err->message); @@ -277,15 +260,8 @@ static void confirm_event_cb(GIOChannel *chan, gpointer user_data) } if (!input_device_exists(&src, &dst) && !dev_is_sixaxis(&src, &dst)) { -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (!input_device_role_exists(&src, &dst)) { - error("Refusing connection from %s: unknown device", addr); - goto drop; - } -#else error("Refusing connection from %s: unknown device", addr); goto drop; -#endif } server->confirm = g_new0(struct confirm_data, 1); @@ -368,59 +344,3 @@ void server_stop(const bdaddr_t *src) servers = g_slist_remove(servers, server); g_free(server); } - -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -int server_device_start(const bdaddr_t *src) -{ - struct input_server *server; - GError *err = NULL; - - server = g_new0(struct input_server, 1); - bacpy(&server->src, src); - - server->ctrl = bt_io_listen(connect_event_cb, NULL, - server, NULL, &err, - BT_IO_OPT_SOURCE_BDADDR, src, - BT_IO_OPT_PSM, L2CAP_PSM_HIDP_CTRL, - BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW, - BT_IO_OPT_INVALID); - if (!server->ctrl) { - error("Failed to listen on control channel"); - } - - server->intr = bt_io_listen(NULL, confirm_event_cb, - server, NULL, &err, - BT_IO_OPT_SOURCE_BDADDR, src, - BT_IO_OPT_PSM, L2CAP_PSM_HIDP_INTR, - BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW, - BT_IO_OPT_INVALID); - if (!server->intr) { - error("Failed to listen on interrupt channel"); - } - server->role = strdup("device"); - servers = g_slist_append(servers, server); - - return 0; -} - -void server_device_stop(const bdaddr_t *src) -{ - struct input_server *server; - GSList *l; - - l = g_slist_find_custom(servers, src, server_cmp); - if (!l) - return; - - server = l->data; - - g_io_channel_shutdown(server->intr, TRUE, NULL); - g_io_channel_unref(server->intr); - - g_io_channel_shutdown(server->ctrl, TRUE, NULL); - g_io_channel_unref(server->ctrl); - g_free(server->role); - servers = g_slist_remove(servers, server); - g_free(server); -} -#endif diff --git a/profiles/input/server.h b/profiles/input/server.h old mode 100644 new mode 100755 diff --git a/profiles/input/suspend-dummy.c b/profiles/input/suspend-dummy.c old mode 100644 new mode 100755 diff --git a/profiles/input/suspend-none.c b/profiles/input/suspend-none.c old mode 100644 new mode 100755 diff --git a/profiles/input/suspend.h b/profiles/input/suspend.h old mode 100644 new mode 100755 diff --git a/profiles/input/uhid_copy.h b/profiles/input/uhid_copy.h old mode 100644 new mode 100755 diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c old mode 100644 new mode 100755 index 86d1eb9..9bf0b18 --- a/profiles/network/bnep.c +++ b/profiles/network/bnep.c @@ -54,19 +54,6 @@ static int ctl; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -/* Compatibility with old ioctls */ -#define OLD_BNEPCONADD 1 -#define OLD_BNEPCONDEL 2 -#define OLD_BNEPGETCONLIST 3 -#define OLD_BNEPGETCONINFO 4 - -static unsigned long bnepconnadd; -static unsigned long bnepconndel; -static unsigned long bnepgetconnlist; -static unsigned long bnepgetconninfo; -#endif - struct __service_16 { uint16_t dst; uint16_t src; @@ -101,30 +88,7 @@ int bnep_init(void) return err; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -/* Temporary ioctl compatibility hack */ -{ - struct bnep_connlist_req req; - struct bnep_conninfo ci[1]; - - req.cnum = 1; - req.ci = ci; - - if (!ioctl(ctl, BNEPGETCONNLIST, &req)) { - /* New ioctls */ - bnepconnadd = BNEPCONNADD; - bnepconndel = BNEPCONNDEL; - bnepgetconnlist = BNEPGETCONNLIST; - bnepgetconninfo = BNEPGETCONNINFO; - } else { - /* Old ioctls */ - bnepconnadd = OLD_BNEPCONADD; - bnepconndel = OLD_BNEPCONDEL; - bnepgetconnlist = OLD_BNEPGETCONLIST; - bnepgetconninfo = OLD_BNEPGETCONINFO; - } -} -#endif + return 0; } @@ -215,11 +179,6 @@ static int bnep_if_down(const char *devname) sk = socket(AF_INET, SOCK_DGRAM, 0); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (sk < 0) - return -1; -#endif - memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, devname, IF_NAMESIZE - 1); @@ -461,12 +420,11 @@ void bnep_disconnect(struct bnep *session) if (!session) return; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (session->watch > 0) { g_source_remove(session->watch); session->watch = 0; } -#endif + if (session->io) { g_io_channel_unref(session->io); session->io = NULL; @@ -476,7 +434,6 @@ void bnep_disconnect(struct bnep *session) bnep_conndel(&session->dst_addr); } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY static int bnep_add_to_bridge(const char *devname, const char *bridge) { int ifindex; @@ -491,15 +448,7 @@ static int bnep_add_to_bridge(const char *devname, const char *bridge) sk = socket(AF_INET, SOCK_STREAM, 0); if (sk < 0) return -1; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - err = ioctl(sk, SIOCBRADDBR, bridge); - if (err < 0) - { - info("bridge create err: %d", err); - close(sk); - return -errno; - } -#endif + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, bridge, IFNAMSIZ - 1); ifr.ifr_ifindex = ifindex; @@ -516,7 +465,6 @@ static int bnep_add_to_bridge(const char *devname, const char *bridge) return err; } -#endif static int bnep_del_from_bridge(const char *devname, const char *bridge) { @@ -654,20 +602,6 @@ static uint16_t bnep_setup_decode(int sk, struct bnep_setup_conn_req *req, return BNEP_CONN_INVALID_DST; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int bnep_if_down_wrapper(const char *devname) -{ - bnep_if_down(devname); - return 0; -} - -int bnep_conndel_wrapper(const bdaddr_t *dst) -{ - bnep_conndel(dst); - return 0; -} -#endif - static int bnep_server_add_legacy(int sk, uint16_t dst, char *bridge, char *iface, const bdaddr_t *addr, uint8_t *setup_data, int len) @@ -688,14 +622,12 @@ static int bnep_server_add_legacy(int sk, uint16_t dst, char *bridge, goto reply; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY err = bnep_add_to_bridge(iface, bridge); if (err < 0) { bnep_conndel(addr); rsp = BNEP_CONN_NOT_ALLOWED; goto reply; } -#endif err = bnep_if_up(iface); if (err < 0) { @@ -765,11 +697,9 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr, goto failed; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY err = bnep_add_to_bridge(iface, bridge); if (err < 0) goto failed_conn; -#endif err = bnep_if_up(iface); if (err < 0) @@ -780,9 +710,7 @@ int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr, failed_bridge: bnep_del_from_bridge(iface, bridge); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY failed_conn: -#endif bnep_conndel(addr); return err; diff --git a/profiles/network/bnep.h b/profiles/network/bnep.h old mode 100644 new mode 100755 index d34ed03..e9f4c1c --- a/profiles/network/bnep.h +++ b/profiles/network/bnep.h @@ -40,7 +40,3 @@ void bnep_disconnect(struct bnep *session); int bnep_server_add(int sk, char *bridge, char *iface, const bdaddr_t *addr, uint8_t *setup_data, int len); void bnep_server_delete(char *bridge, char *iface, const bdaddr_t *addr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int bnep_if_down_wrapper(const char *devname); -int bnep_conndel_wrapper(const bdaddr_t *dst); -#endif diff --git a/profiles/network/connection.c b/profiles/network/connection.c old mode 100644 new mode 100755 index 53d35fe..5305ace --- a/profiles/network/connection.c +++ b/profiles/network/connection.c @@ -123,14 +123,12 @@ static void bnep_disconn_cb(gpointer data) DBusConnection *conn = btd_get_dbus_connection(); const char *path = device_get_path(nc->peer->device); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY g_dbus_emit_property_changed(conn, path, NETWORK_PEER_INTERFACE, "Connected"); g_dbus_emit_property_changed(conn, path, NETWORK_PEER_INTERFACE, "Interface"); g_dbus_emit_property_changed(conn, path, NETWORK_PEER_INTERFACE, "UUID"); -#endif device_remove_disconnect_watch(nc->peer->device, nc->dc_id); nc->dc_id = 0; @@ -139,14 +137,6 @@ static void bnep_disconn_cb(gpointer data) info("%s disconnected", nc->dev); nc->state = DISCONNECTED; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_dbus_emit_property_changed(conn, path, - NETWORK_PEER_INTERFACE, "Connected"); - g_dbus_emit_property_changed(conn, path, - NETWORK_PEER_INTERFACE, "Interface"); - g_dbus_emit_property_changed(conn, path, - NETWORK_PEER_INTERFACE, "UUID"); -#endif memset(nc->dev, 0, sizeof(nc->dev)); strncpy(nc->dev, BNEP_INTERFACE, 16); nc->dev[15] = '\0'; @@ -189,10 +179,9 @@ static void cancel_connection(struct network_conn *nc, int err) if (nc->state == CONNECTED) bnep_disconnect(nc->session); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY bnep_free(nc->session); nc->session = NULL; -#endif + nc->state = DISCONNECTED; } @@ -237,9 +226,6 @@ static void bnep_conn_cb(char *iface, int err, void *data) conn = btd_get_dbus_connection(); path = device_get_path(nc->peer->device); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - nc->state = CONNECTED; -#endif g_dbus_emit_property_changed(conn, path, NETWORK_PEER_INTERFACE, "Connected"); g_dbus_emit_property_changed(conn, path, @@ -247,9 +233,7 @@ static void bnep_conn_cb(char *iface, int err, void *data) g_dbus_emit_property_changed(conn, path, NETWORK_PEER_INTERFACE, "UUID"); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY nc->state = CONNECTED; -#endif nc->dc_id = device_add_disconnect_watch(nc->peer->device, disconnect_cb, nc, NULL); diff --git a/profiles/network/connection.h b/profiles/network/connection.h old mode 100644 new mode 100755 diff --git a/profiles/network/manager.c b/profiles/network/manager.c old mode 100644 new mode 100755 diff --git a/profiles/network/network.conf b/profiles/network/network.conf old mode 100644 new mode 100755 diff --git a/profiles/network/server.c b/profiles/network/server.c old mode 100644 new mode 100755 index 814bb24..e69ffaf --- a/profiles/network/server.c +++ b/profiles/network/server.c @@ -86,11 +86,6 @@ struct network_server { static GSList *adapters = NULL; static gboolean security = TRUE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean server_disconnected_cb(GIOChannel *chan, - GIOCondition cond, gpointer user_data); -#endif - static struct network_adapter *find_adapter(GSList *list, struct btd_adapter *adapter) { @@ -156,38 +151,6 @@ static struct network_server *find_server_by_uuid(GSList *list, return NULL; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static struct network_session *find_session(GSList *list, GIOChannel *io) -{ - GSList *l; - - for (l = list; l; l = l->next) { - struct network_session *session = l->data; - - if (session && session->io == io) - return session; - } - - return NULL; -} - -static struct network_session *find_session_by_addr(GSList *list, - bdaddr_t dst_addr) -{ - GSList *l; - - for (l = list; l; l = l->next) { - struct network_session *session = l->data; - - if (!bacmp(&session->dst, &dst_addr)) - return session; - - } - - return NULL; -} -#endif - static sdp_record_t *server_record_new(const char *name, uint16_t id) { sdp_list_t *svclass, *pfseq, *apseq, *root, *aproto; @@ -197,13 +160,8 @@ static sdp_record_t *server_record_new(const char *name, uint16_t id) sdp_data_t *v, *p; uint16_t psm = BNEP_PSM, version = 0x0100; uint16_t security_desc = (security ? 0x0001 : 0x0000); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint16_t net_access_type = 0x000a; - uint32_t max_net_access_rate = 0x001312d0; -#else uint16_t net_access_type = 0xfffe; uint32_t max_net_access_rate = 0; -#endif const char *desc = "Network service"; sdp_record_t *record; @@ -345,56 +303,6 @@ static void setup_destroy(void *user_data) session_free(setup); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean server_disconnected_cb(GIOChannel *chan, - GIOCondition cond, gpointer user_data) -{ - struct network_server *ns = NULL; - struct network_session *session = NULL; - char address[20] = {0}; - const char* paddr = address; - char *name_str = NULL; - - info("server_disconnected_cb"); - - if (!user_data) - return FALSE; - - ns = (struct network_server *) user_data; - - session = find_session(ns->sessions, chan); - if (session) { - name_str = g_strdup(session->dev); - ba2str(&session->dst, address); - } else { - info("Session is not exist!"); - name_str = g_strdup("bnep"); - } - - g_dbus_emit_signal(btd_get_dbus_connection(), - adapter_get_path(ns->na->adapter), - NETWORK_SERVER_INTERFACE, "PeerDisconnected", - DBUS_TYPE_STRING, &name_str, - DBUS_TYPE_STRING, &paddr, - DBUS_TYPE_INVALID); - - if (session) { - ns->sessions = g_slist_remove(ns->sessions, session); - session_free(session); - } - - if (g_slist_length(ns->sessions) == 0 && - name_str != NULL) { - bnep_if_down_wrapper(name_str); - ns->sessions = NULL; - } - - g_free(name_str); - - return FALSE; -} -#endif - static gboolean bnep_setup(GIOChannel *chan, GIOCondition cond, gpointer user_data) { @@ -473,30 +381,6 @@ static gboolean bnep_setup(GIOChannel *chan, packet, n) < 0) error("BNEP server cannot be added"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -if (ns) { - /* Emit connected signal to BT application */ - const gchar *adapter_path = adapter_get_path(na->adapter); - const char *pdev = na->setup->dev; - char address[24] = { 0 }; - char *paddr = address; - - ba2str(&na->setup->dst, paddr); - - ns->sessions = g_slist_append(ns->sessions, na->setup); - - g_dbus_emit_signal(btd_get_dbus_connection(), adapter_path, - NETWORK_SERVER_INTERFACE, "PeerConnected", - DBUS_TYPE_STRING, &pdev, - DBUS_TYPE_STRING, &paddr, - DBUS_TYPE_INVALID); - - na->setup->watch = g_io_add_watch_full(chan, G_PRIORITY_DEFAULT, - G_IO_HUP | G_IO_ERR | G_IO_NVAL, - server_disconnected_cb, ns, NULL); -} -#endif - na->setup = NULL; return FALSE; @@ -546,7 +430,6 @@ reject: static void confirm_event(GIOChannel *chan, gpointer user_data) { struct network_adapter *na = user_data; - struct network_server *ns; bdaddr_t src, dst; char address[18]; GError *err = NULL; @@ -570,8 +453,7 @@ static void confirm_event(GIOChannel *chan, gpointer user_data) goto drop; } - ns = find_server(na->servers, BNEP_SVC_NAP); - if (!ns || !ns->record_id || !ns->bridge) + if (!na->servers) goto drop; na->setup = g_new0(struct network_session, 1); @@ -633,11 +515,9 @@ static void server_remove_sessions(struct network_server *ns) bnep_server_delete(ns->bridge, session->dev, &session->dst); } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY g_slist_free_full(ns->sessions, session_free); ns->sessions = NULL; -#endif } static void server_disconnect(DBusConnection *conn, void *user_data) @@ -710,11 +590,6 @@ static DBusMessage *unregister_server(DBusConnection *conn, if (!ns) return btd_error_failed(msg, "Invalid UUID"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!ns->record_id) - return btd_error_not_available(msg); -#endif - reply = dbus_message_new_method_return(msg); if (!reply) return NULL; @@ -770,94 +645,6 @@ static void path_unregister(void *data) adapter_free(na); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *disconnect_device(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct network_adapter *na = data; - struct network_server *ns; - struct network_session *session; - const char *addr = NULL; - bdaddr_t dst_addr; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &addr, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - ns = find_server(na->servers, BNEP_SVC_NAP); - - str2ba(addr, &dst_addr); - session = find_session_by_addr(ns->sessions, dst_addr); - - if (session == NULL) - return btd_error_failed(msg, "No active session"); - - if (session->io == NULL) - return btd_error_not_connected(msg); - - bnep_if_down_wrapper(session->dev); - bnep_conndel_wrapper(&dst_addr); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *get_properties(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct network_adapter *na = data; - struct network_server *ns; - struct network_session *session; - const char *addr = NULL; - bdaddr_t dst_addr; - DBusMessage *reply; - DBusMessageIter iter; - DBusMessageIter dict; - dbus_bool_t connected; - const char *property; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &addr, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - reply = dbus_message_new_method_return(msg); - if (!reply) - return NULL; - - dbus_message_iter_init_append(reply, &iter); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - ns = find_server(na->servers, BNEP_SVC_NAP); - - str2ba(addr, &dst_addr); - session = find_session_by_addr(ns->sessions, dst_addr); - - connected = (session && session->io) ? TRUE : FALSE; - dict_append_entry(&dict, "Connected", DBUS_TYPE_BOOLEAN, &connected); - - /* Interface */ - property = session ? session->dev : ""; - dict_append_entry(&dict, "Interface", DBUS_TYPE_STRING, &property); - - dbus_message_iter_close_container(&iter, &dict); - - return reply; -} -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static GDBusSignalTable server_signals[] = { - { GDBUS_SIGNAL("PeerConnected", - GDBUS_ARGS({ "device", "s" }, { "address", "s" })) }, - { GDBUS_SIGNAL("PeerDisconnected", - GDBUS_ARGS({ "device", "s" }, { "address", "s" })) }, - { } -}; -#endif - static const GDBusMethodTable server_methods[] = { { GDBUS_METHOD("Register", GDBUS_ARGS({ "uuid", "s" }, { "bridge", "s" }), NULL, @@ -865,15 +652,6 @@ static const GDBusMethodTable server_methods[] = { { GDBUS_METHOD("Unregister", GDBUS_ARGS({ "uuid", "s" }), NULL, unregister_server) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_METHOD("Disconnect", - GDBUS_ARGS({ "address", "s" }), NULL, - disconnect_device) }, - { GDBUS_METHOD("GetProperties", - GDBUS_ARGS({ "address", "s" }), - GDBUS_ARGS({ "properties", "a{sv}" }), - get_properties) }, -#endif { } }; @@ -931,7 +709,6 @@ int server_register(struct btd_adapter *adapter, uint16_t id) if (g_slist_length(na->servers) > 0) goto done; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (!g_dbus_register_interface(btd_get_dbus_connection(), path, NETWORK_SERVER_INTERFACE, server_methods, NULL, NULL, na, @@ -941,20 +718,6 @@ int server_register(struct btd_adapter *adapter, uint16_t id) server_free(ns); return -1; } -#else - ns->sessions = NULL; - - if (!g_dbus_register_interface(btd_get_dbus_connection(), - path, NETWORK_SERVER_INTERFACE, - server_methods, server_signals, - NULL, - na, path_unregister)) { - error("D-Bus failed to register %s interface", - NETWORK_SERVER_INTERFACE); - server_free(ns); - return -1; - } -#endif DBG("Registered interface %s on path %s", NETWORK_SERVER_INTERFACE, path); diff --git a/profiles/network/server.h b/profiles/network/server.h old mode 100644 new mode 100755 diff --git a/profiles/proximity/immalert.c b/profiles/proximity/immalert.c deleted file mode 100644 index adf9140..0000000 --- a/profiles/proximity/immalert.c +++ /dev/null @@ -1,458 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Texas Instruments Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/log.h" -#include "src/adapter.h" -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" -#include "attrib/att-database.h" -#include "attrib/gatt-service.h" -#include "src/attrib-server.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/attio.h" -#include "src/dbus-common.h" - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "src/shared/queue.h" -#include "src/shared/gatt-db.h" -#include "src/shared/att.h" - #include "btio/btio.h" -#include "src/gatt-database.h" -#endif - -#include "reporter.h" -#include "immalert.h" - -struct imm_alert_adapter { - struct btd_adapter *adapter; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct gatt_db_attribute *imservice; -#endif - GSList *connected_devices; -}; - -struct connected_device { - struct btd_device *device; - struct imm_alert_adapter *adapter; - uint8_t alert_level; - guint callback_id; -}; - -static GSList *imm_alert_adapters; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static bool get_dest_info(struct bt_att *att, bdaddr_t *dst, uint8_t *dst_type) -{ - GIOChannel *io = NULL; - GError *gerr = NULL; - - io = g_io_channel_unix_new(bt_att_get_fd(att)); - if (!io) - return false; - - bt_io_get(io, &gerr, BT_IO_OPT_DEST_BDADDR, dst, - BT_IO_OPT_DEST_TYPE, dst_type, - BT_IO_OPT_INVALID); - - if (gerr) { - error("gatt: bt_io_get: %s", gerr->message); - g_error_free(gerr); - g_io_channel_unref(io); - return false; - } - - g_io_channel_unref(io); - return true; -} -#endif - -static int imdevice_cmp(gconstpointer a, gconstpointer b) -{ - const struct connected_device *condev = a; - const struct btd_device *device = b; - - if (condev->device == device) - return 0; - - return -1; -} - -static struct connected_device * -find_connected_device(struct imm_alert_adapter *ia, struct btd_device *device) -{ - GSList *l = g_slist_find_custom(ia->connected_devices, device, - imdevice_cmp); - if (!l) - return NULL; - - return l->data; -} - -static int imadapter_cmp(gconstpointer a, gconstpointer b) -{ - const struct imm_alert_adapter *imadapter = a; - const struct btd_adapter *adapter = b; - - if (imadapter->adapter == adapter) - return 0; - - return -1; -} - -static struct imm_alert_adapter * -find_imm_alert_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(imm_alert_adapters, adapter, - imadapter_cmp); - if (!l) - return NULL; - - return l->data; -} - -const char *imm_alert_get_level(struct btd_device *device) -{ - struct imm_alert_adapter *imadapter; - struct connected_device *condev; - - if (!device) - return get_alert_level_string(NO_ALERT); - - imadapter = find_imm_alert_adapter(device_get_adapter(device)); - if (!imadapter) - return get_alert_level_string(NO_ALERT); - - condev = find_connected_device(imadapter, device); - if (!condev) - return get_alert_level_string(NO_ALERT); - - return get_alert_level_string(condev->alert_level); -} - -static void imm_alert_emit_alert_signal(struct connected_device *condev, - uint8_t alert_level) -{ - const char *path, *alert_level_str; - - if (!condev) - return; - - path = device_get_path(condev->device); - alert_level_str = get_alert_level_string(alert_level); - - DBG("alert %s remote %s", alert_level_str, path); - - g_dbus_emit_property_changed(btd_get_dbus_connection(), path, - PROXIMITY_REPORTER_INTERFACE, "ImmediateAlertLevel"); -} - -static void imm_alert_remove_condev(struct connected_device *condev) -{ - struct imm_alert_adapter *ia; - - if (!condev) - return; - - ia = condev->adapter; - - if (condev->callback_id && condev->device) - btd_device_remove_attio_callback(condev->device, - condev->callback_id); - - if (condev->device) - btd_device_unref(condev->device); - - ia->connected_devices = g_slist_remove(ia->connected_devices, condev); - g_free(condev); -} - -/* condev can be NULL */ -static void imm_alert_disc_cb(gpointer user_data) -{ - struct connected_device *condev = user_data; - - if (!condev) - return; - - DBG("immediate alert remove device %p", condev->device); - - imm_alert_emit_alert_signal(condev, NO_ALERT); - imm_alert_remove_condev(condev); -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void imm_alert_alert_lvl_write(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - const uint8_t *value, size_t len, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - struct imm_alert_adapter *ia = user_data; - struct connected_device *condev = NULL; - uint8_t ecode = 0; - bdaddr_t bdaddr; - uint8_t bdaddr_type; - struct btd_device *device = NULL; - - if (!value || len == 0) { - ecode = BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN; - goto done; - } - - if (offset != 0) { - ecode = BT_ATT_ERROR_INVALID_OFFSET; - goto done; - } - - if (!get_dest_info(att, &bdaddr, &bdaddr_type)) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - - device = btd_adapter_get_device(ia->adapter, &bdaddr, bdaddr_type); - if (!device) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - - /* Write value should be anyone of 0x00, 0x01, 0x02 */ - if (value[0] > 0x02) { - ecode = 0x80; - goto done; - } - - /* condev might remain NULL here if nothing is found */ - condev = find_connected_device(ia, device); - - /* Register a disconnect cb if the alert level is non-zero */ - if (value[0] != NO_ALERT && !condev) { - condev = g_new0(struct connected_device, 1); - condev->device = btd_device_ref(device); - condev->adapter = ia; - condev->callback_id = btd_device_add_attio_callback(device, - NULL, imm_alert_disc_cb, condev); - ia->connected_devices = g_slist_append(ia->connected_devices, - condev); - DBG("added connected dev %p", device); - } - - if (condev) { - if (value[0] != NO_ALERT) { - condev->alert_level = value[0]; - imm_alert_emit_alert_signal(condev, value[0]); - } else { - imm_alert_emit_alert_signal(condev, value[0]); - imm_alert_disc_cb(condev); - } - } - - DBG("alert level set to %d by device %p", value[0], device); - gatt_db_attribute_write_result(attrib, id, ecode); - return; - -done: - error("Set immediate alert level for dev %p", device); - /* remove alerts by erroneous devices */ - imm_alert_disc_cb(condev); - gatt_db_attribute_write_result(attrib, id, ecode); -} - -void imm_alert_register(struct btd_adapter *adapter) -{ - bt_uuid_t uuid; - struct imm_alert_adapter *imadapter; - struct gatt_db_attribute *service, *charc; - struct gatt_db *db; - - imadapter = g_new0(struct imm_alert_adapter, 1); - imadapter->adapter = adapter; - - imm_alert_adapters = g_slist_append(imm_alert_adapters, imadapter); - db = (struct gatt_db *) btd_gatt_database_get_db(btd_adapter_get_database(adapter)); - - /* Immediate Alert Service */ - bt_uuid16_create(&uuid, IMMEDIATE_ALERT_SVC_UUID); - service = gatt_db_add_service(db, &uuid, true, 3); - if (!service) - goto err; - - imadapter->imservice = service; - - /* - * Alert Level characteristic. - */ - bt_uuid16_create(&uuid, ALERT_LEVEL_CHR_UUID); - charc = gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_WRITE, - BT_GATT_CHRC_PROP_WRITE, - NULL, - imm_alert_alert_lvl_write, imadapter); - if (!charc) - goto err; - - gatt_db_service_set_active(service, true); - - DBG("Immediate Alert service added"); - return; -err: - DBG("Error adding Immediate Alert service"); - imm_alert_unregister(adapter); -} -#else -static uint8_t imm_alert_alert_lvl_write(struct attribute *a, - struct btd_device *device, gpointer user_data) -{ - uint8_t value; - struct imm_alert_adapter *ia = user_data; - struct connected_device *condev = NULL; - - if (!device) - goto set_error; - - condev = find_connected_device(ia, device); - - if (a->len == 0) { - DBG("Illegal alert level length"); - goto set_error; - } - - value = a->data[0]; - if (value != NO_ALERT && value != MILD_ALERT && value != HIGH_ALERT) { - DBG("Illegal alert value"); - goto set_error; - } - - /* Register a disconnect cb if the alert level is non-zero */ - if (value != NO_ALERT && !condev) { - condev = g_new0(struct connected_device, 1); - condev->device = btd_device_ref(device); - condev->adapter = ia; - condev->callback_id = btd_device_add_attio_callback(device, - NULL, imm_alert_disc_cb, condev); - ia->connected_devices = g_slist_append(ia->connected_devices, - condev); - DBG("added connected dev %p", device); - } - - if (value != NO_ALERT) { - condev->alert_level = value; - imm_alert_emit_alert_signal(condev, value); - } - - /* - * Emit NO_ALERT if the alert level was non-zero before. This is - * guaranteed when there's a condev. - */ - if (value == NO_ALERT && condev) - imm_alert_disc_cb(condev); - - DBG("alert level set to %d by device %p", value, device); - return 0; - -set_error: - error("Set immediate alert level for dev %p", device); - /* remove alerts by erroneous devices */ - imm_alert_disc_cb(condev); - return ATT_ECODE_IO; -} - -void imm_alert_register(struct btd_adapter *adapter) -{ - gboolean svc_added; - bt_uuid_t uuid; - struct imm_alert_adapter *imadapter; - - bt_uuid16_create(&uuid, IMMEDIATE_ALERT_SVC_UUID); - - imadapter = g_new0(struct imm_alert_adapter, 1); - imadapter->adapter = adapter; - - imm_alert_adapters = g_slist_append(imm_alert_adapters, imadapter); - - /* Immediate Alert Service */ - svc_added = gatt_service_add(adapter, - GATT_PRIM_SVC_UUID, &uuid, - /* Alert level characteristic */ - GATT_OPT_CHR_UUID16, ALERT_LEVEL_CHR_UUID, - GATT_OPT_CHR_PROPS, - GATT_CHR_PROP_WRITE_WITHOUT_RESP, - GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE, - imm_alert_alert_lvl_write, imadapter, - GATT_OPT_INVALID); - - if (!svc_added) { - imm_alert_unregister(adapter); - return; - } - - DBG("Immediate Alert service added"); -} -#endif - -static void remove_condev_list_item(gpointer data, gpointer user_data) -{ - struct connected_device *condev = data; - - imm_alert_remove_condev(condev); -} - -void imm_alert_unregister(struct btd_adapter *adapter) -{ - struct imm_alert_adapter *imadapter; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct gatt_db *db; -#endif - - imadapter = find_imm_alert_adapter(adapter); - if (!imadapter) - return; - - g_slist_foreach(imadapter->connected_devices, remove_condev_list_item, - NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Remove registered service */ - if (imadapter->imservice) { - db = (struct gatt_db *) btd_gatt_database_get_db(btd_adapter_get_database(adapter)); - gatt_db_remove_service(db, imadapter->imservice); - } -#endif - - imm_alert_adapters = g_slist_remove(imm_alert_adapters, imadapter); - g_free(imadapter); -} diff --git a/profiles/proximity/immalert.h b/profiles/proximity/immalert.h deleted file mode 100644 index 1a09fa9..0000000 --- a/profiles/proximity/immalert.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Texas Instruments Corporation - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -void imm_alert_register(struct btd_adapter *adapter); -void imm_alert_unregister(struct btd_adapter *adapter); -const char *imm_alert_get_level(struct btd_device *device); diff --git a/profiles/proximity/linkloss.c b/profiles/proximity/linkloss.c deleted file mode 100644 index 60b1064..0000000 --- a/profiles/proximity/linkloss.c +++ /dev/null @@ -1,547 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Texas Instruments Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/log.h" -#include "src/adapter.h" -#include "src/device.h" -#include "attrib/att-database.h" -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" -#include "attrib/gatt-service.h" -#include "src/attrib-server.h" -#include "src/service.h" -#include "src/profile.h" -#include "src/attio.h" -#include "src/dbus-common.h" - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "src/shared/queue.h" -#include "src/shared/gatt-db.h" -#include "src/shared/att.h" -#include "btio/btio.h" -#include "src/gatt-database.h" -#endif - -#include "reporter.h" -#include "linkloss.h" - -struct link_loss_adapter { - struct btd_adapter *adapter; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct gatt_db_attribute *llservice; -#else - uint16_t alert_lvl_value_handle; -#endif - GSList *connected_devices; -}; - -struct connected_device { - struct btd_device *device; - struct link_loss_adapter *adapter; - uint8_t alert_level; - guint callback_id; - guint local_disc_id; -}; - -static GSList *link_loss_adapters; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static bool get_dest_info(struct bt_att *att, bdaddr_t *dst, uint8_t *dst_type) -{ - GIOChannel *io = NULL; - GError *gerr = NULL; - - io = g_io_channel_unix_new(bt_att_get_fd(att)); - if (!io) - return false; - - bt_io_get(io, &gerr, BT_IO_OPT_DEST_BDADDR, dst, - BT_IO_OPT_DEST_TYPE, dst_type, - BT_IO_OPT_INVALID); - - if (gerr) { - error("gatt: bt_io_get: %s", gerr->message); - g_error_free(gerr); - g_io_channel_unref(io); - return false; - } - - g_io_channel_unref(io); - return true; -} -#endif - -static int lldevice_cmp(gconstpointer a, gconstpointer b) -{ - const struct connected_device *llcondev = a; - const struct btd_device *device = b; - - if (llcondev->device == device) - return 0; - - return -1; -} - -static struct connected_device * -find_connected_device(struct link_loss_adapter *la, struct btd_device *device) -{ - GSList *l = g_slist_find_custom(la->connected_devices, device, - lldevice_cmp); - if (!l) - return NULL; - - return l->data; -} - -static int lladapter_cmp(gconstpointer a, gconstpointer b) -{ - const struct link_loss_adapter *lladapter = a; - const struct btd_adapter *adapter = b; - - if (lladapter->adapter == adapter) - return 0; - - return -1; -} - -static struct link_loss_adapter * -find_link_loss_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(link_loss_adapters, adapter, - lladapter_cmp); - if (!l) - return NULL; - - return l->data; -} - -const char *link_loss_get_alert_level(struct btd_device *device) -{ - struct link_loss_adapter *lladapter; - struct connected_device *condev; - - if (!device) - return get_alert_level_string(NO_ALERT); - - lladapter = find_link_loss_adapter(device_get_adapter(device)); - if (!lladapter) - return get_alert_level_string(NO_ALERT); - - condev = find_connected_device(lladapter, device); - if (!condev) - return get_alert_level_string(NO_ALERT); - - return get_alert_level_string(condev->alert_level); -} - -static void link_loss_emit_alert_signal(struct connected_device *condev) -{ - const char *alert_level_str, *path; - - if (!condev->device) - return; - - path = device_get_path(condev->device); - alert_level_str = get_alert_level_string(condev->alert_level); - - DBG("alert %s remote %s", alert_level_str, path); - - g_dbus_emit_property_changed(btd_get_dbus_connection(), path, - PROXIMITY_REPORTER_INTERFACE, "LinkLossAlertLevel"); -} -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void link_loss_alert_lvl_read(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - struct link_loss_adapter *la = user_data; - struct connected_device *condev; - uint8_t value; - uint8_t ecode = 0; - bdaddr_t bdaddr; - uint8_t bdaddr_type; - struct btd_device *device; - - value = NO_ALERT; - - if (offset != 0) { - ecode = BT_ATT_ERROR_INVALID_OFFSET; - goto out; - } - - if (!get_dest_info(att, &bdaddr, &bdaddr_type)) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto out; - } - - device = btd_adapter_get_device(la->adapter, &bdaddr, bdaddr_type); - if (!device) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto out; - } - - condev = find_connected_device(la, device); - if (!condev) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto out; - } - - if (condev->alert_level) - value = condev->alert_level; - else - DBG("Alert Level is NULL"); - - DBG("Alert Level %d", value); -out: - gatt_db_attribute_read_result(attrib, id, ecode, &value, sizeof(value)); -} -#else -static uint8_t link_loss_alert_lvl_read(struct attribute *a, - struct btd_device *device, gpointer user_data) -{ - struct link_loss_adapter *la = user_data; - struct connected_device *condev; - uint8_t alert_level = NO_ALERT; - - if (!device) - goto out; - - condev = find_connected_device(la, device); - if (!condev) - goto out; - - alert_level = condev->alert_level; - -out: - DBG("return alert level %d for dev %p", alert_level, device); - - /* update the alert level according to the requesting device */ - attrib_db_update(la->adapter, a->handle, NULL, &alert_level, - sizeof(alert_level), NULL); - - return 0; -} -#endif - -/* condev can be NULL */ -static void link_loss_remove_condev(struct connected_device *condev) -{ - struct link_loss_adapter *la; - - if (!condev) - return; - - la = condev->adapter; - - if (condev->callback_id && condev->device) - btd_device_remove_attio_callback(condev->device, - condev->callback_id); - - if (condev->local_disc_id && condev->device) - device_remove_disconnect_watch(condev->device, - condev->local_disc_id); - - if (condev->device) - btd_device_unref(condev->device); - - la->connected_devices = g_slist_remove(la->connected_devices, condev); - g_free(condev); -} - -static void link_loss_disc_cb(gpointer user_data) -{ - struct connected_device *condev = user_data; - - DBG("alert loss disconnect device %p", condev->device); - - /* if an alert-level is set, emit a signal */ - if (condev->alert_level != NO_ALERT) - link_loss_emit_alert_signal(condev); - - /* we are open for more changes now */ - link_loss_remove_condev(condev); -} - -static void link_loss_local_disc(struct btd_device *device, - gboolean removal, void *user_data) -{ - struct connected_device *condev = user_data; - - /* no need to alert on this device - we requested disconnection */ - link_loss_remove_condev(condev); - - DBG("alert level zeroed for locally disconnecting dev %p", device); -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void link_loss_alert_lvl_write(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - const uint8_t *value, size_t len, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - struct link_loss_adapter *la = user_data; - struct connected_device *condev = NULL; - uint8_t ecode = 0; - bdaddr_t bdaddr; - uint8_t bdaddr_type; - struct btd_device *device = NULL; - - if (!value || len == 0) { - ecode = BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN; - goto done; - } - - if (offset != 0) { - ecode = BT_ATT_ERROR_INVALID_OFFSET; - goto done; - } - - if (!get_dest_info(att, &bdaddr, &bdaddr_type)) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - - device = btd_adapter_get_device(la->adapter, &bdaddr, bdaddr_type); - if (!device) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - - /* Write value should be anyone of 0x00, 0x01, 0x02 */ - if (value[0] > 0x02) { - ecode = 0x80; - goto done; - } - - /* condev might remain NULL here if nothing is found */ - condev = find_connected_device(la, device); - - /* Register a disconnect cb if the alert level is non-zero */ - if (value[0] != NO_ALERT && !condev) { - condev = g_new0(struct connected_device, 1); - condev->device = btd_device_ref(device); - condev->adapter = la; - condev->callback_id = btd_device_add_attio_callback(device, - NULL, link_loss_disc_cb, condev); - condev->local_disc_id = device_add_disconnect_watch(device, - link_loss_local_disc, condev, NULL); - - la->connected_devices = g_slist_append(la->connected_devices, - condev); - } - - if (condev) { - if (value[0] != NO_ALERT) { - condev->alert_level = value[0]; - link_loss_emit_alert_signal(condev); - } else { - link_loss_emit_alert_signal(condev); - link_loss_remove_condev(condev); - condev = NULL; - } - } - - DBG("alert level set to %d by device %p", value[0], device); - gatt_db_attribute_write_result(attrib, id, ecode); - return; -done: - DBG("Set link loss alert level for dev %p", device); - /* reset alert level on erroneous devices */ - link_loss_remove_condev(condev); - gatt_db_attribute_write_result(attrib, id, ecode); -} -#else -static uint8_t link_loss_alert_lvl_write(struct attribute *a, - struct btd_device *device, gpointer user_data) -{ - uint8_t value; - struct link_loss_adapter *la = user_data; - struct connected_device *condev = NULL; - - if (!device) - goto set_error; - - /* condev might remain NULL here if nothing is found */ - condev = find_connected_device(la, device); - - if (a->len == 0) { - DBG("Illegal alert level length"); - goto set_error; - } - - value = a->data[0]; - if (value != NO_ALERT && value != MILD_ALERT && value != HIGH_ALERT) { - DBG("Illegal alert value"); - goto set_error; - } - - /* Register a disconnect cb if the alert level is non-zero */ - if (value != NO_ALERT && !condev) { - condev = g_new0(struct connected_device, 1); - condev->device = btd_device_ref(device); - condev->adapter = la; - condev->callback_id = btd_device_add_attio_callback(device, - NULL, link_loss_disc_cb, condev); - condev->local_disc_id = device_add_disconnect_watch(device, - link_loss_local_disc, condev, NULL); - - la->connected_devices = g_slist_append(la->connected_devices, - condev); - } else if (value == NO_ALERT && condev) { - link_loss_remove_condev(condev); - condev = NULL; - } - - DBG("alert level set to %d by device %p", value, device); - - if (condev) - condev->alert_level = value; - - return 0; - -set_error: - error("Set link loss alert level for dev %p", device); - /* reset alert level on erroneous devices */ - link_loss_remove_condev(condev); - return ATT_ECODE_IO; -} -#endif - -void link_loss_register(struct btd_adapter *adapter) -{ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct gatt_db_attribute *service, *charc; - struct gatt_db *db; -#else - gboolean svc_added; -#endif - bt_uuid_t uuid; - struct link_loss_adapter *lladapter; - - bt_uuid16_create(&uuid, LINK_LOSS_SVC_UUID); - - lladapter = g_new0(struct link_loss_adapter, 1); - lladapter->adapter = adapter; - - link_loss_adapters = g_slist_append(link_loss_adapters, lladapter); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - db = (struct gatt_db *) btd_gatt_database_get_db(btd_adapter_get_database(adapter)); - - /* - * Link Loss Service - */ - service = gatt_db_add_service(db, &uuid, true, 3); - if (!service) - goto err; - - lladapter->llservice = service; - - /* - * Alert Level characteristic. - */ - bt_uuid16_create(&uuid, ALERT_LEVEL_CHR_UUID); - charc = gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, - BT_GATT_CHRC_PROP_READ | BT_GATT_CHRC_PROP_WRITE, - link_loss_alert_lvl_read, - link_loss_alert_lvl_write, lladapter); - - if (!charc) - goto err; - - gatt_db_service_set_active(service, true); -#else - /* Link Loss Service */ - svc_added = gatt_service_add(adapter, - GATT_PRIM_SVC_UUID, &uuid, - /* Alert level characteristic */ - GATT_OPT_CHR_UUID16, ALERT_LEVEL_CHR_UUID, - GATT_OPT_CHR_PROPS, - GATT_CHR_PROP_READ | GATT_CHR_PROP_WRITE, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - link_loss_alert_lvl_read, lladapter, - GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE, - link_loss_alert_lvl_write, lladapter, - GATT_OPT_CHR_VALUE_GET_HANDLE, - &lladapter->alert_lvl_value_handle, - GATT_OPT_INVALID); - - if (!svc_added) - goto err; -#endif - DBG("Link Loss service added"); - return; - -err: - error("Error adding Link Loss service"); - link_loss_unregister(adapter); -} - -static void remove_condev_list_item(gpointer data, gpointer user_data) -{ - struct connected_device *condev = data; - - link_loss_remove_condev(condev); -} - -void link_loss_unregister(struct btd_adapter *adapter) -{ - struct link_loss_adapter *lladapter; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct gatt_db *db; -#endif - - lladapter = find_link_loss_adapter(adapter); - if (!lladapter) - return; - - g_slist_foreach(lladapter->connected_devices, remove_condev_list_item, - NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Remove registered service */ - if (lladapter->llservice) { - db = (struct gatt_db *) btd_gatt_database_get_db(btd_adapter_get_database(adapter)); - gatt_db_remove_service(db, lladapter->llservice); - } -#endif - - link_loss_adapters = g_slist_remove(link_loss_adapters, lladapter); - g_free(lladapter); -} diff --git a/profiles/proximity/linkloss.h b/profiles/proximity/linkloss.h deleted file mode 100644 index 0447def..0000000 --- a/profiles/proximity/linkloss.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Texas Instruments Corporation - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -void link_loss_register(struct btd_adapter *adapter); -void link_loss_unregister(struct btd_adapter *adapter); -const char *link_loss_get_alert_level(struct btd_device *device); diff --git a/profiles/proximity/main.c b/profiles/proximity/main.c deleted file mode 100644 index 38a51f1..0000000 --- a/profiles/proximity/main.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include - -#include "gdbus/gdbus.h" - -#include "src/log.h" -#include "src/plugin.h" -#include "manager.h" - -static GKeyFile *config = NULL; - -static GKeyFile *open_config_file(const char *file) -{ - GError *gerr = NULL; - GKeyFile *keyfile; - - keyfile = g_key_file_new(); - - g_key_file_set_list_separator(keyfile, ','); - - if (!g_key_file_load_from_file(keyfile, file, 0, &gerr)) { - if (!g_error_matches(gerr, G_FILE_ERROR, G_FILE_ERROR_NOENT)) - error("Parsing %s failed: %s", file, gerr->message); - g_error_free(gerr); - g_key_file_free(keyfile); - return NULL; - } - - return keyfile; -} - -static int proximity_init(void) -{ - config = open_config_file(CONFIGDIR "/proximity.conf"); - - if (proximity_manager_init(config) < 0) - return -EIO; - - return 0; -} - -static void proximity_exit(void) -{ - if (config) - g_key_file_free(config); - - proximity_manager_exit(); -} - -BLUETOOTH_PLUGIN_DEFINE(proximity, VERSION, - BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - proximity_init, proximity_exit) diff --git a/profiles/proximity/manager.c b/profiles/proximity/manager.c deleted file mode 100644 index dbb3bda..0000000 --- a/profiles/proximity/manager.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/adapter.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/service.h" -#include "attrib/att.h" -#include "attrib/gattrib.h" -#include "attrib/gatt.h" -#include "monitor.h" -#include "reporter.h" -#include "manager.h" - -static struct enabled enabled = { - .linkloss = TRUE, - .pathloss = TRUE, - .findme = TRUE, -}; - -static int monitor_linkloss_probe(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct gatt_primary *linkloss; - - linkloss = btd_device_get_primary(device, LINK_LOSS_UUID); - if (linkloss == NULL) - return -1; - - return monitor_register_linkloss(device, &enabled, linkloss); -} - -static int monitor_immediate_probe(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct gatt_primary *immediate; - - immediate = btd_device_get_primary(device, IMMEDIATE_ALERT_UUID); - if (immediate == NULL) - return -1; - - return monitor_register_immediate(device, &enabled, immediate); -} - -static int monitor_txpower_probe(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct gatt_primary *txpower; - - txpower = btd_device_get_primary(device, TX_POWER_UUID); - if (txpower == NULL) - return -1; - - return monitor_register_txpower(device, &enabled, txpower); -} - -static void monitor_linkloss_remove(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - - monitor_unregister_linkloss(device); -} - -static void monitor_immediate_remove(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - - monitor_unregister_immediate(device); -} - -static void monitor_txpower_remove(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - - monitor_unregister_txpower(device); -} - -static struct btd_profile pxp_monitor_linkloss_profile = { - .name = "proximity-linkloss", - .remote_uuid = LINK_LOSS_UUID, - .device_probe = monitor_linkloss_probe, - .device_remove = monitor_linkloss_remove, -}; - -static struct btd_profile pxp_monitor_immediate_profile = { - .name = "proximity-immediate", - .remote_uuid = IMMEDIATE_ALERT_UUID, - .device_probe = monitor_immediate_probe, - .device_remove = monitor_immediate_remove, -}; - -static struct btd_profile pxp_monitor_txpower_profile = { - .name = "proximity-txpower", - .remote_uuid = TX_POWER_UUID, - .device_probe = monitor_txpower_probe, - .device_remove = monitor_txpower_remove, -}; - -static struct btd_profile pxp_reporter_profile = { - .name = "Proximity Reporter GATT Driver", - .remote_uuid = GATT_UUID, - .device_probe = reporter_device_probe, - .device_remove = reporter_device_remove, - - .adapter_probe = reporter_adapter_probe, - .adapter_remove = reporter_adapter_remove, -}; - -static void load_config_file(GKeyFile *config) -{ - char **list; - int i; - - if (config == NULL) - return; - - list = g_key_file_get_string_list(config, "General", "Disable", - NULL, NULL); - for (i = 0; list && list[i] != NULL; i++) { - if (g_str_equal(list[i], "FindMe")) - enabled.findme = FALSE; - else if (g_str_equal(list[i], "LinkLoss")) - enabled.linkloss = FALSE; - else if (g_str_equal(list[i], "PathLoss")) - enabled.pathloss = FALSE; - } - - g_strfreev(list); -} - -int proximity_manager_init(GKeyFile *config) -{ - load_config_file(config); - - if (btd_profile_register(&pxp_monitor_linkloss_profile) < 0) - goto fail; - - if (btd_profile_register(&pxp_monitor_immediate_profile) < 0) - goto fail; - - if (btd_profile_register(&pxp_monitor_txpower_profile) < 0) - goto fail; - - if (btd_profile_register(&pxp_reporter_profile) < 0) - goto fail; - - return 0; - -fail: - proximity_manager_exit(); - - return -1; -} - -void proximity_manager_exit(void) -{ - btd_profile_unregister(&pxp_reporter_profile); - btd_profile_unregister(&pxp_monitor_txpower_profile); - btd_profile_unregister(&pxp_monitor_immediate_profile); - btd_profile_unregister(&pxp_monitor_linkloss_profile); -} diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c deleted file mode 100644 index a583eb7..0000000 --- a/profiles/proximity/monitor.c +++ /dev/null @@ -1,822 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/dbus-common.h" -#include "src/adapter.h" -#include "src/device.h" -#include "src/error.h" -#include "src/log.h" -#include "attrib/att.h" -#include "attrib/gattrib.h" -#include "attrib/gatt.h" -#include "src/attio.h" -#include "src/textfile.h" - -#include "monitor.h" - -#define PROXIMITY_INTERFACE "org.bluez.ProximityMonitor1" - -#define ALERT_LEVEL_CHR_UUID 0x2A06 -#define POWER_LEVEL_CHR_UUID 0x2A07 - -#define IMMEDIATE_TIMEOUT 5 -#define TX_POWER_SIZE 1 - -enum { - ALERT_NONE = 0, - ALERT_MILD, - ALERT_HIGH, -}; - -struct monitor { - struct btd_device *device; - GAttrib *attrib; - struct att_range *linkloss; - struct att_range *txpower; - struct att_range *immediate; - struct enabled enabled; - char *linklosslevel; /* Link Loss Alert Level */ - char *fallbacklevel; /* Immediate fallback alert level */ - char *immediatelevel; /* Immediate Alert Level */ - char *signallevel; /* Path Loss RSSI level */ - uint16_t linklosshandle; /* Link Loss Characteristic - * Value Handle */ - uint16_t txpowerhandle; /* Tx Characteristic Value Handle */ - uint16_t immediatehandle; /* Immediate Alert Value Handle */ - guint immediateto; /* Reset Immediate Alert to "none" */ - guint attioid; -}; - -static GSList *monitors = NULL; - -static struct monitor *find_monitor(struct btd_device *device) -{ - GSList *l; - - for (l = monitors; l; l = l->next) { - struct monitor *monitor = l->data; - - if (monitor->device == device) - return monitor; - } - - return NULL; -} - -static void write_proximity_config(struct btd_device *device, const char *alert, - const char *level) -{ - char *filename; - GKeyFile *key_file; - char *data; - gsize length = 0; - - filename = btd_device_get_storage_path(device, "proximity"); - if (!filename) { - warn("Unable to get proximity storage path for device"); - return; - } - - key_file = g_key_file_new(); - g_key_file_load_from_file(key_file, filename, 0, NULL); - - if (level) - g_key_file_set_string(key_file, alert, "Level", level); - else - g_key_file_remove_group(key_file, alert, NULL); - - data = g_key_file_to_data(key_file, &length, NULL); - if (length > 0) { - create_file(filename, S_IRUSR | S_IWUSR); - g_file_set_contents(filename, data, length, NULL); - } - - g_free(data); - g_free(filename); - g_key_file_free(key_file); -} - -static char *read_proximity_config(struct btd_device *device, const char *alert) -{ - char *filename; - GKeyFile *key_file; - char *str; - - filename = btd_device_get_storage_path(device, "proximity"); - if (!filename) { - warn("Unable to get proximity storage path for device"); - return NULL; - } - - key_file = g_key_file_new(); - g_key_file_load_from_file(key_file, filename, 0, NULL); - - str = g_key_file_get_string(key_file, alert, "Level", NULL); - - g_free(filename); - g_key_file_free(key_file); - - return str; -} - -static uint8_t str2level(const char *level) -{ - if (g_strcmp0("high", level) == 0) - return ALERT_HIGH; - else if (g_strcmp0("mild", level) == 0) - return ALERT_MILD; - - return ALERT_NONE; -} - -static void linkloss_written(guint8 status, const guint8 *pdu, guint16 plen, - gpointer user_data) -{ - struct monitor *monitor = user_data; - struct btd_device *device = monitor->device; - const char *path = device_get_path(device); - - if (status != 0) { - error("Link Loss Write Request failed: %s", - att_ecode2str(status)); - return; - } - - if (!dec_write_resp(pdu, plen)) { - error("Link Loss Write Request: protocol error"); - return; - } - - DBG("Link Loss Alert Level written"); - - g_dbus_emit_property_changed(btd_get_dbus_connection(), path, - PROXIMITY_INTERFACE, "LinkLossAlertLevel"); -} - -static void char_discovered_cb(uint8_t status, GSList *characteristics, - void *user_data) -{ - struct monitor *monitor = user_data; - struct gatt_char *chr; - uint8_t value = str2level(monitor->linklosslevel); - - if (status) { - error("Discover Link Loss handle: %s", att_ecode2str(status)); - return; - } - - DBG("Setting alert level \"%s\" on Reporter", monitor->linklosslevel); - - /* Assume there is a single Alert Level characteristic */ - chr = characteristics->data; - monitor->linklosshandle = chr->value_handle; - - gatt_write_char(monitor->attrib, monitor->linklosshandle, &value, 1, - linkloss_written, monitor); -} - -static int write_alert_level(struct monitor *monitor) -{ - struct att_range *linkloss = monitor->linkloss; - bt_uuid_t uuid; - - if (monitor->linklosshandle) { - uint8_t value = str2level(monitor->linklosslevel); - - gatt_write_char(monitor->attrib, monitor->linklosshandle, - &value, 1, linkloss_written, monitor); - return 0; - } - - bt_uuid16_create(&uuid, ALERT_LEVEL_CHR_UUID); - - /* FIXME: use cache (requires service changed support) ? */ - gatt_discover_char(monitor->attrib, linkloss->start, linkloss->end, - &uuid, char_discovered_cb, monitor); - - return 0; -} - -static void tx_power_read_cb(guint8 status, const guint8 *pdu, guint16 plen, - gpointer user_data) -{ - uint8_t value[TX_POWER_SIZE]; - ssize_t vlen; - - if (status != 0) { - DBG("Tx Power Level read failed: %s", att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, plen, value, sizeof(value)); - if (vlen < 0) { - DBG("Protocol error"); - return; - } - - if (vlen != 1) { - DBG("Invalid length for TX Power value: %zd", vlen); - return; - } - - DBG("Tx Power Level: %02x", (int8_t) value[0]); -} - -static void tx_power_handle_cb(uint8_t status, GSList *characteristics, - void *user_data) -{ - struct monitor *monitor = user_data; - struct gatt_char *chr; - - if (status) { - error("Discover Tx Power handle: %s", att_ecode2str(status)); - return; - } - - chr = characteristics->data; - monitor->txpowerhandle = chr->value_handle; - - DBG("Tx Power handle: 0x%04x", monitor->txpowerhandle); - - gatt_read_char(monitor->attrib, monitor->txpowerhandle, - tx_power_read_cb, monitor); -} - -static void read_tx_power(struct monitor *monitor) -{ - struct att_range *txpower = monitor->txpower; - bt_uuid_t uuid; - - if (monitor->txpowerhandle != 0) { - gatt_read_char(monitor->attrib, monitor->txpowerhandle, - tx_power_read_cb, monitor); - return; - } - - bt_uuid16_create(&uuid, POWER_LEVEL_CHR_UUID); - - gatt_discover_char(monitor->attrib, txpower->start, txpower->end, - &uuid, tx_power_handle_cb, monitor); -} - -static gboolean immediate_timeout(gpointer user_data) -{ - struct monitor *monitor = user_data; - const char *path = device_get_path(monitor->device); - - monitor->immediateto = 0; - - if (g_strcmp0(monitor->immediatelevel, "none") == 0) - return FALSE; - - if (monitor->attrib) { - uint8_t value = ALERT_NONE; - gatt_write_cmd(monitor->attrib, monitor->immediatehandle, - &value, 1, NULL, NULL); - } - - g_free(monitor->immediatelevel); - monitor->immediatelevel = g_strdup("none"); - - - g_dbus_emit_property_changed(btd_get_dbus_connection(), path, - PROXIMITY_INTERFACE, "ImmediateAlertLevel"); - - return FALSE; -} - -static void immediate_written(gpointer user_data) -{ - struct monitor *monitor = user_data; - const char *path = device_get_path(monitor->device); - - g_free(monitor->fallbacklevel); - monitor->fallbacklevel = NULL; - - - g_dbus_emit_property_changed(btd_get_dbus_connection(), path, - PROXIMITY_INTERFACE, "ImmediateAlertLevel"); - - monitor->immediateto = g_timeout_add_seconds(IMMEDIATE_TIMEOUT, - immediate_timeout, monitor); -} - -static void write_immediate_alert(struct monitor *monitor) -{ - uint8_t value = str2level(monitor->immediatelevel); - - gatt_write_cmd(monitor->attrib, monitor->immediatehandle, &value, 1, - immediate_written, monitor); -} - -static void immediate_handle_cb(uint8_t status, GSList *characteristics, - void *user_data) -{ - struct monitor *monitor = user_data; - struct gatt_char *chr; - - if (status) { - error("Discover Immediate Alert handle: %s", - att_ecode2str(status)); - return; - } - - chr = characteristics->data; - monitor->immediatehandle = chr->value_handle; - - DBG("Immediate Alert handle: 0x%04x", monitor->immediatehandle); - - if (monitor->fallbacklevel) - write_immediate_alert(monitor); -} - -static void discover_immediate_handle(struct monitor *monitor) -{ - struct att_range *immediate = monitor->immediate; - bt_uuid_t uuid; - - bt_uuid16_create(&uuid, ALERT_LEVEL_CHR_UUID); - - gatt_discover_char(monitor->attrib, immediate->start, immediate->end, - &uuid, immediate_handle_cb, monitor); -} - -static void attio_connected_cb(GAttrib *attrib, gpointer user_data) -{ - struct monitor *monitor = user_data; - - monitor->attrib = g_attrib_ref(attrib); - - if (monitor->enabled.linkloss) - write_alert_level(monitor); - - if (monitor->enabled.pathloss) - read_tx_power(monitor); - - if (monitor->immediatehandle == 0) { - if(monitor->enabled.pathloss || monitor->enabled.findme) - discover_immediate_handle(monitor); - } else if (monitor->fallbacklevel) - write_immediate_alert(monitor); -} - -static void attio_disconnected_cb(gpointer user_data) -{ - struct monitor *monitor = user_data; - const char *path = device_get_path(monitor->device); - - g_attrib_unref(monitor->attrib); - monitor->attrib = NULL; - - if (monitor->immediateto == 0) - return; - - g_source_remove(monitor->immediateto); - monitor->immediateto = 0; - - if (g_strcmp0(monitor->immediatelevel, "none") == 0) - return; - - g_free(monitor->immediatelevel); - monitor->immediatelevel = g_strdup("none"); - - g_dbus_emit_property_changed(btd_get_dbus_connection(), path, - PROXIMITY_INTERFACE, "ImmediateAlertLevel"); -} - -static gboolean level_is_valid(const char *level) -{ - return (g_str_equal("none", level) || - g_str_equal("mild", level) || - g_str_equal("high", level)); -} - -static gboolean property_get_link_loss_level(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct monitor *monitor = data; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, - &monitor->linklosslevel); - - return TRUE; -} - -static void property_set_link_loss_level(const GDBusPropertyTable *property, - DBusMessageIter *iter, GDBusPendingPropertySet id, void *data) -{ - struct monitor *monitor = data; - const char *level; - - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - dbus_message_iter_get_basic(iter, &level); - - if (!level_is_valid(level)) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - if (g_strcmp0(monitor->linklosslevel, level) == 0) - goto done; - - g_free(monitor->linklosslevel); - monitor->linklosslevel = g_strdup(level); - - write_proximity_config(monitor->device, "LinkLossAlertLevel", level); - - if (monitor->attrib) - write_alert_level(monitor); - -done: - g_dbus_pending_property_success(id); -} - -static gboolean property_exists_link_loss_level( - const GDBusPropertyTable *property, void *data) -{ - struct monitor *monitor = data; - - if (!monitor->enabled.linkloss) - return FALSE; - - return TRUE; -} - -static gboolean property_get_immediate_alert_level( - const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct monitor *monitor = data; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, - &monitor->immediatelevel); - - return TRUE; -} - -static void property_set_immediate_alert_level( - const GDBusPropertyTable *property, DBusMessageIter *iter, - GDBusPendingPropertySet id, void *data) -{ - struct monitor *monitor = data; - struct btd_device *device = monitor->device; - const char *level; - - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - dbus_message_iter_get_basic(iter, &level); - - if (!level_is_valid(level)) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - if (g_strcmp0(monitor->immediatelevel, level) == 0) - goto done; - - if (monitor->immediateto) { - g_source_remove(monitor->immediateto); - monitor->immediateto = 0; - } - - /* Previous Immediate Alert level if connection/write fails */ - g_free(monitor->fallbacklevel); - monitor->fallbacklevel = monitor->immediatelevel; - - monitor->immediatelevel = g_strdup(level); - - /* - * Means that Link/Path Loss are disabled or there is a pending - * writting for Find Me(Immediate Alert characteristic value). - * If enabled, Path Loss always registers a connection callback - * when the Proximity Monitor starts. - */ - if (monitor->attioid == 0) - monitor->attioid = btd_device_add_attio_callback(device, - attio_connected_cb, - attio_disconnected_cb, - monitor); - else if (monitor->attrib) - write_immediate_alert(monitor); - -done: - g_dbus_pending_property_success(id); -} - -static gboolean property_exists_immediate_alert_level( - const GDBusPropertyTable *property, void *data) -{ - struct monitor *monitor = data; - - if (!(monitor->enabled.findme || monitor->enabled.pathloss)) - return FALSE; - - return TRUE; -} - -static gboolean property_get_signal_level( - const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct monitor *monitor = data; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, - &monitor->signallevel); - - return TRUE; -} - -static gboolean property_exists_signal_level(const GDBusPropertyTable *property, - void *data) -{ - struct monitor *monitor = data; - - if (!monitor->enabled.pathloss) - return FALSE; - - return TRUE; -} - -static const GDBusPropertyTable monitor_device_properties[] = { - { "LinkLossAlertLevel", "s", property_get_link_loss_level, - property_set_link_loss_level, - property_exists_link_loss_level }, - { "ImmediateAlertLevel", "s", property_get_immediate_alert_level, - property_set_immediate_alert_level, - property_exists_immediate_alert_level }, - { "SignalLevel", "s", property_get_signal_level, NULL, - property_exists_signal_level }, - { } -}; - -static void monitor_destroy(gpointer user_data) -{ - struct monitor *monitor = user_data; - - monitors = g_slist_remove(monitors, monitor); - - btd_device_unref(monitor->device); - g_free(monitor->linklosslevel); - g_free(monitor->immediatelevel); - g_free(monitor->signallevel); - g_free(monitor); -} - -static struct monitor *register_monitor(struct btd_device *device) -{ - const char *path = device_get_path(device); - struct monitor *monitor; - char *level; - - monitor = find_monitor(device); - if (monitor != NULL) - return monitor; - - level = read_proximity_config(device, "LinkLossAlertLevel"); - - monitor = g_new0(struct monitor, 1); - monitor->device = btd_device_ref(device); - monitor->linklosslevel = (level ? : g_strdup("high")); - monitor->signallevel = g_strdup("unknown"); - monitor->immediatelevel = g_strdup("none"); - - monitors = g_slist_append(monitors, monitor); - - if (g_dbus_register_interface(btd_get_dbus_connection(), path, - PROXIMITY_INTERFACE, - NULL, NULL, monitor_device_properties, - monitor, monitor_destroy) == FALSE) { - error("D-Bus failed to register %s interface", - PROXIMITY_INTERFACE); - monitor_destroy(monitor); - return NULL; - } - - DBG("Registered interface %s on path %s", PROXIMITY_INTERFACE, path); - - return monitor; -} - -static void update_monitor(struct monitor *monitor) -{ - if (monitor->txpower != NULL && monitor->immediate != NULL) - monitor->enabled.pathloss = TRUE; - else - monitor->enabled.pathloss = FALSE; - - DBG("Link Loss: %s, Path Loss: %s, FindMe: %s", - monitor->enabled.linkloss ? "TRUE" : "FALSE", - monitor->enabled.pathloss ? "TRUE" : "FALSE", - monitor->enabled.findme ? "TRUE" : "FALSE"); - - if (!monitor->enabled.linkloss && !monitor->enabled.pathloss) - return; - - if (monitor->attioid != 0) - return; - - monitor->attioid = btd_device_add_attio_callback(monitor->device, - attio_connected_cb, - attio_disconnected_cb, - monitor); -} - -int monitor_register_linkloss(struct btd_device *device, - struct enabled *enabled, - struct gatt_primary *linkloss) -{ - struct monitor *monitor; - - if (!enabled->linkloss) - return 0; - - monitor = register_monitor(device); - if (monitor == NULL) - return -1; - - monitor->linkloss = g_new0(struct att_range, 1); - monitor->linkloss->start = linkloss->range.start; - monitor->linkloss->end = linkloss->range.end; - monitor->enabled.linkloss = TRUE; - - update_monitor(monitor); - - return 0; -} - -int monitor_register_txpower(struct btd_device *device, - struct enabled *enabled, - struct gatt_primary *txpower) -{ - struct monitor *monitor; - - if (!enabled->pathloss) - return 0; - - monitor = register_monitor(device); - if (monitor == NULL) - return -1; - - monitor->txpower = g_new0(struct att_range, 1); - monitor->txpower->start = txpower->range.start; - monitor->txpower->end = txpower->range.end; - - update_monitor(monitor); - - return 0; -} - -int monitor_register_immediate(struct btd_device *device, - struct enabled *enabled, - struct gatt_primary *immediate) -{ - struct monitor *monitor; - - if (!enabled->pathloss && !enabled->findme) - return 0; - - monitor = register_monitor(device); - if (monitor == NULL) - return -1; - - monitor->immediate = g_new0(struct att_range, 1); - monitor->immediate->start = immediate->range.start; - monitor->immediate->end = immediate->range.end; - monitor->enabled.findme = enabled->findme; - - update_monitor(monitor); - - return 0; -} - -static void cleanup_monitor(struct monitor *monitor) -{ - struct btd_device *device = monitor->device; - const char *path = device_get_path(device); - - if (monitor->immediate != NULL || monitor->txpower != NULL) - return; - - if (monitor->immediateto != 0) { - g_source_remove(monitor->immediateto); - monitor->immediateto = 0; - } - - if (monitor->linkloss != NULL) - return; - - if (monitor->attioid != 0) { - btd_device_remove_attio_callback(device, monitor->attioid); - monitor->attioid = 0; - } - - if (monitor->attrib != NULL) { - g_attrib_unref(monitor->attrib); - monitor->attrib = NULL; - } - - g_dbus_unregister_interface(btd_get_dbus_connection(), path, - PROXIMITY_INTERFACE); -} - -void monitor_unregister_linkloss(struct btd_device *device) -{ - struct monitor *monitor; - - monitor = find_monitor(device); - if (monitor == NULL) - return; - - g_free(monitor->linkloss); - monitor->linkloss = NULL; - monitor->enabled.linkloss = FALSE; - - cleanup_monitor(monitor); -} - -void monitor_unregister_txpower(struct btd_device *device) -{ - struct monitor *monitor; - - monitor = find_monitor(device); - if (monitor == NULL) - return; - - g_free(monitor->txpower); - monitor->txpower = NULL; - monitor->enabled.pathloss = FALSE; - - cleanup_monitor(monitor); -} - -void monitor_unregister_immediate(struct btd_device *device) -{ - struct monitor *monitor; - - monitor = find_monitor(device); - if (monitor == NULL) - return; - - g_free(monitor->immediate); - monitor->immediate = NULL; - monitor->enabled.findme = FALSE; - monitor->enabled.pathloss = FALSE; - - cleanup_monitor(monitor); -} diff --git a/profiles/proximity/monitor.h b/profiles/proximity/monitor.h deleted file mode 100644 index d9a40c6..0000000 --- a/profiles/proximity/monitor.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -struct enabled { - gboolean linkloss; - gboolean pathloss; - gboolean findme; -}; - -int monitor_register_linkloss(struct btd_device *device, - struct enabled *enabled, - struct gatt_primary *linkloss); -int monitor_register_txpower(struct btd_device *device, - struct enabled *enabled, - struct gatt_primary *txpower); -int monitor_register_immediate(struct btd_device *device, - struct enabled *enabled, - struct gatt_primary *immediate); - -void monitor_unregister_linkloss(struct btd_device *device); -void monitor_unregister_txpower(struct btd_device *device); -void monitor_unregister_immediate(struct btd_device *device); diff --git a/profiles/proximity/proximity.conf b/profiles/proximity/proximity.conf old mode 100644 new mode 100755 diff --git a/profiles/proximity/reporter.c b/profiles/proximity/reporter.c deleted file mode 100644 index 30fc7c2..0000000 --- a/profiles/proximity/reporter.c +++ /dev/null @@ -1,330 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/log.h" -#include "src/dbus-common.h" -#include "src/adapter.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/service.h" -#include "src/shared/util.h" -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" -#include "attrib/att-database.h" -#include "src/attrib-server.h" - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "src/error.h" -#endif - -#include "reporter.h" -#include "linkloss.h" -#include "immalert.h" - -struct reporter_adapter { - struct btd_adapter *adapter; - GSList *devices; -}; - -static GSList *reporter_adapters; - -static int radapter_cmp(gconstpointer a, gconstpointer b) -{ - const struct reporter_adapter *radapter = a; - const struct btd_adapter *adapter = b; - - if (radapter->adapter == adapter) - return 0; - - return -1; -} - -static struct reporter_adapter * -find_reporter_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(reporter_adapters, adapter, - radapter_cmp); - if (!l) - return NULL; - - return l->data; -} - -const char *get_alert_level_string(uint8_t level) -{ - switch (level) { - case NO_ALERT: - return "none"; - case MILD_ALERT: - return "mild"; - case HIGH_ALERT: - return "high"; - } - - return "unknown"; -} - -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY -static void register_tx_power(struct btd_adapter *adapter) -{ - uint16_t start_handle, h; - const int svc_size = 4; - uint8_t atval[256]; - bt_uuid_t uuid; - - bt_uuid16_create(&uuid, TX_POWER_SVC_UUID); - start_handle = attrib_db_find_avail(adapter, &uuid, svc_size); - if (start_handle == 0) { - error("Not enough free handles to register service"); - return; - } - - DBG("start_handle=0x%04x", start_handle); - - h = start_handle; - - /* Primary service definition */ - bt_uuid16_create(&uuid, GATT_PRIM_SVC_UUID); - put_le16(TX_POWER_SVC_UUID, &atval[0]); - attrib_db_add(adapter, h++, &uuid, ATT_NONE, ATT_NOT_PERMITTED, atval, 2); - - /* Power level characteristic */ - bt_uuid16_create(&uuid, GATT_CHARAC_UUID); - atval[0] = GATT_CHR_PROP_READ | GATT_CHR_PROP_NOTIFY; - put_le16(h + 1, &atval[1]); - put_le16(POWER_LEVEL_CHR_UUID, &atval[3]); - attrib_db_add(adapter, h++, &uuid, ATT_NONE, ATT_NOT_PERMITTED, atval, 5); - - /* Power level value */ - bt_uuid16_create(&uuid, POWER_LEVEL_CHR_UUID); - atval[0] = 0x00; - attrib_db_add(adapter, h++, &uuid, ATT_NONE, ATT_NOT_PERMITTED, atval, 1); - - /* Client characteristic configuration */ - bt_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID); - atval[0] = 0x00; - atval[1] = 0x00; - attrib_db_add(adapter, h++, &uuid, ATT_NONE, ATT_NONE, atval, 2); - - g_assert(h - start_handle == svc_size); -} -#endif - -static gboolean property_get_link_loss_level(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - const char *level; - - level = link_loss_get_alert_level(device); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &level); - - return TRUE; -} - -static gboolean property_get_immediate_alert_level( - const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - const char *level; - - level = imm_alert_get_level(device); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &level); - - return TRUE; -} - -static const GDBusPropertyTable reporter_device_properties[] = { - { "LinkLossAlertLevel", "s", property_get_link_loss_level }, - { "ImmediateAlertLevel", "s", property_get_immediate_alert_level }, - { } -}; - -static void unregister_reporter_device(gpointer data, gpointer user_data) -{ - struct btd_device *device = data; - struct reporter_adapter *radapter = user_data; - const char *path = device_get_path(device); - - DBG("unregister on device %s", path); - - g_dbus_unregister_interface(btd_get_dbus_connection(), path, - PROXIMITY_REPORTER_INTERFACE); - - radapter->devices = g_slist_remove(radapter->devices, device); - btd_device_unref(device); -} - -static void register_reporter_device(struct btd_device *device, - struct reporter_adapter *radapter) -{ - const char *path = device_get_path(device); - - DBG("register on device %s", path); - - g_dbus_register_interface(btd_get_dbus_connection(), path, - PROXIMITY_REPORTER_INTERFACE, - NULL, NULL, reporter_device_properties, - device, NULL); - - btd_device_ref(device); - radapter->devices = g_slist_prepend(radapter->devices, device); -} - -int reporter_device_probe(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct reporter_adapter *radapter; - struct btd_adapter *adapter = device_get_adapter(device); - - radapter = find_reporter_adapter(adapter); - if (!radapter) - return -1; - - register_reporter_device(device, radapter); - - return 0; -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *register_proximity(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_adapter *adapter = user_data; - - if(adapter == NULL) { - DBG("Adapter is NULL"); - return btd_error_invalid_args(msg); - } - - link_loss_register(adapter); - imm_alert_register(adapter); - - /* TODO: TX Power service implementation - * is incomplete in BlueZ. - */ - //register_tx_power(adapter); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *unregister_proximity(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_adapter *adapter = user_data; - - if(adapter == NULL) { - DBG("Adapter is NULL"); - return btd_error_invalid_args(msg); - } - - link_loss_unregister(adapter); - imm_alert_unregister(adapter); - - return dbus_message_new_method_return(msg); -} - -static const GDBusMethodTable reporter_adapter_methods[] = { - { GDBUS_METHOD("RegisterProximity", NULL, NULL, - register_proximity) }, - { GDBUS_METHOD("UnregisterProximity", NULL, NULL, - unregister_proximity) }, - { } -}; -#endif - -void reporter_device_remove(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct reporter_adapter *radapter; - struct btd_adapter *adapter = device_get_adapter(device); - - radapter = find_reporter_adapter(adapter); - if (!radapter) - return; - - unregister_reporter_device(device, radapter); -} - -int reporter_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter) -{ - struct reporter_adapter *radapter; - - radapter = g_new0(struct reporter_adapter, 1); - radapter->adapter = adapter; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - const char *path = adapter_get_path(adapter); - - g_dbus_register_interface(btd_get_dbus_connection(), path, - PROXIMITY_REPORTER_INTERFACE, - reporter_adapter_methods, - NULL, NULL, adapter, NULL); -#else - link_loss_register(adapter); - register_tx_power(adapter); - imm_alert_register(adapter); -#endif - reporter_adapters = g_slist_prepend(reporter_adapters, radapter); - DBG("Proximity Reporter for adapter %p", adapter); - - return 0; -} - -void reporter_adapter_remove(struct btd_profile *p, - struct btd_adapter *adapter) -{ - struct reporter_adapter *radapter = find_reporter_adapter(adapter); - if (!radapter) - return; - - g_slist_foreach(radapter->devices, unregister_reporter_device, - radapter); - - link_loss_unregister(adapter); - imm_alert_unregister(adapter); - - reporter_adapters = g_slist_remove(reporter_adapters, radapter); - g_free(radapter); -} diff --git a/profiles/proximity/reporter.h b/profiles/proximity/reporter.h deleted file mode 100644 index ed2c4dc..0000000 --- a/profiles/proximity/reporter.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#define PROXIMITY_REPORTER_INTERFACE "org.bluez.ProximityReporter1" - -#define IMMEDIATE_ALERT_SVC_UUID 0x1802 -#define LINK_LOSS_SVC_UUID 0x1803 -#define TX_POWER_SVC_UUID 0x1804 -#define ALERT_LEVEL_CHR_UUID 0x2A06 -#define POWER_LEVEL_CHR_UUID 0x2A07 - -enum { - NO_ALERT = 0x00, - MILD_ALERT = 0x01, - HIGH_ALERT = 0x02, -}; - -void reporter_device_remove(struct btd_service *service); -int reporter_device_probe(struct btd_service *service); - -int reporter_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter); -void reporter_adapter_remove(struct btd_profile *p, - struct btd_adapter *adapter); - -const char *get_alert_level_string(uint8_t level); \ No newline at end of file diff --git a/profiles/sap/main.c b/profiles/sap/main.c old mode 100644 new mode 100755 diff --git a/profiles/sap/manager.c b/profiles/sap/manager.c old mode 100644 new mode 100755 diff --git a/profiles/sap/manager.h b/profiles/sap/manager.h old mode 100644 new mode 100755 diff --git a/profiles/sap/sap-dummy.c b/profiles/sap/sap-dummy.c old mode 100644 new mode 100755 diff --git a/profiles/sap/sap-u8500.c b/profiles/sap/sap-u8500.c old mode 100644 new mode 100755 diff --git a/profiles/sap/sap.h b/profiles/sap/sap.h old mode 100644 new mode 100755 diff --git a/profiles/sap/server.c b/profiles/sap/server.c old mode 100644 new mode 100755 diff --git a/profiles/sap/server.h b/profiles/sap/server.h old mode 100644 new mode 100755 diff --git a/profiles/scanparam/scan.c b/profiles/scanparam/scan.c old mode 100644 new mode 100755 index 4015b3f..0ff4a43 --- a/profiles/scanparam/scan.c +++ b/profiles/scanparam/scan.c @@ -62,8 +62,6 @@ struct scan { guint refresh_cb_id; }; -static GSList *devices; - static void scan_free(struct scan *scan) { bt_gatt_client_unregister_notify(scan->client, scan->refresh_cb_id); @@ -73,14 +71,6 @@ static void scan_free(struct scan *scan) g_free(scan); } -static int cmp_device(gconstpointer a, gconstpointer b) -{ - const struct scan *scan = a; - const struct btd_device *device = b; - - return scan->device == device ? 0 : -1; -} - static void write_scan_params(struct scan *scan) { uint8_t value[4]; @@ -140,7 +130,7 @@ static void handle_characteristic(struct gatt_db_attribute *attr, bt_uuid_t uuid, scan_interval_wind_uuid, scan_refresh_uuid; if (!gatt_db_attribute_get_char_data(attr, NULL, &value_handle, NULL, - &uuid)) { + NULL, &uuid)) { error("Failed to obtain characteristic data"); return; } @@ -175,33 +165,32 @@ static void foreach_scan_param_service(struct gatt_db_attribute *attr, gatt_db_service_foreach_char(scan->attr, handle_characteristic, scan); } +static void scan_reset(struct scan *scan) +{ + scan->attr = NULL; + gatt_db_unref(scan->db); + scan->db = NULL; + bt_gatt_client_unref(scan->client); + scan->client = NULL; +} + static int scan_param_accept(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct gatt_db *db = btd_device_get_gatt_db(device); struct bt_gatt_client *client = btd_device_get_gatt_client(device); bt_uuid_t scan_parameters_uuid; - struct scan *scan; - GSList *l; + struct scan *scan = btd_service_get_user_data(service); char addr[18]; ba2str(device_get_address(device), addr); DBG("Scan Parameters Client Driver profile accept (%s)", addr); - l = g_slist_find_custom(devices, device, cmp_device); - if (!l) { + if (!scan) { error("Scan Parameters service not handled by profile"); return -1; } - scan = l->data; - - /* Clean-up any old client/db and acquire the new ones */ - scan->attr = NULL; - gatt_db_unref(scan->db); - bt_gatt_client_unref(scan->client); - - scan->db = gatt_db_ref(db); scan->client = bt_gatt_client_ref(client); @@ -209,6 +198,25 @@ static int scan_param_accept(struct btd_service *service) gatt_db_foreach_service(db, &scan_parameters_uuid, foreach_scan_param_service, scan); + if (!scan->attr) { + error("Scan Parameters attribute not found"); + scan_reset(scan); + return -1; + } + + btd_service_connecting_complete(service, 0); + + return 0; +} + +static int scan_param_disconnect(struct btd_service *service) +{ + struct scan *scan = btd_service_get_user_data(service); + + scan_reset(scan); + + btd_service_disconnecting_complete(service, 0); + return 0; } @@ -216,21 +224,17 @@ static void scan_param_remove(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct scan *scan; - GSList *l; char addr[18]; ba2str(device_get_address(device), addr); DBG("GAP profile remove (%s)", addr); - l = g_slist_find_custom(devices, device, cmp_device); - if (!l) { + scan = btd_service_get_user_data(service); + if (!scan) { error("GAP service not handled by profile"); return; } - scan = l->data; - - devices = g_slist_remove(devices, scan); scan_free(scan); } @@ -238,16 +242,15 @@ static int scan_param_probe(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct scan *scan; - GSList *l; char addr[18]; ba2str(device_get_address(device), addr); DBG("Scan Parameters Client Driver profile probe (%s)", addr); /* Ignore, if we were probed for this device already */ - l = g_slist_find_custom(devices, device, cmp_device); - if (l) { - error("Profile probed twice for the same device!"); + scan = btd_service_get_user_data(service); + if (scan) { + error("Profile probed twice for the same service!"); return -1; } @@ -256,7 +259,7 @@ static int scan_param_probe(struct btd_service *service) return -1; scan->device = btd_device_ref(device); - devices = g_slist_append(devices, scan); + btd_service_set_user_data(service, scan); return 0; } @@ -266,6 +269,7 @@ static struct btd_profile scan_profile = { .device_probe = scan_param_probe, .device_remove = scan_param_remove, .accept = scan_param_accept, + .disconnect = scan_param_disconnect, }; static int scan_param_init(void) diff --git a/profiles/scanparam/scpp.c b/profiles/scanparam/scpp.c old mode 100644 new mode 100755 diff --git a/profiles/scanparam/scpp.h b/profiles/scanparam/scpp.h old mode 100644 new mode 100755 diff --git a/profiles/tds/manager.c b/profiles/tds/manager.c deleted file mode 100644 index 6d13ee3..0000000 --- a/profiles/tds/manager.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2016 Samsung Electronics Co. Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "lib/bluetooth.h" -#include "lib/uuid.h" -#include "src/plugin.h" - -#include "gdbus/gdbus.h" - -#include "src/adapter.h" -#include "src/profile.h" - -#include "tds.h" - -int tds_provider_adapter_probe(struct btd_profile *p, - struct btd_adapter *adapter) -{ - tds_register_provider_interface(adapter); - return 0; -} - -void tds_provider_adapter_remove(struct btd_profile *p, - struct btd_adapter *adapter) -{ - tds_unregister_provider_interface(adapter); -} - -static struct btd_profile tds_provider = { - .name = "TDS Provider GATT Driver", - .remote_uuid = GATT_UUID, - .adapter_probe = tds_provider_adapter_probe, - .adapter_remove = tds_provider_adapter_remove, -}; - -static int tds_provider_init(void) -{ - return btd_profile_register(&tds_provider); -} - -static void tds_provider_exit(void) -{ - btd_profile_unregister(&tds_provider); -} - -BLUETOOTH_PLUGIN_DEFINE(tds, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - tds_provider_init, tds_provider_exit) diff --git a/profiles/tds/tds.c b/profiles/tds/tds.c deleted file mode 100644 index 786bf3d..0000000 --- a/profiles/tds/tds.c +++ /dev/null @@ -1,785 +0,0 @@ -/* - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2016 Samsung Electronics Co. Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include - -#include - -#include -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" -#include "src/plugin.h" - -#include "gdbus/gdbus.h" - -#include "src/error.h" -#include "src/log.h" -#include "src/adapter.h" - -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" -#include "attrib/att-database.h" -#include "attrib/gatt-service.h" - -#include "src/shared/gatt-server.h" -#include "src/attrib-server.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/attio.h" -#include "src/dbus-common.h" - -#include "tds.h" - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "src/shared/queue.h" -#include "src/shared/gatt-db.h" -#include "src/shared/att.h" - #include "btio/btio.h" -#include "src/gatt-database.h" -#endif - - -#define TDS_USER_CHARACTERITIC_UUID 0x2af6 -#define TDS_USER_CHARACTERITIC_DESCRIPTOR_UUID 0x2a56 - -/* TDS Block Data */ -struct tds_block_data { - uint8_t *val; - unsigned int len; -}; - -/* pointer to User characteristic data */ -static struct tds_block_data *ptr = NULL; - -/* Adapter Instance for the provider */ -struct tds_service_adapter { - struct btd_adapter *adapter; - struct gatt_db_attribute *service; - GSList *connected_devices; -}; - -static GSList *tds_service_adapters; - -struct connected_device { - struct btd_device *device; - struct tds_service_adapter *adapter; - guint callback_id; - uint16_t gatt_chr_handle; - unsigned int timeout_id; - bool tds_control_point_ccc_enabled; -}; - -static int tds_adapter_cmp(gconstpointer a, gconstpointer b) -{ - const struct tds_service_adapter *tdsadapter = a; - const struct btd_adapter *adapter = b; - - if (tdsadapter->adapter == adapter) - return 0; - - return -1; -} - -static struct tds_service_adapter * -find_tds_service_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(tds_service_adapters, adapter, - tds_adapter_cmp); - if (!l) - return NULL; - - return l->data; -} - -static int device_cmp(gconstpointer a, gconstpointer b) -{ - const struct connected_device *condev = a; - const struct btd_device *device = b; - - if (condev->device == device) - return 0; - - return -1; -} - -static struct connected_device * -find_connected_device(struct tds_service_adapter *adapter, struct btd_device *device) -{ - GSList *l = g_slist_find_custom(adapter->connected_devices, device, - device_cmp); - if (!l) - return NULL; - - return l->data; -} - -static void indication_cfm_cb(void *user_data) -{ - struct connected_device *condev = user_data; - DBG("Received confirmation of Indication Confirmation"); - g_dbus_emit_signal(btd_get_dbus_connection(), device_get_path(condev->device), - TDS_SERVICE_PROVIDER_INTERFACE, "TdsActivationIndCnfm", - DBUS_TYPE_INVALID); -} - -static DBusMessage *tds_activation_response(DBusConnection *connection, - DBusMessage *msg, void *user_data) -{ - struct connected_device *condev = user_data; - uint8_t *value; - int32_t len = 0; - uint8_t result = 0x04; /* Operation Failed */ - int k; /* Debug */ - uint8_t *pdu = NULL; - - DBG("+"); - if (condev->tds_control_point_ccc_enabled == false) { - DBG("CCCD is disabled, can not send indication to remote device"); - return dbus_message_new_method_return(msg); - } - - if (condev->timeout_id == 0) { - DBG("Timer is not running: either no request pending or response came late!!"); - return btd_error_failed(msg, "TDS Activation Request not pending"); - } - - /* Remove & reset Timer */ - g_source_remove(condev->timeout_id); - condev->timeout_id = 0; - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_BYTE, &result, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &value, &len, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - DBG("Result [0x%x] data length [%d]", result, len); - - for(k=0; k < len ; k++) - DBG("Data[%d] = [0x%x]", k, value[k]); - - switch(result) { - case 0x00: - DBG("Success"); - break; - case 0x02: - DBG("Invalid Parameter"); - break; - case 0x03: - DBG("Unsupported Organization ID"); - break; - case 0x04: - DBG("Operation Failed"); - break; - default: - return btd_error_invalid_args(msg); - } - - pdu = g_malloc0(sizeof(uint8_t)* (2+ len)); - pdu[0] = 0x01; /* Opcode - TDS Control Point Activation Request */ - pdu[1] = result; - - if (len > 0) { - memcpy(pdu+2, value, len); - } else { - DBG("TDS Response with no parameters"); - } - - DBG("Send Indication to device [%s], chr handle [%d]", device_get_path(condev->device), condev->gatt_chr_handle); - - if (!bt_gatt_server_send_indication(btd_device_get_gatt_server(condev->device), - condev->gatt_chr_handle, - pdu, (2+len), indication_cfm_cb, condev, NULL)) - DBG("Sending Indication Failed!!"); - else - DBG("Sending Indication Successful, wait for confirmation!!"); - - g_free(pdu); - DBG("-"); - return dbus_message_new_method_return(msg); -} - -static void tds_client_remove_condev(struct connected_device *condev) -{ - struct tds_service_adapter *a; - - if (!condev) - return; - - a = condev->adapter; - - if (condev->callback_id && condev->device) - btd_device_remove_attio_callback(condev->device, - condev->callback_id); - - if (condev->device) - btd_device_unref(condev->device); - - a->connected_devices = g_slist_remove(a->connected_devices, condev); - g_free(condev); -} - -static void tds_client_disc_cb(gpointer user_data) -{ - struct connected_device *condev = user_data; - - if (!condev) - return; - - /* Unregister Interface */ - g_dbus_unregister_interface(btd_get_dbus_connection(), - device_get_path(condev->device), - TDS_SERVICE_PROVIDER_INTERFACE); - - DBG("TDS Client remove device %p", condev->device); - tds_client_remove_condev(condev); -} - -static const GDBusSignalTable tds_signals[] = { - { GDBUS_SIGNAL("TdsActivationRequested", - GDBUS_ARGS({ "org_id", "y"}, - { "TdsDataBlock", "ay"})) }, - { GDBUS_SIGNAL("TdsActivationIndCnfm", NULL) }, -}; - -static const GDBusMethodTable tds_methods[] = { - { GDBUS_ASYNC_METHOD("TdsActivationResponse", - GDBUS_ARGS({ "result", "y" }, { "response_param", "ay" }), NULL, - tds_activation_response) }, - { } -}; - -static bool indication_wait_cb(gpointer user_data) -{ - struct connected_device *condev = (struct connected_device *)user_data; - uint16_t len = 2; - uint8_t pdu[2]; - DBG("Indication Timer Expired!!"); - condev->timeout_id = 0; - - if (!condev->tds_control_point_ccc_enabled) { - DBG("CCCD is not Enabled!! No need to send indication"); - return false; - } else { - DBG("CCCD is Enabled!!..Send Indication with Operation Failed!"); - } - - pdu[0] = 0x01; /* Op Code: Activation Request */ - pdu[1] = 0x04; /* Result: Operation Failed*/ - - DBG("Send Indication to device [%s], chr handle [%d]", device_get_path(condev->device), condev->gatt_chr_handle); - - if (!bt_gatt_server_send_indication(btd_device_get_gatt_server(condev->device), - condev->gatt_chr_handle, - pdu, len, indication_cfm_cb, condev, NULL)) - DBG("Sending Indication Failed!!"); - else - DBG("Sending Indication Successful, wait for confirmation!!"); - - return false; -} - -static void tds_control_point_char_write(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - const uint8_t *value, size_t len, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - DBG("len [%d]", len); - DBG("Opcode [%d]", opcode); - DBG("TRansaction ID [%d]", id); - DBG("Offset [%d]", offset); - - uint8_t ecode = 0; - struct btd_device *device = NULL; - struct tds_service_adapter *tsadapter = user_data; - bdaddr_t bdaddr; - uint8_t bdaddr_type; - struct connected_device *condev = NULL; - int k; - const uint8_t *param = NULL; - - if (!value || len < 2) { - ecode = BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN; - goto done; - } - - if (offset != 0) { - ecode = BT_ATT_ERROR_INVALID_OFFSET; - goto done; - } - - if (!bt_att_get_remote_addr(att, &bdaddr, &bdaddr_type)) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - - device = btd_adapter_get_device(tsadapter->adapter, &bdaddr, bdaddr_type); - - if (!device) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - DBG("Device path [%s]", device_get_path(device)); - - /* Create Connected device and Register SIgnal Interface */ - condev = find_connected_device(tsadapter, device); - - if (!condev) { - DBG("Device is NULL..create device"); - condev = g_new0(struct connected_device, 1); - condev->device = btd_device_ref(device); - condev->adapter = tsadapter; - condev->callback_id = btd_device_add_attio_callback(device, - NULL, tds_client_disc_cb, condev); - - tsadapter->connected_devices = g_slist_append(tsadapter->connected_devices, - condev); - DBG("added connected dev %p", device); - /* Register Signal on Device Interface */ - if (!g_dbus_register_interface(btd_get_dbus_connection(), device_get_path(device), - TDS_SERVICE_PROVIDER_INTERFACE, - tds_methods, tds_signals, - NULL, - condev, NULL)) { - error("Unable to register TDS Activation Signal"); - tds_client_remove_condev(condev); - goto done; - } - } - - if (condev->timeout_id) { - DBG("Already one activation request is under progress from device [%s]", device_get_path(device)); - ecode = BT_ERROR_ALREADY_IN_PROGRESS; - goto done; - } - - condev->gatt_chr_handle = gatt_db_attribute_get_handle(attrib); - DBG("Characteristic Attribute handle [0x%x]", condev->gatt_chr_handle); - - /* Write value should be anyone of 0x00, 0x01, 0x02 */ - switch(value[0]) { - case 0x00: { - DBG("Opcode reserved for future use"); - ecode = BT_ATT_ERROR_REQUEST_NOT_SUPPORTED; - goto done; - } - case 0x01: { - DBG("TDS Control Point Activation Request"); - break; - } - default: { - DBG("Invalid Opcode [0x%x]", value[0]); - ecode = 0x80; - goto done; - } - } - - for(k=0; k < len; k++) - DBG("@@TDS Control Point [%d] 0x%x", k, value[k]); - - /* Success case*/ - if (gatt_db_attribute_write_result(attrib, id, ecode)) { - DBG("TDS Control Point Activation write resp sent successfully!!"); - /* Emit Signal */ - len = len -2; - - if (len > 0) { - param = &value[2]; - } - g_dbus_emit_signal(btd_get_dbus_connection(), device_get_path(device), - TDS_SERVICE_PROVIDER_INTERFACE, "TdsActivationRequested", - DBUS_TYPE_BYTE, &value[1], - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, ¶m, len, - DBUS_TYPE_INVALID); - - /* Start timer for max 10 seconds to wait for Indication from app */ - if (condev->tds_control_point_ccc_enabled) { - DBG("Control point is enabled for device [%s] start the Indication Timer", device_get_path(device)); - if (condev->timeout_id) - g_source_remove(condev->timeout_id); - condev->timeout_id = g_timeout_add(10000, (GSourceFunc)indication_wait_cb, condev); - } else { - DBG("Control point is Not enabled for device [%s] Dont start the Indication Timer",device_get_path(device)); - } - } else { - DBG("TDS Control Point Activation write resp sending failed!!!"); - } - - return; -done: - gatt_db_attribute_write_result(attrib, id, ecode); -} - -static void tds_user_data_descriptor_read_cb(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - DBG("TDS User Characteritsic descriptor Read requested.."); - - if (!ptr) { - DBG("TDS Block data still not set"); - gatt_db_attribute_read_result(attrib, id, 0, NULL, 0); - } else { - gatt_db_attribute_read_result(attrib, id, 0, ptr->val, ptr->len); - } -} - -static void tds_control_point_ccc_read_cb(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - struct tds_service_adapter *adapter = user_data; - struct btd_device *device = NULL; - bdaddr_t bdaddr; - uint8_t bdaddr_type; - struct connected_device *condev = NULL; - uint8_t ecode = 0; - uint8_t value[2]; - DBG("TDS Control Point CCC Read requested.."); - - if (!bt_att_get_remote_addr(att, &bdaddr, &bdaddr_type)) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - - device = btd_adapter_get_device(adapter->adapter, &bdaddr, bdaddr_type); - - if (!device) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - DBG("Device path [%s]", device_get_path(device)); - - /* Create Connected device and Register Signal Interface */ - condev = find_connected_device(adapter, device); - if (!condev) { - DBG("Device is not created yet, default CCCD value is Disabled"); - value[0] = 0x00; - } else { - DBG("CCCD is [%s] for device [%s]", condev->tds_control_point_ccc_enabled ? "Enabled" : "Disabled", device_get_path(device)); - value[0] = condev->tds_control_point_ccc_enabled; - } - - value[1] = 0x00; - -done: - gatt_db_attribute_read_result(attrib, id, ecode, value, 2); -} - - -static void tds_user_char_read_cb(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - uint8_t value[1]; - DBG("TDS user char Read requested.."); - value[0] = 0x01; - gatt_db_attribute_read_result(attrib, id, 0, value, 1); -} - -static void tds_control_point_ccc_write_cb(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - const uint8_t *value, size_t len, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - struct tds_service_adapter *adapter = user_data; - struct btd_device *device = NULL; - bdaddr_t bdaddr; - uint8_t bdaddr_type; - struct connected_device *condev = NULL; - uint8_t ecode = 0; - DBG("TDS Control Point CCC Write requested..len [%d] val [0x%x] val [0x%x]", len, value[0], value[1]); - - if (!value || len != 2) { - ecode = BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN; - goto done; - } - - if (offset) { - ecode = BT_ATT_ERROR_INVALID_OFFSET; - goto done; - } - - if (!bt_att_get_remote_addr(att, &bdaddr, &bdaddr_type)) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - - device = btd_adapter_get_device(adapter->adapter, &bdaddr, bdaddr_type); - - if (!device) { - ecode = BT_ATT_ERROR_UNLIKELY; - goto done; - } - DBG("Device path [%s]", device_get_path(device)); - - /* Create Connected device and Register Signal Interface */ - condev = find_connected_device(adapter, device); - - if (!condev) { - DBG("Device is NULL..create device"); - condev = g_new0(struct connected_device, 1); - condev->device = btd_device_ref(device); - condev->adapter = adapter; - condev->callback_id = btd_device_add_attio_callback(device, - NULL, tds_client_disc_cb, condev); - - adapter->connected_devices = g_slist_append(adapter->connected_devices, - condev); - DBG("added connected dev %p", device); - - /* Register Signal on Device Interface */ - if (!g_dbus_register_interface(btd_get_dbus_connection(), device_get_path(device), - TDS_SERVICE_PROVIDER_INTERFACE, - tds_methods, tds_signals, - NULL, - condev, NULL)) { - error("Unable to register TDS Activation Signal"); - tds_client_remove_condev(condev); - goto done; - } - } - - if (value[0] == 0x00) { - DBG("CCCD is Disabled by Client [%s]", device_get_path(device)); - condev->tds_control_point_ccc_enabled = false; - } else if (value[0] == 0x02) { /* Indication */ - if (condev->tds_control_point_ccc_enabled) { - DBG("TDS Control point CCCD Already Enabled\n"); - goto done; - } - - DBG("CCCD is Enabled by Client [%s]", device_get_path(device)); - condev->tds_control_point_ccc_enabled = true; - } else - ecode = 0x80; - - DBG("TDS Server: Control Point Enabled: [%s]\n", - condev->tds_control_point_ccc_enabled ? "true" : "false"); - -done: - gatt_db_attribute_write_result(attrib, id, ecode); -} - -void tds_service_unregister(struct tds_service_adapter *tsadapter) -{ - DBG("TDS Service UnRegister.."); - struct gatt_db *db; - - /* Remove registered service */ - if (tsadapter->service) { - db = (struct gatt_db *) btd_gatt_database_get_db(btd_adapter_get_database(tsadapter->adapter)); - gatt_db_remove_service(db, tsadapter->service); - } - - if (ptr) { - g_free(ptr->val); - g_free(ptr); - ptr = NULL; - } -} - -void tds_service_register(struct tds_service_adapter *tsadapter) -{ - DBG("TDS Service Register.."); - struct gatt_db_attribute *service, *char_tds_control, *char_user_char, *desc_tds_ccc, *desc_user; - struct gatt_db *db; - - bt_uuid_t uuid; - bt_uuid16_create(&uuid, TRANSPORT_DISCOVERY_SERVICE_UUID); - - db = (struct gatt_db *) btd_gatt_database_get_db(btd_adapter_get_database(tsadapter->adapter)); - - /* - * TDS Primary Service - */ - service = gatt_db_add_service(db, &uuid, true, 7); - if (!service) - goto err; - - tsadapter->service = service; - DBG("TDS Primary Service added"); - - /* - * TDS Control Point characteristic. - */ - bt_uuid16_create(&uuid, TDS_CONTROL_POINT_CHARACTERISTIC_UUID); - char_tds_control = gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_WRITE, - BT_GATT_CHRC_PROP_WRITE | BT_GATT_CHRC_PROP_INDICATE, - NULL, /* Non Readable */ - tds_control_point_char_write, tsadapter); - - if (!char_tds_control) - goto err; - DBG("TDS Control Point char added"); - - - bt_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID); - desc_tds_ccc = gatt_db_service_add_descriptor(char_tds_control, &uuid, - BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, - tds_control_point_ccc_read_cb, - tds_control_point_ccc_write_cb, tsadapter); - - if (!desc_tds_ccc) - goto err; - DBG("TDS Control Point CCCD added"); - /* - * TDS User characteristic. - */ - bt_uuid16_create(&uuid, TDS_USER_CHARACTERITIC_UUID); - char_user_char = gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_NONE, - BT_ATT_PERM_READ, - tds_user_char_read_cb, - NULL, /* Non Writable */ - NULL); - - if (!char_user_char) - goto err; - - DBG("TDS User Characteristic added"); - bt_uuid16_create(&uuid, TDS_USER_CHARACTERITIC_DESCRIPTOR_UUID); - desc_user = gatt_db_service_add_descriptor(char_user_char, &uuid, - BT_ATT_PERM_READ, - tds_user_data_descriptor_read_cb, - NULL, /* Non Writable */ - tsadapter); - if (!desc_user) - goto err; - - DBG("TDS User Char Descriptor added..."); - gatt_db_service_set_active(service, true); - - DBG("TDS Service activated"); - return; - -err: - error("Error adding TDS service"); - tds_service_unregister(tsadapter); -} - -static DBusMessage *register_tds_proider(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - DBG("TDS Provider Register"); - struct tds_service_adapter *tsadapter = user_data; - - if (tsadapter->adapter == NULL) { - DBG("Adapter is NULL"); - return btd_error_invalid_args(msg); - } - - tds_service_register(tsadapter); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *set_tds_block_data(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - uint8_t *value; - int32_t len = 0; - - DBG("Set TDS Block data"); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &value, &len, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - /*TODO Max length to be checked*/ - if (len < 1) - return btd_error_invalid_args(msg); - - if (ptr) { - g_free(ptr->val); - g_free(ptr); - } - ptr = g_malloc0(sizeof(struct tds_block_data)); - ptr->val = g_memdup(value, len); - ptr->len = len; - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *unregister_tds_provider(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct tds_service_adapter *tsadapter = user_data; - - if (tsadapter->adapter == NULL) { - DBG("Adapter is NULL"); - return btd_error_invalid_args(msg); - } - - tds_service_unregister(tsadapter); - return dbus_message_new_method_return(msg); -} - -static const GDBusMethodTable tds_provider_adapter_methods[] = { - { GDBUS_METHOD("RegisterTdsProvider", NULL, NULL, - register_tds_proider) }, - { GDBUS_METHOD("UnregisterTdsProvider", NULL, NULL, - unregister_tds_provider) }, - { GDBUS_METHOD("SetTdsBlockData", - GDBUS_ARGS({ "value", "ay" }), NULL, - set_tds_block_data) }, - { } -}; - -void tds_unregister_provider_interface(struct btd_adapter *adapter) -{ - struct tds_service_adapter *tsadapter = find_tds_service_adapter(adapter); - if (!tsadapter) - return; - tds_service_unregister(tsadapter); - - tds_service_adapters = g_slist_remove(tds_service_adapters, tsadapter); - g_free(tsadapter); -} - -void tds_register_provider_interface(struct btd_adapter *adapter) -{ - struct tds_service_adapter *tsadapter; - const char *path = adapter_get_path(adapter); - - tsadapter = g_new0(struct tds_service_adapter, 1); - tsadapter->adapter = adapter; - - g_dbus_register_interface(btd_get_dbus_connection(), path, - TDS_SERVICE_PROVIDER_INTERFACE, - tds_provider_adapter_methods, - NULL, NULL, tsadapter, NULL); - tds_service_adapters = g_slist_append(tds_service_adapters, tsadapter); -} diff --git a/profiles/tds/tds.h b/profiles/tds/tds.h deleted file mode 100644 index 85b9b10..0000000 --- a/profiles/tds/tds.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#define TRANSPORT_DISCOVERY_SERVICE_UUID 0x1824 -#define TDS_CONTROL_POINT_CHARACTERISTIC_UUID 0x2abc - -#define TDS_USER_CHARACTERITIC_UUID 0x2af6 -#define TDS_USER_CHARACTERITIC_DESCRIPTOR_UUID 0x2a56 - -#define TDS_SERVICE_PROVIDER_INTERFACE "org.bluez.TdsServiceProvider1" - -void tds_register_provider_interface(struct btd_adapter *adapter); - -void tds_unregister_provider_interface(struct btd_adapter *adapter); diff --git a/profiles/thermometer/thermometer.c b/profiles/thermometer/thermometer.c deleted file mode 100644 index b0fc3e0..0000000 --- a/profiles/thermometer/thermometer.c +++ /dev/null @@ -1,1321 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 GSyC/LibreSoft, Universidad Rey Juan Carlos. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "gdbus/gdbus.h" - -#include "src/plugin.h" -#include "src/dbus-common.h" -#include "src/adapter.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/service.h" -#include "src/shared/util.h" -#include "src/error.h" -#include "src/log.h" -#include "attrib/gattrib.h" -#include "src/attio.h" -#include "attrib/att.h" -#include "attrib/gatt.h" - -#define THERMOMETER_INTERFACE "org.bluez.Thermometer1" -#define THERMOMETER_MANAGER_INTERFACE "org.bluez.ThermometerManager1" -#define THERMOMETER_WATCHER_INTERFACE "org.bluez.ThermometerWatcher1" - -/* Temperature measurement flag fields */ -#define TEMP_UNITS 0x01 -#define TEMP_TIME_STAMP 0x02 -#define TEMP_TYPE 0x04 - -#define FLOAT_MAX_MANTISSA 16777216 /* 2^24 */ - -#define VALID_RANGE_DESC_SIZE 4 -#define TEMPERATURE_TYPE_SIZE 1 -#define MEASUREMENT_INTERVAL_SIZE 2 - -struct thermometer_adapter { - struct btd_adapter *adapter; - GSList *devices; - GSList *fwatchers; /* Final measurements */ - GSList *iwatchers; /* Intermediate measurements */ -}; - -struct thermometer { - struct btd_device *dev; /* Device reference */ - struct thermometer_adapter *tadapter; - GAttrib *attrib; /* GATT connection */ - struct att_range *svc_range; /* Thermometer range */ - guint attioid; /* Att watcher id */ - /* attio id for Temperature Measurement value indications */ - guint attio_measurement_id; - /* attio id for Intermediate Temperature value notifications */ - guint attio_intermediate_id; - /* attio id for Measurement Interval value indications */ - guint attio_interval_id; - gboolean intermediate; - uint8_t type; - uint16_t interval; - uint16_t max; - uint16_t min; - gboolean has_type; - gboolean has_interval; - - uint16_t measurement_ccc_handle; - uint16_t intermediate_ccc_handle; - uint16_t interval_val_handle; -}; - -struct characteristic { - struct thermometer *t; /* Thermometer where the char belongs */ - char uuid[MAX_LEN_UUID_STR + 1]; -}; - -struct watcher { - struct thermometer_adapter *tadapter; - guint id; - char *srv; - char *path; -}; - -struct measurement { - struct thermometer *t; - int16_t exp; - int32_t mant; - uint64_t time; - gboolean suptime; - char *unit; - char *type; - char *value; -}; - -struct tmp_interval_data { - struct thermometer *thermometer; - uint16_t interval; -}; - -static GSList *thermometer_adapters = NULL; - -static const char * const temp_type[] = { - "", - "armpit", - "body", - "ear", - "finger", - "intestines", - "mouth", - "rectum", - "toe", - "tympanum" -}; - -static const char *temptype2str(uint8_t value) -{ - if (value > 0 && value < G_N_ELEMENTS(temp_type)) - return temp_type[value]; - - error("Temperature type %d reserved for future use", value); - return NULL; -} - -static void destroy_watcher(gpointer user_data) -{ - struct watcher *watcher = user_data; - - g_free(watcher->path); - g_free(watcher->srv); - g_free(watcher); -} - -static void remove_watcher(gpointer user_data) -{ - struct watcher *watcher = user_data; - - g_dbus_remove_watch(btd_get_dbus_connection(), watcher->id); -} - -static void destroy_thermometer(gpointer user_data) -{ - struct thermometer *t = user_data; - - if (t->attioid > 0) - btd_device_remove_attio_callback(t->dev, t->attioid); - - if (t->attrib != NULL) { - g_attrib_unregister(t->attrib, t->attio_measurement_id); - g_attrib_unregister(t->attrib, t->attio_intermediate_id); - g_attrib_unregister(t->attrib, t->attio_interval_id); - g_attrib_unref(t->attrib); - } - - btd_device_unref(t->dev); - g_free(t->svc_range); - g_free(t); -} - -static void destroy_thermometer_adapter(gpointer user_data) -{ - struct thermometer_adapter *tadapter = user_data; - - if (tadapter->devices != NULL) - g_slist_free_full(tadapter->devices, destroy_thermometer); - - if (tadapter->fwatchers != NULL) - g_slist_free_full(tadapter->fwatchers, remove_watcher); - - g_free(tadapter); -} - -static int cmp_adapter(gconstpointer a, gconstpointer b) -{ - const struct thermometer_adapter *tadapter = a; - const struct btd_adapter *adapter = b; - - if (adapter == tadapter->adapter) - return 0; - - return -1; -} - -static int cmp_device(gconstpointer a, gconstpointer b) -{ - const struct thermometer *t = a; - const struct btd_device *dev = b; - - if (dev == t->dev) - return 0; - - return -1; -} - -static int cmp_watcher(gconstpointer a, gconstpointer b) -{ - const struct watcher *watcher = a; - const struct watcher *match = b; - int ret; - - ret = g_strcmp0(watcher->srv, match->srv); - if (ret != 0) - return ret; - - return g_strcmp0(watcher->path, match->path); -} - -static struct thermometer_adapter * -find_thermometer_adapter(struct btd_adapter *adapter) -{ - GSList *l = g_slist_find_custom(thermometer_adapters, adapter, - cmp_adapter); - if (!l) - return NULL; - - return l->data; -} - -static void change_property(struct thermometer *t, const char *name, - gpointer value) { - if (g_strcmp0(name, "Intermediate") == 0) { - gboolean *intermediate = value; - if (t->intermediate == *intermediate) - return; - - t->intermediate = *intermediate; - } else if (g_strcmp0(name, "Interval") == 0) { - uint16_t *interval = value; - if (t->has_interval && t->interval == *interval) - return; - - t->has_interval = TRUE; - t->interval = *interval; - } else if (g_strcmp0(name, "Maximum") == 0) { - uint16_t *max = value; - if (t->max == *max) - return; - - t->max = *max; - } else if (g_strcmp0(name, "Minimum") == 0) { - uint16_t *min = value; - if (t->min == *min) - return; - - t->min = *min; - } else { - DBG("%s is not a thermometer property", name); - return; - } - - g_dbus_emit_property_changed(btd_get_dbus_connection(), - device_get_path(t->dev), - THERMOMETER_INTERFACE, name); -} - -static void update_watcher(gpointer data, gpointer user_data) -{ - struct watcher *w = data; - struct measurement *m = user_data; - const char *path = device_get_path(m->t->dev); - DBusMessageIter iter; - DBusMessageIter dict; - DBusMessage *msg; - - msg = dbus_message_new_method_call(w->srv, w->path, - THERMOMETER_WATCHER_INTERFACE, - "MeasurementReceived"); - if (msg == NULL) - return; - - dbus_message_iter_init_append(msg, &iter); - - dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH , &path); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - dict_append_entry(&dict, "Exponent", DBUS_TYPE_INT16, &m->exp); - dict_append_entry(&dict, "Mantissa", DBUS_TYPE_INT32, &m->mant); - dict_append_entry(&dict, "Unit", DBUS_TYPE_STRING, &m->unit); - - if (m->suptime) - dict_append_entry(&dict, "Time", DBUS_TYPE_UINT64, &m->time); - - dict_append_entry(&dict, "Type", DBUS_TYPE_STRING, &m->type); - dict_append_entry(&dict, "Measurement", DBUS_TYPE_STRING, &m->value); - - dbus_message_iter_close_container(&iter, &dict); - - dbus_message_set_no_reply(msg, TRUE); - g_dbus_send_message(btd_get_dbus_connection(), msg); -} - -static void recv_measurement(struct thermometer *t, struct measurement *m) -{ - GSList *wlist; - - m->t = t; - - if (g_strcmp0(m->value, "intermediate") == 0) - wlist = t->tadapter->iwatchers; - else - wlist = t->tadapter->fwatchers; - - g_slist_foreach(wlist, update_watcher, m); -} - -static void proc_measurement(struct thermometer *t, const uint8_t *pdu, - uint16_t len, gboolean final) -{ - struct measurement m; - const char *type = NULL; - uint8_t flags; - uint32_t raw; - - /* skip opcode and handle */ - pdu += 3; - len -= 3; - - if (len < 1) { - DBG("Mandatory flags are not provided"); - return; - } - - memset(&m, 0, sizeof(m)); - - flags = *pdu; - - if (flags & TEMP_UNITS) - m.unit = "fahrenheit"; - else - m.unit = "celsius"; - - pdu++; - len--; - - if (len < 4) { - DBG("Mandatory temperature measurement value is not provided"); - return; - } - - raw = get_le32(pdu); - m.mant = raw & 0x00FFFFFF; - m.exp = ((int32_t) raw) >> 24; - - if (m.mant & 0x00800000) { - /* convert to C2 negative value */ - m.mant = m.mant - FLOAT_MAX_MANTISSA; - } - - pdu += 4; - len -= 4; - - if (flags & TEMP_TIME_STAMP) { - struct tm ts; - time_t time; - - if (len < 7) { - DBG("Time stamp is not provided"); - return; - } - - ts.tm_year = get_le16(pdu) - 1900; - ts.tm_mon = *(pdu + 2) - 1; - ts.tm_mday = *(pdu + 3); - ts.tm_hour = *(pdu + 4); - ts.tm_min = *(pdu + 5); - ts.tm_sec = *(pdu + 6); - ts.tm_isdst = -1; - - time = mktime(&ts); - m.time = (uint64_t) time; - m.suptime = TRUE; - - pdu += 7; - len -= 7; - } - - if (flags & TEMP_TYPE) { - if (len < 1) { - DBG("Temperature type is not provided"); - return; - } - - type = temptype2str(*pdu); - } else if (t->has_type) { - type = temptype2str(t->type); - } - - m.type = g_strdup(type); - m.value = final ? "final" : "intermediate"; - - recv_measurement(t, &m); - g_free(m.type); -} - - -static void measurement_ind_handler(const uint8_t *pdu, uint16_t len, - gpointer user_data) -{ - struct thermometer *t = user_data; - uint8_t *opdu; - uint16_t olen; - size_t plen; - - if (len < 3) { - DBG("Bad pdu received"); - return; - } - - proc_measurement(t, pdu, len, TRUE); - - opdu = g_attrib_get_buffer(t->attrib, &plen); - olen = enc_confirmation(opdu, plen); - - if (olen > 0) - g_attrib_send(t->attrib, 0, opdu, olen, NULL, NULL, NULL); -} - -static void intermediate_notify_handler(const uint8_t *pdu, uint16_t len, - gpointer user_data) -{ - struct thermometer *t = user_data; - - if (len < 3) { - DBG("Bad pdu received"); - return; - } - - proc_measurement(t, pdu, len, FALSE); -} - -static void interval_ind_handler(const uint8_t *pdu, uint16_t len, - gpointer user_data) -{ - struct thermometer *t = user_data; - uint16_t interval; - uint8_t *opdu; - uint16_t olen; - size_t plen; - - if (len < 5) { - DBG("Bad pdu received"); - return; - } - - interval = get_le16(pdu + 3); - change_property(t, "Interval", &interval); - - opdu = g_attrib_get_buffer(t->attrib, &plen); - olen = enc_confirmation(opdu, plen); - - if (olen > 0) - g_attrib_send(t->attrib, 0, opdu, olen, NULL, NULL, NULL); -} - -static void valid_range_desc_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct thermometer *t = user_data; - uint8_t value[VALID_RANGE_DESC_SIZE]; - uint16_t max, min; - ssize_t vlen; - - if (status != 0) { - DBG("Valid Range descriptor read failed: %s", - att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, len, value, sizeof(value)); - if (vlen < 0) { - DBG("Protocol error\n"); - return; - } - - if (vlen < 4) { - DBG("Invalid range received"); - return; - } - - min = get_le16(&value[0]); - max = get_le16(&value[2]); - - if (min == 0 || min > max) { - DBG("Invalid range"); - return; - } - - change_property(t, "Maximum", &max); - change_property(t, "Minimum", &min); -} - -static void write_ccc_cb(guint8 status, const guint8 *pdu, - guint16 len, gpointer user_data) -{ - char *msg = user_data; - - if (status != 0) - error("%s failed", msg); - - g_free(msg); -} - -static void process_thermometer_desc(struct characteristic *ch, uint16_t uuid, - uint16_t handle) -{ - uint8_t atval[2]; - uint16_t val; - char *msg; - - if (uuid == GATT_CHARAC_VALID_RANGE_UUID) { - if (g_strcmp0(ch->uuid, MEASUREMENT_INTERVAL_UUID) == 0) - gatt_read_char(ch->t->attrib, handle, - valid_range_desc_cb, ch->t); - return; - } - - if (uuid != GATT_CLIENT_CHARAC_CFG_UUID) - return; - - if (g_strcmp0(ch->uuid, TEMPERATURE_MEASUREMENT_UUID) == 0) { - ch->t->measurement_ccc_handle = handle; - - if (g_slist_length(ch->t->tadapter->fwatchers) == 0) { - val = 0x0000; - msg = g_strdup("Disable Temperature Measurement ind"); - } else { - val = GATT_CLIENT_CHARAC_CFG_IND_BIT; - msg = g_strdup("Enable Temperature Measurement ind"); - } - } else if (g_strcmp0(ch->uuid, INTERMEDIATE_TEMPERATURE_UUID) == 0) { - ch->t->intermediate_ccc_handle = handle; - - if (g_slist_length(ch->t->tadapter->iwatchers) == 0) { - val = 0x0000; - msg = g_strdup("Disable Intermediate Temperature noti"); - } else { - val = GATT_CLIENT_CHARAC_CFG_NOTIF_BIT; - msg = g_strdup("Enable Intermediate Temperature noti"); - } - } else if (g_strcmp0(ch->uuid, MEASUREMENT_INTERVAL_UUID) == 0) { - val = GATT_CLIENT_CHARAC_CFG_IND_BIT; - msg = g_strdup("Enable Measurement Interval indication"); - } else { - return; - } - - put_le16(val, atval); - gatt_write_char(ch->t->attrib, handle, atval, sizeof(atval), - write_ccc_cb, msg); -} - -static void discover_desc_cb(guint8 status, GSList *descs, gpointer user_data) -{ - struct characteristic *ch = user_data; - - if (status != 0) { - error("Discover all characteristic descriptors failed [%s]: %s", - ch->uuid, att_ecode2str(status)); - goto done; - } - - for ( ; descs; descs = descs->next) { - struct gatt_desc *desc = descs->data; - - process_thermometer_desc(ch, desc->uuid16, desc->handle); - } - -done: - g_free(ch); -} - -static void discover_desc(struct thermometer *t, struct gatt_char *c, - struct gatt_char *c_next) -{ - struct characteristic *ch; - uint16_t start, end; - - start = c->value_handle + 1; - - if (c_next != NULL) { - if (start == c_next->handle) - return; - end = c_next->handle - 1; - } else if (c->value_handle != t->svc_range->end) { - end = t->svc_range->end; - } else { - return; - } - - ch = g_new0(struct characteristic, 1); - ch->t = t; - memcpy(ch->uuid, c->uuid, sizeof(c->uuid)); - - gatt_discover_desc(t->attrib, start, end, NULL, discover_desc_cb, ch); -} - -static void read_temp_type_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct thermometer *t = user_data; - uint8_t value[TEMPERATURE_TYPE_SIZE]; - ssize_t vlen; - - if (status != 0) { - DBG("Temperature Type value read failed: %s", - att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, len, value, sizeof(value)); - if (vlen < 0) { - DBG("Protocol error."); - return; - } - - if (vlen != 1) { - DBG("Invalid length for Temperature type"); - return; - } - - t->has_type = TRUE; - t->type = value[0]; -} - -static void read_interval_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct thermometer *t = user_data; - uint8_t value[MEASUREMENT_INTERVAL_SIZE]; - uint16_t interval; - ssize_t vlen; - - if (status != 0) { - DBG("Measurement Interval value read failed: %s", - att_ecode2str(status)); - return; - } - - vlen = dec_read_resp(pdu, len, value, sizeof(value)); - if (vlen < 0) { - DBG("Protocol error\n"); - return; - } - - if (vlen < 2) { - DBG("Invalid Interval received"); - return; - } - - interval = get_le16(&value[0]); - change_property(t, "Interval", &interval); -} - -static void process_thermometer_char(struct thermometer *t, - struct gatt_char *c, struct gatt_char *c_next) -{ - if (g_strcmp0(c->uuid, INTERMEDIATE_TEMPERATURE_UUID) == 0) { - gboolean intermediate = TRUE; - change_property(t, "Intermediate", &intermediate); - - t->attio_intermediate_id = g_attrib_register(t->attrib, - ATT_OP_HANDLE_NOTIFY, c->value_handle, - intermediate_notify_handler, t, NULL); - - discover_desc(t, c, c_next); - } else if (g_strcmp0(c->uuid, TEMPERATURE_MEASUREMENT_UUID) == 0) { - - t->attio_measurement_id = g_attrib_register(t->attrib, - ATT_OP_HANDLE_IND, c->value_handle, - measurement_ind_handler, t, NULL); - - discover_desc(t, c, c_next); - } else if (g_strcmp0(c->uuid, TEMPERATURE_TYPE_UUID) == 0) { - gatt_read_char(t->attrib, c->value_handle, - read_temp_type_cb, t); - } else if (g_strcmp0(c->uuid, MEASUREMENT_INTERVAL_UUID) == 0) { - bool need_desc = false; - - gatt_read_char(t->attrib, c->value_handle, read_interval_cb, t); - - if (c->properties & GATT_CHR_PROP_WRITE) { - t->interval_val_handle = c->value_handle; - need_desc = true; - } - - if (c->properties & GATT_CHR_PROP_INDICATE) { - t->attio_interval_id = g_attrib_register(t->attrib, - ATT_OP_HANDLE_IND, c->value_handle, - interval_ind_handler, t, NULL); - need_desc = true; - } - - if (need_desc) - discover_desc(t, c, c_next); - } -} - -static void configure_thermometer_cb(uint8_t status, GSList *characteristics, - void *user_data) -{ - struct thermometer *t = user_data; - GSList *l; - - if (status != 0) { - error("Discover thermometer characteristics: %s", - att_ecode2str(status)); - return; - } - - for (l = characteristics; l; l = l->next) { - struct gatt_char *c = l->data; - struct gatt_char *c_next = (l->next ? l->next->data : NULL); - - process_thermometer_char(t, c, c_next); - } -} - -static void write_interval_cb(guint8 status, const guint8 *pdu, guint16 len, - gpointer user_data) -{ - struct tmp_interval_data *data = user_data; - - if (status != 0) { - error("Interval Write Request failed %s", - att_ecode2str(status)); - goto done; - } - - if (!dec_write_resp(pdu, len)) { - error("Interval Write Request: protocol error"); - goto done; - } - - change_property(data->thermometer, "Interval", &data->interval); - -done: - g_free(user_data); -} - -static void enable_final_measurement(gpointer data, gpointer user_data) -{ - struct thermometer *t = data; - uint16_t handle = t->measurement_ccc_handle; - uint8_t value[2]; - char *msg; - - if (t->attrib == NULL || !handle) - return; - - put_le16(GATT_CLIENT_CHARAC_CFG_IND_BIT, value); - msg = g_strdup("Enable Temperature Measurement indications"); - - gatt_write_char(t->attrib, handle, value, sizeof(value), - write_ccc_cb, msg); -} - -static void enable_intermediate_measurement(gpointer data, gpointer user_data) -{ - struct thermometer *t = data; - uint16_t handle = t->intermediate_ccc_handle; - uint8_t value[2]; - char *msg; - - if (t->attrib == NULL || !handle) - return; - - put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value); - msg = g_strdup("Enable Intermediate Temperature notifications"); - - gatt_write_char(t->attrib, handle, value, sizeof(value), - write_ccc_cb, msg); -} - -static void disable_final_measurement(gpointer data, gpointer user_data) -{ - struct thermometer *t = data; - uint16_t handle = t->measurement_ccc_handle; - uint8_t value[2]; - char *msg; - - if (t->attrib == NULL || !handle) - return; - - put_le16(0x0000, value); - msg = g_strdup("Disable Temperature Measurement indications"); - - gatt_write_char(t->attrib, handle, value, sizeof(value), - write_ccc_cb, msg); -} - -static void disable_intermediate_measurement(gpointer data, gpointer user_data) -{ - struct thermometer *t = data; - uint16_t handle = t->intermediate_ccc_handle; - uint8_t value[2]; - char *msg; - - if (t->attrib == NULL || !handle) - return; - - put_le16(0x0000, value); - msg = g_strdup("Disable Intermediate Temperature notifications"); - - gatt_write_char(t->attrib, handle, value, sizeof(value), - write_ccc_cb, msg); -} - -static void remove_int_watcher(struct thermometer_adapter *tadapter, - struct watcher *w) -{ - if (!g_slist_find(tadapter->iwatchers, w)) - return; - - tadapter->iwatchers = g_slist_remove(tadapter->iwatchers, w); - - if (g_slist_length(tadapter->iwatchers) == 0) - g_slist_foreach(tadapter->devices, - disable_intermediate_measurement, 0); -} - -static void watcher_exit(DBusConnection *conn, void *user_data) -{ - struct watcher *watcher = user_data; - struct thermometer_adapter *tadapter = watcher->tadapter; - - DBG("Thermometer watcher %s disconnected", watcher->path); - - remove_int_watcher(tadapter, watcher); - - tadapter->fwatchers = g_slist_remove(tadapter->fwatchers, watcher); - g_dbus_remove_watch(btd_get_dbus_connection(), watcher->id); - - if (g_slist_length(tadapter->fwatchers) == 0) - g_slist_foreach(tadapter->devices, - disable_final_measurement, 0); -} - -static struct watcher *find_watcher(GSList *list, const char *sender, - const char *path) -{ - struct watcher *match; - GSList *l; - - match = g_new0(struct watcher, 1); - match->srv = g_strdup(sender); - match->path = g_strdup(path); - - l = g_slist_find_custom(list, match, cmp_watcher); - destroy_watcher(match); - - if (l != NULL) - return l->data; - - return NULL; -} - -static DBusMessage *register_watcher(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - const char *sender = dbus_message_get_sender(msg); - struct thermometer_adapter *tadapter = data; - struct watcher *watcher; - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(tadapter->fwatchers, sender, path); - if (watcher != NULL) - return btd_error_already_exists(msg); - - DBG("Thermometer watcher %s registered", path); - - watcher = g_new0(struct watcher, 1); - watcher->srv = g_strdup(sender); - watcher->path = g_strdup(path); - watcher->tadapter = tadapter; - watcher->id = g_dbus_add_disconnect_watch(conn, sender, watcher_exit, - watcher, destroy_watcher); - - if (g_slist_length(tadapter->fwatchers) == 0) - g_slist_foreach(tadapter->devices, enable_final_measurement, 0); - - tadapter->fwatchers = g_slist_prepend(tadapter->fwatchers, watcher); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *unregister_watcher(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - const char *sender = dbus_message_get_sender(msg); - struct thermometer_adapter *tadapter = data; - struct watcher *watcher; - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(tadapter->fwatchers, sender, path); - if (watcher == NULL) - return btd_error_does_not_exist(msg); - - DBG("Thermometer watcher %s unregistered", path); - - remove_int_watcher(tadapter, watcher); - - tadapter->fwatchers = g_slist_remove(tadapter->fwatchers, watcher); - g_dbus_remove_watch(btd_get_dbus_connection(), watcher->id); - - if (g_slist_length(tadapter->fwatchers) == 0) - g_slist_foreach(tadapter->devices, - disable_final_measurement, 0); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *enable_intermediate(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - const char *sender = dbus_message_get_sender(msg); - struct thermometer_adapter *ta = data; - struct watcher *watcher; - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(ta->fwatchers, sender, path); - if (watcher == NULL) - return btd_error_does_not_exist(msg); - - if (find_watcher(ta->iwatchers, sender, path)) - return btd_error_already_exists(msg); - - DBG("Intermediate measurement watcher %s registered", path); - - if (g_slist_length(ta->iwatchers) == 0) - g_slist_foreach(ta->devices, - enable_intermediate_measurement, 0); - - ta->iwatchers = g_slist_prepend(ta->iwatchers, watcher); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *disable_intermediate(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - const char *sender = dbus_message_get_sender(msg); - struct thermometer_adapter *ta = data; - struct watcher *watcher; - char *path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - watcher = find_watcher(ta->iwatchers, sender, path); - if (watcher == NULL) - return btd_error_does_not_exist(msg); - - DBG("Intermediate measurement %s unregistered", path); - - remove_int_watcher(ta, watcher); - - return dbus_message_new_method_return(msg); -} - -static gboolean property_get_intermediate(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct thermometer *t = data; - dbus_bool_t val; - - val = !!t->intermediate; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val); - - return TRUE; -} - -static gboolean property_get_interval(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct thermometer *t = data; - - if (!t->has_interval) - return FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &t->interval); - - return TRUE; -} - -static void property_set_interval(const GDBusPropertyTable *property, - DBusMessageIter *iter, - GDBusPendingPropertySet id, void *data) -{ - struct thermometer *t = data; - struct tmp_interval_data *interval_data; - uint16_t val; - uint8_t atval[2]; - - if (t->interval_val_handle == 0) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".NotSupported", - "Operation is not supported"); - return; - } - - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - dbus_message_iter_get_basic(iter, &val); - - if (val < t->min || val > t->max) { - g_dbus_pending_property_error(id, - ERROR_INTERFACE ".InvalidArguments", - "Invalid arguments in method call"); - return; - } - - put_le16(val, &atval[0]); - - interval_data = g_new0(struct tmp_interval_data, 1); - interval_data->thermometer = t; - interval_data->interval = val; - gatt_write_char(t->attrib, t->interval_val_handle, atval, sizeof(atval), - write_interval_cb, interval_data); - - g_dbus_pending_property_success(id); -} - -static gboolean property_exists_interval(const GDBusPropertyTable *property, - void *data) -{ - struct thermometer *t = data; - - return t->has_interval; -} - -static gboolean property_get_maximum(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct thermometer *t = data; - - if (!t->has_interval) - return FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &t->max); - - return TRUE; -} - -static gboolean property_get_minimum(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct thermometer *t = data; - - if (!t->has_interval) - return FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &t->min); - - return TRUE; -} - -static const GDBusPropertyTable thermometer_properties[] = { - { "Intermediate", "b", property_get_intermediate }, - { "Interval", "q", property_get_interval, property_set_interval, - property_exists_interval }, - { "Maximum", "q", property_get_maximum, NULL, - property_exists_interval }, - { "Minimum", "q", property_get_minimum, NULL, - property_exists_interval }, - { } -}; - -static void attio_connected_cb(GAttrib *attrib, gpointer user_data) -{ - struct thermometer *t = user_data; - - t->attrib = g_attrib_ref(attrib); - - gatt_discover_char(t->attrib, t->svc_range->start, t->svc_range->end, - NULL, configure_thermometer_cb, t); -} - -static void attio_disconnected_cb(gpointer user_data) -{ - struct thermometer *t = user_data; - - DBG("GATT Disconnected"); - - if (t->attio_measurement_id > 0) { - g_attrib_unregister(t->attrib, t->attio_measurement_id); - t->attio_measurement_id = 0; - } - - if (t->attio_intermediate_id > 0) { - g_attrib_unregister(t->attrib, t->attio_intermediate_id); - t->attio_intermediate_id = 0; - } - - if (t->attio_interval_id > 0) { - g_attrib_unregister(t->attrib, t->attio_interval_id); - t->attio_interval_id = 0; - } - - g_attrib_unref(t->attrib); - t->attrib = NULL; -} - -static int thermometer_register(struct btd_device *device, - struct gatt_primary *tattr) -{ - const char *path = device_get_path(device); - struct thermometer *t; - struct btd_adapter *adapter; - struct thermometer_adapter *tadapter; - - adapter = device_get_adapter(device); - - tadapter = find_thermometer_adapter(adapter); - - if (tadapter == NULL) - return -1; - - t = g_new0(struct thermometer, 1); - t->dev = btd_device_ref(device); - t->tadapter = tadapter; - t->svc_range = g_new0(struct att_range, 1); - t->svc_range->start = tattr->range.start; - t->svc_range->end = tattr->range.end; - - tadapter->devices = g_slist_prepend(tadapter->devices, t); - - if (!g_dbus_register_interface(btd_get_dbus_connection(), - path, THERMOMETER_INTERFACE, - NULL, NULL, thermometer_properties, - t, destroy_thermometer)) { - error("D-Bus failed to register %s interface", - THERMOMETER_INTERFACE); - destroy_thermometer(t); - return -EIO; - } - - t->attioid = btd_device_add_attio_callback(device, attio_connected_cb, - attio_disconnected_cb, t); - return 0; -} - -static void thermometer_unregister(struct btd_device *device) -{ - struct thermometer *t; - struct btd_adapter *adapter; - struct thermometer_adapter *tadapter; - GSList *l; - - adapter = device_get_adapter(device); - - tadapter = find_thermometer_adapter(adapter); - - if (tadapter == NULL) - return; - - l = g_slist_find_custom(tadapter->devices, device, cmp_device); - if (l == NULL) - return; - - t = l->data; - - tadapter->devices = g_slist_remove(tadapter->devices, t); - - g_dbus_unregister_interface(btd_get_dbus_connection(), - device_get_path(t->dev), THERMOMETER_INTERFACE); -} - -static const GDBusMethodTable thermometer_manager_methods[] = { - { GDBUS_METHOD("RegisterWatcher", - GDBUS_ARGS({ "agent", "o" }), NULL, - register_watcher) }, - { GDBUS_METHOD("UnregisterWatcher", - GDBUS_ARGS({ "agent", "o" }), NULL, - unregister_watcher) }, - { GDBUS_METHOD("EnableIntermediateMeasurement", - GDBUS_ARGS({ "agent", "o" }), NULL, - enable_intermediate) }, - { GDBUS_METHOD("DisableIntermediateMeasurement", - GDBUS_ARGS({ "agent", "o" }), NULL, - disable_intermediate) }, - { } -}; - -static int thermometer_adapter_register(struct btd_adapter *adapter) -{ - struct thermometer_adapter *tadapter; - - tadapter = g_new0(struct thermometer_adapter, 1); - tadapter->adapter = adapter; - - if (!g_dbus_register_interface(btd_get_dbus_connection(), - adapter_get_path(adapter), - THERMOMETER_MANAGER_INTERFACE, - thermometer_manager_methods, - NULL, NULL, tadapter, - destroy_thermometer_adapter)) { - error("D-Bus failed to register %s interface", - THERMOMETER_MANAGER_INTERFACE); - destroy_thermometer_adapter(tadapter); - return -EIO; - } - - thermometer_adapters = g_slist_prepend(thermometer_adapters, tadapter); - - return 0; -} - -static void thermometer_adapter_unregister(struct btd_adapter *adapter) -{ - struct thermometer_adapter *tadapter; - - tadapter = find_thermometer_adapter(adapter); - if (tadapter == NULL) - return; - - thermometer_adapters = g_slist_remove(thermometer_adapters, tadapter); - - g_dbus_unregister_interface(btd_get_dbus_connection(), - adapter_get_path(tadapter->adapter), - THERMOMETER_MANAGER_INTERFACE); -} - -static int thermometer_device_probe(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - struct gatt_primary *tattr; - - tattr = btd_device_get_primary(device, HEALTH_THERMOMETER_UUID); - if (tattr == NULL) - return -EINVAL; - - return thermometer_register(device, tattr); -} - -static void thermometer_device_remove(struct btd_service *service) -{ - struct btd_device *device = btd_service_get_device(service); - - thermometer_unregister(device); -} - -static int thermometer_adapter_probe(struct btd_profile *p, - struct btd_adapter *adapter) -{ - return thermometer_adapter_register(adapter); -} - -static void thermometer_adapter_remove(struct btd_profile *p, - struct btd_adapter *adapter) -{ - thermometer_adapter_unregister(adapter); -} - -static struct btd_profile thermometer_profile = { - .name = "Health Thermometer GATT driver", - .remote_uuid = HEALTH_THERMOMETER_UUID, - .device_probe = thermometer_device_probe, - .device_remove = thermometer_device_remove, - .adapter_probe = thermometer_adapter_probe, - .adapter_remove = thermometer_adapter_remove -}; - -static int thermometer_init(void) -{ - return btd_profile_register(&thermometer_profile); -} - -static void thermometer_exit(void) -{ - btd_profile_unregister(&thermometer_profile); -} - -BLUETOOTH_PLUGIN_DEFINE(thermometer, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - thermometer_init, thermometer_exit) diff --git a/profiles/time/server.c b/profiles/time/server.c deleted file mode 100644 index 2289c6a..0000000 --- a/profiles/time/server.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include - -#include "lib/bluetooth.h" -#include "lib/sdp.h" -#include "lib/uuid.h" - -#include "src/adapter.h" -#include "src/device.h" -#include "src/profile.h" -#include "src/plugin.h" -#include "attrib/gattrib.h" -#include "attrib/att.h" -#include "attrib/gatt.h" -#include "attrib/att-database.h" -#include "src/shared/util.h" -#include "src/attrib-server.h" -#include "attrib/gatt-service.h" -#include "src/log.h" - -#define CURRENT_TIME_SVC_UUID 0x1805 -#define REF_TIME_UPDATE_SVC_UUID 0x1806 - -#define LOCAL_TIME_INFO_CHR_UUID 0x2A0F -#define TIME_UPDATE_CTRL_CHR_UUID 0x2A16 -#define TIME_UPDATE_STAT_CHR_UUID 0x2A17 -#define CT_TIME_CHR_UUID 0x2A2B - -enum { - UPDATE_RESULT_SUCCESSFUL = 0, - UPDATE_RESULT_CANCELED = 1, - UPDATE_RESULT_NO_CONN = 2, - UPDATE_RESULT_ERROR = 3, - UPDATE_RESULT_TIMEOUT = 4, - UPDATE_RESULT_NOT_ATTEMPTED = 5, -}; - -enum { - UPDATE_STATE_IDLE = 0, - UPDATE_STATE_PENDING = 1, -}; - -enum { - GET_REFERENCE_UPDATE = 1, - CANCEL_REFERENCE_UPDATE = 2, -}; - -static int encode_current_time(uint8_t value[10]) -{ - struct timespec tp; - struct tm tm; - - if (clock_gettime(CLOCK_REALTIME, &tp) == -1) { - int err = -errno; - - error("clock_gettime: %s", strerror(-err)); - return err; - } - - if (localtime_r(&tp.tv_sec, &tm) == NULL) { - error("localtime_r() failed"); - /* localtime_r() does not set errno */ - return -EINVAL; - } - - put_le16(1900 + tm.tm_year, &value[0]); /* Year */ - value[2] = tm.tm_mon + 1; /* Month */ - value[3] = tm.tm_mday; /* Day */ - value[4] = tm.tm_hour; /* Hours */ - value[5] = tm.tm_min; /* Minutes */ - value[6] = tm.tm_sec; /* Seconds */ - value[7] = tm.tm_wday == 0 ? 7 : tm.tm_wday; /* Day of Week */ - /* From Time Profile spec: "The number of 1/256 fractions of a second." - * In 1s there are 256 fractions, in 1ns there are 256/10^9 fractions. - * To avoid integer overflow, we use the equivalent 1/3906250 ratio. */ - value[8] = tp.tv_nsec / 3906250; /* Fractions256 */ - value[9] = 0x00; /* Adjust Reason */ - - return 0; -} - -static uint8_t current_time_read(struct attribute *a, - struct btd_device *device, gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - uint8_t value[10]; - - if (encode_current_time(value) < 0) - return ATT_ECODE_IO; - - attrib_db_update(adapter, a->handle, NULL, value, sizeof(value), NULL); - - return 0; -} - -static uint8_t local_time_info_read(struct attribute *a, - struct btd_device *device, gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - uint8_t value[2]; - - DBG("a=%p", a); - - tzset(); - - /* Convert POSIX "timezone" (seconds West of GMT) to Time Profile - * format (offset from UTC in number of 15 minutes increments). */ - value[0] = (uint8_t) (-1 * timezone / (60 * 15)); - - /* FIXME: POSIX "daylight" variable only indicates whether there - * is DST for the local time or not. The offset is unknown. */ - value[1] = daylight ? 0xff : 0x00; - - attrib_db_update(adapter, a->handle, NULL, value, sizeof(value), NULL); - - return 0; -} - -static gboolean register_current_time_service(struct btd_adapter *adapter) -{ - bt_uuid_t uuid; - - bt_uuid16_create(&uuid, CURRENT_TIME_SVC_UUID); - - /* Current Time service */ - return gatt_service_add(adapter, GATT_PRIM_SVC_UUID, &uuid, - /* CT Time characteristic */ - GATT_OPT_CHR_UUID16, CT_TIME_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_READ | - GATT_CHR_PROP_NOTIFY, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - current_time_read, adapter, - - /* Local Time Information characteristic */ - GATT_OPT_CHR_UUID16, LOCAL_TIME_INFO_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_READ, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - local_time_info_read, adapter, - - GATT_OPT_INVALID); -} - -static uint8_t time_update_control(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - DBG("handle 0x%04x", a->handle); - - if (a->len != 1) - DBG("Invalid control point value size: %zu", a->len); - - switch (a->data[0]) { - case GET_REFERENCE_UPDATE: - DBG("Get Reference Update"); - break; - case CANCEL_REFERENCE_UPDATE: - DBG("Cancel Reference Update"); - break; - default: - DBG("Unknown command: 0x%02x", a->data[0]); - } - - return 0; -} - -static uint8_t time_update_status(struct attribute *a, - struct btd_device *device, - gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - uint8_t value[2]; - - DBG("handle 0x%04x", a->handle); - - value[0] = UPDATE_STATE_IDLE; - value[1] = UPDATE_RESULT_SUCCESSFUL; - attrib_db_update(adapter, a->handle, NULL, value, sizeof(value), NULL); - - return 0; -} - -static gboolean register_ref_time_update_service(struct btd_adapter *adapter) -{ - bt_uuid_t uuid; - - bt_uuid16_create(&uuid, REF_TIME_UPDATE_SVC_UUID); - - /* Reference Time Update service */ - return gatt_service_add(adapter, GATT_PRIM_SVC_UUID, &uuid, - /* Time Update control point */ - GATT_OPT_CHR_UUID16, TIME_UPDATE_CTRL_CHR_UUID, - GATT_OPT_CHR_PROPS, - GATT_CHR_PROP_WRITE_WITHOUT_RESP, - GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE, - time_update_control, adapter, - - /* Time Update status */ - GATT_OPT_CHR_UUID16, TIME_UPDATE_STAT_CHR_UUID, - GATT_OPT_CHR_PROPS, GATT_CHR_PROP_READ, - GATT_OPT_CHR_VALUE_CB, ATTRIB_READ, - time_update_status, adapter, - - GATT_OPT_INVALID); -} - -static int time_server_init(struct btd_profile *p, struct btd_adapter *adapter) -{ - const char *path = adapter_get_path(adapter); - - DBG("path %s", path); - - if (!register_current_time_service(adapter)) { - error("Current Time Service could not be registered"); - return -EIO; - } - - if (!register_ref_time_update_service(adapter)) { - error("Reference Time Update Service could not be registered"); - return -EIO; - } - - return 0; -} - -static void time_server_exit(struct btd_profile *p, - struct btd_adapter *adapter) -{ - const char *path = adapter_get_path(adapter); - - DBG("path %s", path); -} - -struct btd_profile time_profile = { - .name = "gatt-time-server", - .adapter_probe = time_server_init, - .adapter_remove = time_server_exit, -}; - -static int time_init(void) -{ - return btd_profile_register(&time_profile); -} - -static void time_exit(void) -{ - btd_profile_unregister(&time_profile); -} - -BLUETOOTH_PLUGIN_DEFINE(time, VERSION, - BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, - time_init, time_exit) diff --git a/src/adapter.c b/src/adapter.c old mode 100644 new mode 100755 index b82d330..5d7a9a9 --- a/src/adapter.c +++ b/src/adapter.c @@ -77,20 +77,8 @@ #include "advertising.h" #include "eir.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "adapter_le_vsc_features.h" -#endif - #define ADAPTER_INTERFACE "org.bluez.Adapter1" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH -#define DEVICED_DEST "org.tizen.system.deviced" -#define DEVICED_BATT_INTERFACE "org.tizen.system.deviced.Battery" -#define DEVICED_BATT_OBJECT_PATH "/Org/Tizen/System/DeviceD/Battery" -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif - #define MODE_OFF 0x00 #define MODE_CONNECTABLE 0x01 #define MODE_DISCOVERABLE 0x02 @@ -109,16 +97,6 @@ #define DISTANCE_VAL_INVALID 0x7FFF #define PATHLOSS_MAX 137 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define ADV_DATA_MAX_LENGTH 31 -#define SCAN_RESPONSE_DATA_LENGTH_MAX 31 -#define EIR_MANUFACTURER_DATA_LENGTH_MAX 100 - -#define LE_BEARER_POSTFIX " LE" -#define LE_BEARER_POSTFIX_LEN 3 -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - - static DBusConnection *dbus_conn = NULL; static bool kernel_conn_control = false; @@ -203,20 +181,6 @@ struct btd_adapter_pin_cb_iter { /* When the iterator reaches the end, it is NULL and attempt is 0 */ }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct adv_info { - int slot_id; /* Reservied slot id is 0 (Single adv) */ - bool status; /* Advertising status */ -}; - -static GSList *read_requests = NULL; - -struct le_data_length_read_request { - struct btd_adapter *adapter; - DBusMessage *msg; -}; -#endif - struct btd_adapter { int ref_count; @@ -224,9 +188,6 @@ struct btd_adapter { struct mgmt *mgmt; bdaddr_t bdaddr; /* controller Bluetooth address */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bdaddr_t le_static_addr; -#endif uint32_t dev_class; /* controller class of device */ char *name; /* controller device name */ char *short_name; /* controller short name */ @@ -244,18 +205,6 @@ struct btd_adapter { char *current_alias; /* current adapter name alias */ char *stored_alias; /* stored adapter name alias */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint8_t *local_irk; /* adapter local IRK */ - uint8_t disc_type; - bool ipsp_intialized; /* Ipsp Initialization state */ - struct le_data_length_read_handler *read_handler; - struct le_data_length_read_default_data_length_handler *def_read_handler; -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH - guint charging_watch; - guint charging_timeout; - charging_state_e charging; -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif bool discovering; /* discovering property state */ bool filtered_discovery; /* we are doing filtered discovery */ @@ -273,9 +222,6 @@ struct btd_adapter { GSList *discovery_found; /* list of found devices */ guint discovery_idle_timeout; /* timeout between discovery runs */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - guint le_discovery_idle_timeout; /* timeout between le discovery runs */ -#endif guint passive_scan_timeout; /* timeout between passive scans */ guint temp_devices_timeout; /* timeout for temporary devices */ @@ -293,14 +239,6 @@ struct btd_adapter { struct btd_advertising *adv_manager; gboolean initialized; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - GSList *adv_list; /* List of advertising instance */ - bool advertising; /* Advertising active */ - gchar *version; /* Bluetooth Version */ - uint8_t adv_tx_power; - bool le_discovering; /* LE Discovery active */ - GSList *le_discovery_list; /* list of LE discovery clients */ -#endif GSList *pin_callbacks; GSList *msd_callbacks; @@ -320,33 +258,9 @@ struct btd_adapter { guint pair_device_timeout; unsigned int db_id; /* Service event handler for GATT db */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint8_t central_rpa_res_support; - bluetooth_a2dp_role_t a2dp_role; - bool auto_pairing; - char *pin_code; -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - bool scan_filter_support; /* platform's scan filtering support */ - uint8_t scan_type; /* scan type */ - GSList *scan_params; /* scan filter parameters */ - GSList *addr_filters; /* adress scan filters list */ - GSList *service_data_changed_filters; /* service data changed scan filters list */ - GSList *service_uuid_filters; /* service uuid scan filters list */ - GSList *solicit_data_filters; /* solicitation data scan filters list */ - GSList *local_name_filters; /* local name scan filters list */ - GSList *manufaturer_data_filters; /* manufacturer data scan filters list */ - GSList *service_data_filters; /* service data scan filters list */ -#endif -#endif - bool is_default; /* true if adapter is default one */ -}; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -enum { - DEINIT_6LOWPAN, - INIT_6LOWPAN + bool is_default; /* true if adapter is default one */ }; -#endif static struct btd_adapter *btd_adapter_lookup(uint16_t index) { @@ -541,14 +455,6 @@ static void store_adapter_info(struct btd_adapter *adapter) g_key_file_set_string(key_file, "General", "Alias", adapter->stored_alias); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Store A2DP Role */ - if (adapter->a2dp_role == BLUETOOTH_A2DP_SINK_ROLE) - g_key_file_set_string(key_file, "General", "DefaultA2DPRole", "sink"); - else - g_key_file_set_string(key_file, "General", "DefaultA2DPRole", "source"); -#endif - ba2str(&adapter->bdaddr, address); snprintf(filename, PATH_MAX, STORAGEDIR "/%s/settings", address); @@ -561,252 +467,12 @@ static void store_adapter_info(struct btd_adapter *adapter) g_key_file_free(key_file); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -bluetooth_a2dp_role_t btd_adapter_get_a2dp_role(struct btd_adapter *adapter) -{ - if (!adapter) - return BLUETOOTH_A2DP_SOURCE_ROLE; - - return adapter->a2dp_role; -} - -void btd_adapter_set_a2dp_role(struct btd_adapter *adapter, bluetooth_a2dp_role_t role) -{ - if (!adapter) { - DBG("Could not set a2dp role"); - return; - } - - if (role == BLUETOOTH_A2DP_SOURCE_ROLE) { - DBG("Set audio source role"); - adapter->a2dp_role = BLUETOOTH_A2DP_SOURCE_ROLE; - } else if (role == BLUETOOTH_A2DP_SINK_ROLE) { - DBG("Set audio sink role"); - adapter->a2dp_role = BLUETOOTH_A2DP_SINK_ROLE; - } - - store_adapter_info(adapter); -} -#endif - static void trigger_pairable_timeout(struct btd_adapter *adapter); static void adapter_start(struct btd_adapter *adapter); static void adapter_stop(struct btd_adapter *adapter); static void trigger_passive_scanning(struct btd_adapter *adapter); static bool set_mode(struct btd_adapter *adapter, uint16_t opcode, uint8_t mode); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static bool load_local_irk(struct btd_adapter *adapter); -static bool set_local_irk(struct btd_adapter *adapter); -static bool set_privacy(struct btd_adapter *adapter, bool privacy); -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH -static gboolean charging_state_timeout_cb(gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - int bredr_pkt_type = ACL_PTYPE_MASK; - - adapter->charging_timeout = 0; - - DBG("Set all connections to BR/EDR type"); - g_slist_foreach(adapter->devices, device_change_pkt_type, - (gpointer)bredr_pkt_type); - - return FALSE; -} - -static void set_charging_state(struct btd_adapter *adapter, - charging_state_e state) -{ - int br_pkt_type = ACL_PTYPE_MASK | - HCI_2DH1 | HCI_2DH3 | HCI_2DH5 | - HCI_3DH1 | HCI_3DH3 | HCI_3DH5; - - if (adapter->charging == state) - return; - - DBG("old charging state : %d, new charging_state : %d", - adapter->charging, state); - - /* - * Only none / wire charging <-> wireless charging state change should - * be handled. - */ - if ((adapter->charging == NONE_CHARGING && state == WIRE_CHARGING) || - (adapter->charging == WIRE_CHARGING && state == NONE_CHARGING)) { - DBG("Just update charging state"); - adapter->charging = state; - return; - } - - if (adapter->charging_timeout) { - g_source_remove(adapter->charging_timeout); - adapter->charging_timeout = 0; - } - - adapter->charging = state; - if (adapter->charging == NONE_CHARGING || - adapter->charging == WIRE_CHARGING) { - DBG("Trigger timeout to set connection to BR/EDR type"); - adapter->charging_timeout = g_timeout_add(2000, - charging_state_timeout_cb, adapter); - } else if (adapter->charging == WIRELESS_CHARGING) { - DBG("Set all connections to BR type"); - g_slist_foreach(adapter->devices, device_change_pkt_type, - (gpointer)br_pkt_type); - } - - return; -} - -static gboolean charging_state_changed(DBusConnection *connection, - DBusMessage *msg, void *user_data) -{ - struct btd_adapter *adapter = user_data; - int state = 0; - - DBG("charging_state_changed"); - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &state, - DBUS_TYPE_INVALID)) - return TRUE; - - set_charging_state(adapter, state); - - return TRUE; -} - -charging_state_e get_charging_state(struct btd_adapter *adapter) -{ - DBG("charging_state: %d", adapter->charging); - return adapter->charging; -} -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ - -static int compare_slot(gconstpointer a, gconstpointer b) -{ - const struct adv_info *adv = a; - const int id = *(int*)b; - - return (adv->slot_id == id ? 0 : -1); -} - -static struct adv_info *find_advertiser(struct btd_adapter *adapter, - int slot_id) -{ - GSList *list; - - list = g_slist_find_custom(adapter->adv_list, &slot_id, - compare_slot); - if (list) - return list->data; - - return NULL; -} - -static void create_advertiser(struct btd_adapter *adapter, - int slot_id) -{ - struct adv_info *adv; - - if (!adapter) - return; - - if (find_advertiser(adapter, slot_id) != NULL) { - error("Aleady existed [%d]", slot_id); - return; - } - - DBG("Create adv slot id : %d", slot_id); - - adv = g_new0(struct adv_info, 1); - if (adv == NULL) - return; - - adv->slot_id = slot_id; - - adapter->adv_list= g_slist_append(adapter->adv_list, adv); - return; -} - - -static void advertising_state_changed(struct btd_adapter *adapter, - int slot_id, bool enabled) -{ - struct adv_info *adv; - int id = slot_id; - int state = enabled; - - if (!adapter) - return; - - adv = find_advertiser(adapter, slot_id); - if (!adv) { - DBG("Unable to find advertiser [%d]", slot_id); - return; - } - - adv->status = enabled; - DBG("slot_id %d, status %d", adv->slot_id, adv->status); - - g_dbus_emit_signal(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "AdvertisingEnabled", - DBUS_TYPE_INT32, &id, - DBUS_TYPE_BOOLEAN, &state, - DBUS_TYPE_INVALID); -} - -static void clear_advertiser_cb(gpointer data, gpointer user_data) -{ - struct adv_info *adv = data; - struct btd_adapter *adapter = user_data; - - if (adv->status) - advertising_state_changed(adapter, adv->slot_id, 0); -} - -static void advertiser_cleanup(struct btd_adapter *adapter) -{ - if (!adapter->adv_list) - return; - - g_slist_foreach(adapter->adv_list, clear_advertiser_cb, adapter); - g_slist_free(adapter->adv_list); - adapter->adv_list = NULL; -} -#endif - -#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN -#define OCF_PAGE_SCAN_TIMEOUT 0x0018 -#define OGF_PAGE_SCAN_TIMEOUT 0x03 - -typedef struct { - uint16_t timeout; /* Value */ -} __attribute__ ((packed)) hci_page_scan_timeout; -#define HCI_PAGE_SCAN_TIMEOUT_CP_SIZE 2 - -static gboolean send_sprd_page_scan_timeout(gint value) -{ - int dd; - hci_page_scan_timeout cp; - DBG("+"); - dd = hci_open_dev(0); - cp.timeout = value; - if (hci_send_cmd(dd, OGF_PAGE_SCAN_TIMEOUT, OCF_PAGE_SCAN_TIMEOUT, - HCI_PAGE_SCAN_TIMEOUT_CP_SIZE, &cp) < 0) { - DBG("Error: While setting Page Timeout value"); - hci_close_dev(dd); - return FALSE; - } - DBG("Page Scan Timeout Value Patch %d", value); - - hci_close_dev(dd); - - return TRUE; -} -#endif static void settings_changed(struct btd_adapter *adapter, uint32_t settings) { @@ -824,15 +490,6 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings) if (adapter->current_settings & MGMT_SETTING_POWERED) { adapter_start(adapter); -#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN - /* Approx 6.4 Seconds of timeout */ - /* This Added because Z3 device was not able to connect with - * some device as it was getting Page Timeout - * (LG HBS800, sony carkit) etc. So, Increasing Page timeout value - * from 5.12 Sec (which is default) to ~6.4sec*/ - DBG("Setting value"); - send_sprd_page_scan_timeout(10240); -#endif /* TIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN */ } else { adapter_stop(adapter); @@ -867,31 +524,6 @@ static void settings_changed(struct btd_adapter *adapter, uint32_t settings) trigger_pairable_timeout(adapter); } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (changed_mask & MGMT_SETTING_ADVERTISING) { - if ((adapter->current_settings & MGMT_SETTING_ADVERTISING) && - (adapter->advertising)) { - return; - } - - adapter->advertising = adapter->current_settings & MGMT_SETTING_ADVERTISING; - advertising_state_changed(adapter, 0, adapter->advertising); - } - - if ((changed_mask & MGMT_SETTING_PRIVACY) && - !(adapter->current_settings & MGMT_SETTING_PRIVACY)) { - DBG("LE Privacy feature is disabled"); - - /* - * Some Android devices don't consider the device as LE one, - * if the device doesn't distribute IRK when pairing. - * Because of this compatibility issue, set IRK - * even though privacy feature is disabled. - */ - set_local_irk(adapter); - } -#endif } static void new_settings_callback(uint16_t index, uint16_t length, @@ -1151,10 +783,6 @@ struct btd_device *btd_adapter_find_device(struct btd_adapter *adapter, struct device_addr_type addr; struct btd_device *device; GSList *list; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bool exact_match = false; -#endif - char addr_str[18]; if (!adapter) return NULL; @@ -1162,33 +790,13 @@ struct btd_device *btd_adapter_find_device(struct btd_adapter *adapter, bacpy(&addr.bdaddr, dst); addr.bdaddr_type = bdaddr_type; - ba2str(dst, addr_str); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY list = g_slist_find_custom(adapter->devices, &addr, - device_addr_type_strict_cmp); - if (list) { - device = list->data; - exact_match = true; - } else { -#endif - list = g_slist_find_custom(adapter->devices, &addr, device_addr_type_cmp); - if (list) { - device = list->data; - } - } - if (!list) return NULL; device = list->data; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (exact_match) - return device; -#endif - /* * If we're looking up based on public address and the address * was not previously used over this bearer we may need to @@ -1437,13 +1045,6 @@ static void adapter_service_insert(struct btd_adapter *adapter, sdp_record_t *re DBG("%s", adapter->path); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (rec == NULL) { - DBG("record is NULL return"); - return; - } -#endif - /* skip record without a browse group */ if (sdp_get_browse_groups(rec, &browse_list) < 0) { DBG("skipping record without browse group"); @@ -1505,18 +1106,6 @@ void adapter_service_remove(struct btd_adapter *adapter, uint32_t handle) remove_record_from_server(rec->handle); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void adapter_print_devices(struct btd_adapter *adapter) -{ - GSList *dev; - - dev = adapter->devices; - for (; dev; dev = dev->next) { - device_print_addr(dev->data); - } -} -#endif - static struct btd_device *adapter_create_device(struct btd_adapter *adapter, const bdaddr_t *bdaddr, uint8_t bdaddr_type) @@ -1529,10 +1118,6 @@ static struct btd_device *adapter_create_device(struct btd_adapter *adapter, adapter->devices = g_slist_append(adapter->devices, device); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter_print_devices(adapter); -#endif - return device; } @@ -1559,46 +1144,6 @@ static void service_auth_cancel(struct service_auth *auth) g_free(auth); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void btd_adapter_unpair_device(struct btd_adapter *adapter, - struct btd_device *dev) -{ - DBG("+"); - GList *l; - - adapter->connect_list = g_slist_remove(adapter->connect_list, dev); - -// adapter->devices = g_slist_remove(adapter->devices, dev); -// -// adapter->discovery_found = g_slist_remove(adapter->discovery_found, -// dev); - - adapter->connections = g_slist_remove(adapter->connections, dev); - - if (adapter->connect_le == dev) - adapter->connect_le = NULL; - - l = adapter->auths->head; - while (l != NULL) { - struct service_auth *auth = l->data; - GList *next = g_list_next(l); - - if (auth->device != dev) { - l = next; - continue; - } - - g_queue_delete_link(adapter->auths, l); - l = next; - - service_auth_cancel(auth); - } - - device_unpair(dev, TRUE); - DBG("-"); -} -#endif - void btd_adapter_remove_device(struct btd_adapter *adapter, struct btd_device *dev) { @@ -1644,11 +1189,6 @@ struct btd_device *btd_adapter_get_device(struct btd_adapter *adapter, if (!adapter) return NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!bacmp(addr, BDADDR_ANY)) - return NULL; -#endif - device = btd_adapter_find_device(adapter, addr, addr_type); if (device) return device; @@ -1667,11 +1207,6 @@ static void passive_scanning_complete(uint8_t status, uint16_t length, struct btd_adapter *adapter = user_data; const struct mgmt_cp_start_discovery *rp = param; - if (!rp) { - error("Error ocurred in Scanning, rp is NULL"); - return; - } - DBG("status 0x%02x", status); if (length < sizeof(*rp)) { @@ -1694,15 +1229,11 @@ static gboolean passive_scanning_timeout(gpointer user_data) adapter->passive_scan_timeout = 0; cp.type = SCAN_TYPE_LE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - mgmt_send(adapter->mgmt, MGMT_OP_START_LE_DISCOVERY, - adapter->dev_id, sizeof(cp), &cp, - passive_scanning_complete, adapter, NULL); -#else + mgmt_send(adapter->mgmt, MGMT_OP_START_DISCOVERY, adapter->dev_id, sizeof(cp), &cp, passive_scanning_complete, adapter, NULL); -#endif + return FALSE; } @@ -1733,13 +1264,8 @@ static void trigger_passive_scanning(struct btd_adapter *adapter) * The discovery procedure is using interleaved scanning and * thus will discover Low Energy devices as well. */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (adapter->discovery_list || adapter->le_discovery_list) - return; -#else if (adapter->discovery_list) return; -#endif if (adapter->discovery_enable == 0x01) return; @@ -1813,43 +1339,22 @@ static void stop_passive_scanning_complete(uint8_t status, uint16_t length, static void stop_passive_scanning(struct btd_adapter *adapter) { struct mgmt_cp_stop_discovery cp; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct mgmt_cp_stop_discovery le_cp; -#endif DBG(""); /* If there are any normal discovery clients passive scanning * wont be running */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (adapter->discovery_list || adapter->le_discovery_list) - return; -#else if (adapter->discovery_list) return; -#endif if (adapter->discovery_enable == 0x00) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((adapter->discovery_type & 0x01) > 0) - cp.type = 0x01; - mgmt_send(adapter->mgmt, MGMT_OP_STOP_DISCOVERY, - adapter->dev_id, sizeof(cp), &cp, - stop_passive_scanning_complete, adapter, NULL); - if ((adapter->discovery_type & 0x06) > 0) - le_cp.type = 0x06; - mgmt_send(adapter->mgmt, MGMT_OP_STOP_LE_DISCOVERY, - adapter->dev_id, sizeof(le_cp), &le_cp, - stop_passive_scanning_complete, adapter, NULL); -#else cp.type = adapter->discovery_type; mgmt_send(adapter->mgmt, MGMT_OP_STOP_DISCOVERY, adapter->dev_id, sizeof(cp), &cp, stop_passive_scanning_complete, adapter, NULL); -#endif } static void cancel_passive_scanning(struct btd_adapter *adapter) @@ -1898,9 +1403,6 @@ static void start_discovery_complete(uint8_t status, uint16_t length, const struct mgmt_cp_start_discovery *rp = param; DBG("status 0x%02x", status); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("Discovery Type 0x%02x", rp->type); -#endif if (length < sizeof(*rp)) { btd_error(adapter->dev_id, @@ -1909,12 +1411,7 @@ static void start_discovery_complete(uint8_t status, uint16_t length, } if (status == MGMT_STATUS_SUCCESS) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("Return param discovery type 0x%02x", rp->type); - adapter->discovery_type |= rp->type; -#else adapter->discovery_type = rp->type; -#endif adapter->discovery_enable = 0x01; if (adapter->current_discovery_filter) @@ -1929,152 +1426,32 @@ static void start_discovery_complete(uint8_t status, uint16_t length, g_dbus_emit_property_changed(dbus_conn, adapter->path, ADAPTER_INTERFACE, "Discovering"); return; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } else { - adapter->discovering = false; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "Discovering"); -#endif - } /* * In case the restart of the discovery failed, then just trigger * it for the next idle timeout again. */ -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY trigger_start_discovery(adapter, IDLE_DISCOV_TIMEOUT * 2); -#endif } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void start_le_discovery_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) +static gboolean start_discovery_timeout(gpointer user_data) { struct btd_adapter *adapter = user_data; - const struct mgmt_cp_start_discovery *rp = param; + struct mgmt_cp_start_service_discovery *sd_cp; + uint8_t new_type; - if (!rp) { - error("Error ocurred in LEDiscovering, rp is NULL"); - return; - } + DBG(""); - DBG("status 0x%02x", status); - if (length < sizeof(*rp)) { - error("Wrong size of start discovery return parameters"); - return; - } + adapter->discovery_idle_timeout = 0; - DBG("Discovery Type 0x%02x", rp->type); - if (status == MGMT_STATUS_SUCCESS) { - adapter->discovery_type |= rp->type; - adapter->discovery_enable = 0x01; + /* If we're doing filtered discovery, it must be quickly restarted */ + adapter->no_scan_restart_delay = !!adapter->current_discovery_filter; - if (adapter->le_discovering) - return; + DBG("adapter->current_discovery_filter == %d", + !!adapter->current_discovery_filter); - adapter->le_discovering = true; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); - - return; - } else { - adapter->le_discovering = false; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); - - } -} -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean start_le_discovery_timeout(gpointer user_data) -{ - struct btd_adapter *adapter = user_data; - uint8_t new_type; - - DBG(""); - - adapter->le_discovery_idle_timeout = 0; - - new_type = SCAN_TYPE_LE; - - if (adapter->discovery_enable == 0x01) { - /* - * If there is an already running discovery and it has the - * same type, then just keep it. - */ - - if ((adapter->discovery_type & new_type) == SCAN_TYPE_LE) { - if (adapter->le_discovering) - return FALSE; - - adapter->le_discovering = true; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); - - return FALSE; - } - } - - struct mgmt_cp_start_discovery cp; - - cp.type = new_type; - mgmt_send(adapter->mgmt, MGMT_OP_START_LE_DISCOVERY, - adapter->dev_id, sizeof(cp), &cp, - start_le_discovery_complete, adapter, NULL); - - return FALSE; -} -#endif - -static gboolean start_discovery_timeout(gpointer user_data) -{ - struct btd_adapter *adapter = user_data; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - struct mgmt_cp_start_service_discovery *sd_cp; -#endif - uint8_t new_type; - - DBG(""); - - adapter->discovery_idle_timeout = 0; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - new_type = SCAN_TYPE_BREDR; - - if (adapter->discovery_enable == 0x01) { - /* - * If there is an already running discovery and it has the - * same type, then just keep it. - */ - if ((adapter->discovery_type & new_type) == SCAN_TYPE_BREDR) { - if (adapter->discovering) - return FALSE; - - adapter->discovering = true; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "Discovering"); - - return FALSE; - } - } - - struct mgmt_cp_start_discovery cp; - cp.type = new_type; - mgmt_send(adapter->mgmt, MGMT_OP_START_DISCOVERY, - adapter->dev_id, sizeof(cp), &cp, - start_discovery_complete, adapter, NULL); - -#else - /* If we're doing filtered discovery, it must be quickly restarted */ - adapter->no_scan_restart_delay = !!adapter->current_discovery_filter; - - DBG("adapter->current_discovery_filter == %d", - !!adapter->current_discovery_filter); - - new_type = get_scan_type(adapter); + new_type = get_scan_type(adapter); if (adapter->discovery_enable == 0x01) { struct mgmt_cp_stop_discovery cp; @@ -2139,38 +1516,9 @@ static gboolean start_discovery_timeout(gpointer user_data) adapter->dev_id, sizeof(*sd_cp) + sd_cp->uuid_count * 16, sd_cp, start_discovery_complete, adapter, NULL); -#endif - return FALSE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void trigger_start_le_discovery(struct btd_adapter *adapter, guint delay) -{ - - DBG(""); - - cancel_passive_scanning(adapter); - - if (adapter->le_discovery_idle_timeout > 0) { - g_source_remove(adapter->le_discovery_idle_timeout); - adapter->le_discovery_idle_timeout = 0; - } - - /* - * If the controller got powered down in between, then ensure - * that we do not keep trying to restart discovery. - * - * This is safe-guard and should actually never trigger. - */ - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return; - - adapter->le_discovery_idle_timeout = g_timeout_add_seconds(delay, - start_le_discovery_timeout, adapter); -} -#endif - static void trigger_start_discovery(struct btd_adapter *adapter, guint delay) { @@ -2196,7 +1544,6 @@ static void trigger_start_discovery(struct btd_adapter *adapter, guint delay) start_discovery_timeout, adapter); } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY static void suspend_discovery_complete(uint8_t status, uint16_t length, const void *param, void *user_data) { @@ -2267,7 +1614,6 @@ static void resume_discovery(struct btd_adapter *adapter) */ trigger_start_discovery(adapter, IDLE_DISCOV_TIMEOUT); } -#endif static void discovering_callback(uint16_t index, uint16_t length, const void *param, void *user_data) @@ -2283,40 +1629,11 @@ static void discovering_callback(uint16_t index, uint16_t length, DBG("hci%u type %u discovering %u method %d", adapter->dev_id, ev->type, ev->discovering, adapter->filtered_discovery); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("info discov_type %d", adapter->discovery_type); - if (ev->type == SCAN_TYPE_BREDR) { - if (ev->discovering == FALSE) { - hci_clear_bit(BDADDR_BREDR, &adapter->discovery_type); - adapter->discovering = false; - } else { - hci_set_bit(BDADDR_BREDR, &adapter->discovery_type); - adapter->discovering = true; - } - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "Discovering"); - - } else if (ev->type == SCAN_TYPE_LE) { - if (ev->discovering == FALSE) { - hci_clear_bit(BDADDR_LE_PUBLIC, &adapter->discovery_type); - hci_clear_bit(BDADDR_LE_RANDOM, &adapter->discovery_type); - adapter->le_discovering = false; - } else { - hci_set_bit(BDADDR_LE_PUBLIC, &adapter->discovery_type); - hci_set_bit(BDADDR_LE_RANDOM, &adapter->discovery_type); - adapter->le_discovering = true; - } - - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); - } -#else if (adapter->discovery_enable == ev->discovering) return; adapter->discovery_type = ev->type; adapter->discovery_enable = ev->discovering; -#endif /* * Check for existing discoveries triggered by client applications @@ -2325,19 +1642,11 @@ static void discovering_callback(uint16_t index, uint16_t length, * If there are no clients, then it is good idea to trigger a * passive scanning attempt. */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (adapter->discovery_list == NULL && adapter->le_discovery_list == NULL) { - if (!adapter->connect_le) - trigger_passive_scanning(adapter); - return; - } -#else if (!adapter->discovery_list) { if (!adapter->connect_le) trigger_passive_scanning(adapter); return; } -#endif if (adapter->discovery_suspended) return; @@ -2360,57 +1669,6 @@ static void discovering_callback(uint16_t index, uint16_t length, } } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void stop_discovery_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - DBG("status 0x%02x", status); - - if (status == MGMT_STATUS_SUCCESS) { - adapter->discovery_type &= (~0x01); - DBG("Discovery Type 0x%02x", adapter->discovery_type); - - adapter->filtered_discovery = false; - adapter->no_scan_restart_delay = false; - adapter->discovering = false; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "Discovering"); - - if (adapter->discovery_list == NULL && adapter->le_discovery_list == NULL) { - adapter->discovery_enable = 0x00; - trigger_passive_scanning(adapter); - } - } -} - -static void stop_le_discovery_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - DBG("status 0x%02x", status); - - if (status == MGMT_STATUS_SUCCESS) { - adapter->discovery_type &= (~0x06); - DBG("Discovery Type 0x%02x", adapter->discovery_type); - - adapter->filtered_discovery = false; - adapter->no_scan_restart_delay = false; - adapter->le_discovering = false; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); - - if (adapter->discovery_list == NULL && adapter->le_discovery_list == NULL) { - adapter->discovery_enable = 0x00; - trigger_passive_scanning(adapter); - } - } -} - -#else - static void stop_discovery_complete(uint8_t status, uint16_t length, const void *param, void *user_data) { @@ -2430,8 +1688,6 @@ static void stop_discovery_complete(uint8_t status, uint16_t length, trigger_passive_scanning(adapter); } } -#endif - static int compare_sender(gconstpointer a, gconstpointer b) { @@ -2713,11 +1969,7 @@ static void discovery_destroy(void *user_data) if (adapter->discovery_list) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - hci_clear_bit(BDADDR_BREDR, &adapter->discovery_type); -#else adapter->discovery_type = 0x00; -#endif if (adapter->discovery_idle_timeout > 0) { g_source_remove(adapter->discovery_idle_timeout); @@ -2807,2874 +2059,74 @@ static bool get_discovery_client(struct btd_adapter *adapter, return false; } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void le_discovery_destroy(void *user_data) +static DBusMessage *start_discovery(DBusConnection *conn, + DBusMessage *msg, void *user_data) { - struct watch_client *client = user_data; - struct btd_adapter *adapter = client->adapter; + struct btd_adapter *adapter = user_data; + const char *sender = dbus_message_get_sender(msg); + struct watch_client *client; + bool is_discovering; - DBG("owner %s", client->owner); + DBG("sender %s", sender); - adapter->le_discovery_list = g_slist_remove(adapter->le_discovery_list, - client); + if (!(adapter->current_settings & MGMT_SETTING_POWERED)) + return btd_error_not_ready(msg); - g_free(client->owner); - g_free(client); + is_discovering = get_discovery_client(adapter, sender, &client); /* - * If there are other client discoveries in progress, then leave - * it active. If not, then make sure to stop the restart timeout. + * Every client can only start one discovery, if the client + * already started a discovery then return an error. */ - DBG("adapter->discovery_list[%p] adapter->le_discovery_list[%p]", - adapter->discovery_list, adapter->le_discovery_list); - if (adapter->discovery_list || adapter->le_discovery_list) - return; - - hci_clear_bit(BDADDR_LE_PUBLIC, &adapter->discovery_type); - hci_clear_bit(BDADDR_LE_RANDOM, &adapter->discovery_type); - - DBG("Restart Timer... adapter->discovery_type[%d]", adapter->discovery_type); - if (adapter->discovery_idle_timeout > 0) { - g_source_remove(adapter->discovery_idle_timeout); - adapter->discovery_idle_timeout = 0; - } + if (is_discovering) + return btd_error_busy(msg); - if (adapter->temp_devices_timeout > 0) { - g_source_remove(adapter->temp_devices_timeout); - adapter->temp_devices_timeout = 0; + /* + * If there was pre-set filter, just reconnect it to discovery_list, + * and trigger scan. + */ + if (client) { + adapter->set_filter_list = g_slist_remove( + adapter->set_filter_list, client); + adapter->discovery_list = g_slist_prepend( + adapter->discovery_list, client); + update_discovery_filter(adapter); + return dbus_message_new_method_return(msg); } - discovery_cleanup(adapter); -} - -static void le_discovery_disconnect(DBusConnection *conn, void *user_data) -{ - struct watch_client *client = user_data; - struct btd_adapter *adapter = client->adapter; - struct mgmt_cp_stop_le_discovery cp; - - DBG("owner %s", client->owner); + client = g_new0(struct watch_client, 1); - adapter->le_discovery_list = g_slist_remove(adapter->le_discovery_list, + client->adapter = adapter; + client->owner = g_strdup(sender); + client->discovery_filter = NULL; + client->watch = g_dbus_add_disconnect_watch(dbus_conn, sender, + discovery_disconnect, client, + discovery_destroy); + adapter->discovery_list = g_slist_prepend(adapter->discovery_list, client); /* - * There is no need for extra cleanup of the client since that - * will be done by the destroy callback. - * - * However in case this is the last client, the discovery in - * the kernel needs to be disabled. - */ - if (adapter->le_discovery_list) - return; - - /* - * In the idle phase of a discovery, there is no need to stop it - * and so it is enough to send out the signal and just return. + * Just trigger the discovery here. In case an already running + * discovery in idle phase exists, it will be restarted right + * away. */ - if (adapter->discovery_enable == 0x00) { - adapter->le_discovering = false; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); - - if (adapter->discovering == false && adapter->le_discovering == false) { - trigger_passive_scanning(adapter); - return; - } - } - - cp.type = 0x06; + update_discovery_filter(adapter); - mgmt_send(adapter->mgmt, MGMT_OP_STOP_LE_DISCOVERY, - adapter->dev_id, sizeof(cp), &cp, - stop_discovery_complete, adapter, NULL); + return dbus_message_new_method_return(msg); } -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER -static void addr_filter_params_free(gpointer data, gpointer user_data) +static bool parse_uuids(DBusMessageIter *value, GSList **uuids) { - adapter_le_address_filter_params_t *params = data; - - g_free(params); -} + DBusMessageIter arriter; -static void uuid_filter_params_free(gpointer data, gpointer user_data) -{ - adapter_le_uuid_params_t *params = data; + if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_ARRAY) + return false; - g_free((char *)params->uuid); - g_free((char *)params->uuid_mask); - g_free(params); -} - -static void manufacturer_filter_params_free(gpointer data, gpointer user_data) -{ - adapter_le_manf_data_params_t *params = data; - - g_free((char *)params->man_data); - g_free((char *)params->man_data_mask); - g_free(params); -} - -static void local_name_filter_params_free(gpointer data, gpointer user_data) -{ - adapter_le_local_name_params_t *params = data; - - g_free((char *)params->local_name); - g_free(params); -} - -static void service_data_filter_params_free(gpointer data, gpointer user_data) -{ - adapter_le_service_data_params_t *params = data; - - g_free((char *)params->service_data); - g_free((char *)params->service_data_mask); - g_free(params); -} - -static void scan_filter_params_free(gpointer data, gpointer user_data) -{ - adapter_le_scan_filter_param_t *params = data; - g_free(params); -} - -int adapter_le_address_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_address_filter_params_t *params = a; - const char *address = b; - char addr[18]; - - ba2str(¶ms->broadcaster_addr, addr); - return strcasecmp(addr, address); -} - -int adapter_le_uuid_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_uuid_params_t *params = a; - const char *uuid = b; - - return strcasecmp((const char *)params->uuid, uuid); -} - -int adapter_le_manufacturer_data_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_manf_data_params_t *params = a; - const struct eir_msd *msd = b; - - if (msd->company == params->company_id) { - /* if the advertisiement packet is an iBeacon */ - if (msd->company == COMPANY_ID_APPLE) - return 0; - return strncasecmp((const char *)params->man_data, msd->data, params->man_data_len); - } else { - return -1; - } -} - -int adapter_le_local_name_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_local_name_params_t *params = a; - const char *name = b; - - return strcasecmp(params->local_name, name); -} - -int adapter_le_service_data_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_service_data_params_t *params = a; - const struct eir_sd *sd = b; - /* Todo, the service data format for 16 bit, 32bit and - * 128 bit uuids needs to addressed */ - return strncasecmp((const char *)(params->service_data), sd->data, sd->data_len); -} - -int adapter_le_address_filter_index_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_address_filter_params_t *params = a; - uint16_t filter_inex = GPOINTER_TO_UINT(b); - - return params->filter_index - filter_inex; -} - -int adapter_le_uuid_filter_index_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_uuid_params_t *params = a; - uint16_t filter_inex = GPOINTER_TO_UINT(b); - - return params->filter_index - filter_inex; -} - -int adapter_le_manufacturer_data_filter_index_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_manf_data_params_t *params = a; - uint16_t filter_inex = GPOINTER_TO_UINT(b); - - return params->filter_index - filter_inex; -} - -int adapter_le_local_name_filter_index_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_local_name_params_t *params = a; - uint16_t filter_inex = GPOINTER_TO_UINT(b); - - return params->filter_index - filter_inex; -} - -int adapter_le_service_data_filter_index_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_service_data_params_t *params = a; - uint16_t filter_inex = GPOINTER_TO_UINT(b); - - return params->filter_index - filter_inex; -} - -int adapter_le_scan_params_filter_index_cmp(gconstpointer a, gconstpointer b) -{ - const adapter_le_scan_filter_param_t *params = a; - uint16_t filter_inex = GPOINTER_TO_UINT(b); - - return params->index - filter_inex; -} - -static gboolean adapter_le_clear_platform_scan_filter_data( - struct btd_adapter *adapter, int filter_index) -{ - DBG(""); - GSList *list; - if (!adapter) - return FALSE; - - list = g_slist_find_custom(adapter->addr_filters, - GINT_TO_POINTER(filter_index), adapter_le_address_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->addr_filters = g_slist_delete_link(adapter->addr_filters, list); - } - list = g_slist_find_custom(adapter->service_data_changed_filters, - GINT_TO_POINTER(filter_index), adapter_le_service_data_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->service_data_changed_filters = g_slist_delete_link(adapter->service_data_changed_filters, list); - } - - list = g_slist_find_custom(adapter->service_uuid_filters, - GINT_TO_POINTER(filter_index), adapter_le_uuid_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->service_uuid_filters = g_slist_delete_link(adapter->service_uuid_filters, list); - } - - list = g_slist_find_custom(adapter->solicit_data_filters, - GINT_TO_POINTER(filter_index), adapter_le_uuid_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->solicit_data_filters = g_slist_delete_link(adapter->solicit_data_filters, list); - } - - list = g_slist_find_custom(adapter->local_name_filters, - GINT_TO_POINTER(filter_index), adapter_le_local_name_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->local_name_filters = g_slist_delete_link(adapter->local_name_filters, list); - } - - list = g_slist_find_custom(adapter->manufaturer_data_filters, - GINT_TO_POINTER(filter_index), adapter_le_manufacturer_data_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->manufaturer_data_filters = g_slist_delete_link(adapter->manufaturer_data_filters, list); - } - - list = g_slist_find_custom(adapter->service_data_filters, - GINT_TO_POINTER(filter_index), adapter_le_service_data_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->service_data_filters = g_slist_delete_link(adapter->service_data_filters, list); - } - - list = g_slist_find_custom(adapter->scan_params, - GINT_TO_POINTER(filter_index), adapter_le_scan_params_filter_index_cmp); - if (list && list->data) { - /* Delete info from the struct to list */ - adapter->scan_params = g_slist_delete_link(adapter->scan_params, list); - } - - return TRUE; -} - -static gboolean adapter_le_enable_platform_scan_filtering( - struct btd_adapter *adapter, gboolean enable) -{ - if (!adapter) - return FALSE; - - DBG("Platform scan filtering enable[%d]", enable); - - adapter->scan_filter_support = enable; - - return TRUE; -} - - -static gboolean adapter_le_service_add_addr_scan_filter_data(struct btd_adapter *adapter, - int filter_index, gchar *string, int addr_type) -{ - /* TYPE_DEVICE_ADDRESS */ - adapter_le_address_filter_params_t *params; - - DBG(""); - - params = g_new0(adapter_le_address_filter_params_t, 1); - if (!params) - return FALSE; - - params->filter_index = filter_index; - str2ba(string, ¶ms->broadcaster_addr); - params->bdaddr_type = addr_type; - - /* Store the struct to list */ - adapter->addr_filters = g_slist_append(adapter->addr_filters, params); - return TRUE; -} - -static const char *adapter_le_service_find_addr_scan_filter_data( - struct btd_adapter *adapter, gchar *string) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->addr_filters, string, adapter_le_address_cmp); - if (!list) - return NULL; - else - return list->data; - - return NULL; -} - -static gboolean adapter_le_service_delete_addr_scan_filter_data(struct btd_adapter *adapter, - int filter_index, gchar *string, int addr_type) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->addr_filters, string, adapter_le_address_cmp); - if (!list) - return FALSE; - else - /* Delete info from the struct to list */ - adapter->addr_filters = g_slist_delete_link(adapter->addr_filters, list); - - return TRUE; -} - -static gboolean adapter_le_service_clear_addr_scan_filter_data(struct btd_adapter *adapter) -{ - DBG(""); - - g_slist_free_full(adapter->addr_filters, addr_filter_params_free); - adapter->addr_filters = NULL; - - return TRUE; -} - -static gboolean adapter_le_service_add_uuid_scan_filter_data(struct btd_adapter *adapter, - int filter_index, gboolean is_solicited, uint8_t *p_uuid, - uint8_t *p_uuid_mask, int uuid_mask_len) -{ - - adapter_le_uuid_params_t *params; - bt_uuid_t uuid; - - DBG(""); - - params = g_new0(adapter_le_uuid_params_t, 1); - if (!params) - return FALSE; - - if (uuid_mask_len == UUID_16_LEN) { - uint16_t *uuid16 = (void *)p_uuid; - sdp_uuid16_create(&uuid, get_be16(uuid16)); - } else if (uuid_mask_len == UUID_32_LEN) { - uint32_t *uuid32 = (void *)p_uuid; - sdp_uuid32_create(&uuid, get_be32(uuid32)); - } else { - sdp_uuid128_create(&uuid, p_uuid); - } - params->filter_index = filter_index; - params->uuid = bt_uuid2string(&uuid); - params->uuid_mask = g_new0(uint8_t, uuid_mask_len); - memcpy(params->uuid_mask, p_uuid_mask, uuid_mask_len); - params->uuid_len = uuid_mask_len; - - /* Store the struct to list */ - adapter->solicit_data_filters = g_slist_append(adapter->solicit_data_filters, params); - - return TRUE; -} - -static adapter_le_uuid_params_t *adapter_le_service_find_uuid_scan_filter_data(struct btd_adapter *adapter, - uint8_t *p_uuid) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->solicit_data_filters, p_uuid, adapter_le_uuid_cmp); - if (!list) - return NULL; - else - /* Delete info from the struct to list */ - return list->data; - - return NULL; -} - -static gboolean adapter_le_service_delete_uuid_scan_filter_data(struct btd_adapter *adapter, - int filter_index, gboolean is_solicited, uint8_t *p_uuid, - uint8_t *p_uuid_mask, int uuid_mask_len) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->solicit_data_filters, GINT_TO_POINTER(filter_index), adapter_le_uuid_filter_index_cmp); - if (!list) - return FALSE; - else { - adapter_le_uuid_params_t *params = list->data; - /* Delete info from the struct to list */ - if (params && strcasecmp((const char *)params->uuid, (const char *)p_uuid)) { - adapter->solicit_data_filters = g_slist_delete_link(adapter->solicit_data_filters, list); - } - } - - return TRUE; -} - -static gboolean adapter_le_service_clear_uuid_scan_filter_data(struct btd_adapter *adapter) -{ - DBG(""); - - g_slist_free_full(adapter->solicit_data_filters, uuid_filter_params_free); - adapter->solicit_data_filters = NULL; - - return TRUE; -} - -static gboolean adapter_le_service_add_manufacturer_scan_filter_data(struct btd_adapter *adapter, - int filter_index, int company_id, int company_id_mask, - uint8_t *p_data, uint8_t *p_mask, int data_len) -{ - - adapter_le_manf_data_params_t *params; - - DBG(""); - - params = g_new0(adapter_le_manf_data_params_t, 1); - if (!params) - return FALSE; - - params->filter_index = filter_index; - params->company_id = company_id; - params->company_id_mask = company_id_mask; - params->man_data = g_new0(uint8_t, data_len); - memcpy(params->man_data, p_data, data_len); - params->man_data_mask = g_new0(uint8_t, data_len); - memcpy(params->man_data_mask, p_mask, data_len); - params->man_data_len = data_len; - - /* Store the struct to list */ - adapter->manufaturer_data_filters = g_slist_append(adapter->manufaturer_data_filters, params); - - return TRUE; -} - -static adapter_le_manf_data_params_t *adapter_le_service_find_manufacturer_scan_filter_data(struct btd_adapter *adapter, - struct eir_msd *msd) -{ - GSList *list; - DBG(""); - list = g_slist_find_custom(adapter->manufaturer_data_filters, msd, adapter_le_manufacturer_data_cmp); - if (!list) - return NULL; - else - return list->data; - - return NULL; -} - -static gboolean adapter_le_service_delete_manufacturer_scan_filter_data(struct btd_adapter *adapter, - int filter_index, int company_id, int company_id_mask, - uint8_t *p_data, uint8_t *p_mask, int data_len) -{ - GSList *list; - DBG(""); - list = g_slist_find_custom(adapter->manufaturer_data_filters, GINT_TO_POINTER(filter_index), adapter_le_manufacturer_data_filter_index_cmp); - if (!list) - return FALSE; - else { - adapter_le_manf_data_params_t *params = list->data; - /* Delete info from the struct to list */ - if (params && strcasecmp((const char *)params->man_data, (const char *)p_data)) { - adapter->manufaturer_data_filters = g_slist_delete_link(adapter->manufaturer_data_filters, list); - } - } - - return TRUE; -} - -static gboolean adapter_le_service_clear_manufacturer_scan_filter_data(struct btd_adapter *adapter) -{ - DBG(""); - - g_slist_free_full(adapter->manufaturer_data_filters, manufacturer_filter_params_free); - adapter->manufaturer_data_filters = NULL; - - return TRUE; -} - -static gboolean adapter_le_service_add_local_name_scan_filter_data(struct btd_adapter *adapter, - int filter_index, gchar *name) -{ - - adapter_le_local_name_params_t *params; - - DBG(""); - - params = g_new0(adapter_le_local_name_params_t, 1); - if (!params) - return FALSE; - - params->filter_index = filter_index; - params->local_name = g_strdup(name); - params->name_len = strlen(name); - - /* Store the struct to list */ - adapter->local_name_filters = g_slist_append(adapter->local_name_filters, params); - - return TRUE; -} - -static adapter_le_local_name_params_t *adapter_le_service_find_local_name_scan_filter_data( - struct btd_adapter *adapter, - gchar *name) -{ - GSList *list; - DBG(""); - list = g_slist_find_custom(adapter->local_name_filters, name, adapter_le_local_name_cmp); - if (!list) - return NULL; - else - return list->data; - - return NULL; -} - -static gboolean adapter_le_service_delete_local_name_scan_filter_data(struct btd_adapter *adapter, - int filter_index, gchar *name) -{ - GSList *list; - DBG(""); - list = g_slist_find_custom(adapter->local_name_filters, GINT_TO_POINTER(filter_index), adapter_le_local_name_filter_index_cmp); - if (!list) - return FALSE; - else { - adapter_le_local_name_params_t *params = list->data; - /* Delete info from the struct to list */ - if (params && strcasecmp((const char *)params->local_name, (const char *)name)) { - adapter->local_name_filters = g_slist_delete_link(adapter->local_name_filters, list); - } - } - - return TRUE; -} - -static gboolean adapter_le_service_clear_local_name_scan_filter_data(struct btd_adapter *adapter) -{ - DBG(""); - - g_slist_free_full(adapter->local_name_filters, local_name_filter_params_free); - adapter->local_name_filters = NULL; - - return TRUE; -} - -static gboolean adapter_le_service_add_service_scan_filter_data(struct btd_adapter *adapter, - int filter_index, uint8_t *p_data, uint8_t *p_mask, int data_len) -{ - adapter_le_service_data_params_t *params; - - DBG(""); - - params = g_new0(adapter_le_service_data_params_t, 1); - if (!params) - return FALSE; - - params->filter_index = filter_index; - params->service_data = g_new0(uint8_t, data_len); - memcpy(params->service_data, p_data, data_len); - params->service_data_mask = g_new0(uint8_t, data_len); - memcpy(params->service_data_mask, p_mask, data_len); - params->service_data_len = data_len; - - /* Store the struct to list */ - adapter->service_data_filters = g_slist_append(adapter->service_data_filters, params); - - return TRUE; -} - -static adapter_le_service_data_params_t *adapter_le_service_find_service_scan_filter_data( - struct btd_adapter *adapter, struct eir_sd *sd) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->service_data_filters, sd, adapter_le_service_data_cmp); - if (!list) - return NULL; - else - return list->data; - - return NULL; -} - -static gboolean adapter_le_service_delete_service_scan_filter_data(struct btd_adapter *adapter, - int filter_index, uint8_t *p_data, uint8_t *p_mask, int data_len) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->service_data_filters, GINT_TO_POINTER(filter_index), adapter_le_service_data_filter_index_cmp); - if (!list) - return FALSE; - else { - adapter_le_service_data_params_t *params = list->data; - /* Delete info from the struct to list */ - if (params && strcasecmp((const char *)params->service_data, (const char *)p_data)) { - adapter->service_data_filters = g_slist_delete_link(adapter->service_data_filters, list); - } - } - return TRUE; -} - -static gboolean adapter_le_service_clear_service_scan_filter_data(struct btd_adapter *adapter) -{ - DBG(""); - - g_slist_free_full(adapter->service_data_filters, service_data_filter_params_free); - adapter->service_data_filters = NULL; - - return TRUE; -} - -static gboolean adapter_le_service_add_scan_filter_params(struct btd_adapter *adapter, - adapter_le_scan_filter_param_t *params) -{ - adapter_le_scan_filter_param_t *l_params; - - DBG(""); - - l_params = g_new0(adapter_le_scan_filter_param_t, 1); - if (!l_params) - return FALSE; - - l_params->action = params->action; - l_params->delivery_mode = params->delivery_mode; - l_params->feature = params->feature; - l_params->filter_logic_type = params->filter_logic_type; - l_params->index = params->index; - l_params->list_logic_type = params->list_logic_type; - l_params->onfound_timeout = params->onfound_timeout; - l_params->onfound_timeout_cnt = params->onfound_timeout_cnt; - l_params->rssi_high_threshold = params->rssi_high_threshold; - l_params->rssi_low_threshold = params->rssi_low_threshold; - - /* Store the struct to list */ - adapter->scan_params = g_slist_append(adapter->scan_params, l_params); - - return TRUE; -} - -static adapter_le_service_data_params_t *adapter_le_service_find_scan_filter_params( - struct btd_adapter *adapter, int filter_index) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->scan_params, GINT_TO_POINTER(filter_index), adapter_le_scan_params_filter_index_cmp); - if (!list) - return NULL; - else - return list->data; - - return NULL; -} - -static gboolean adapter_le_service_delete_scan_filter_params(struct btd_adapter *adapter, - adapter_le_scan_filter_param_t *params) -{ - GSList *list; - DBG(""); - - list = g_slist_find_custom(adapter->scan_params, GINT_TO_POINTER(params->index), adapter_le_scan_params_filter_index_cmp); - if (!list) - return FALSE; - else - adapter->scan_params = g_slist_remove(adapter->scan_params, list); - - return TRUE; -} - -static gboolean adapter_le_service_clear_scan_filter_params(struct btd_adapter *adapter) -{ - DBG(""); - - g_slist_free_full(adapter->scan_params, scan_filter_params_free); - adapter->scan_params = NULL; - - return TRUE; -} - -int adapter_byte_arr_cmp_with_mask(const char *data1, const char *data2, - const char *mask, int data_len) -{ - int i; - char a, b; - if (data1 == NULL || data2 == NULL || mask == NULL) - return -1; - for (i = 0; i < data_len; i++) { - a = data1[i] & mask[i]; - b = data2[i] & mask[i]; - if (a != b) - return (int)(a - b); - } - return 0; -} - -static uint8_t validate_for_filter_policy(struct btd_adapter *adapter, - const struct eir_data *eir, gchar *addr) -{ - uint8_t allow_report = NONE_REPORT; - DBG(""); - - if (adapter->scan_filter_support == FALSE) - allow_report = SCAN_REPORT; - else { - if (adapter_le_service_find_addr_scan_filter_data(adapter, addr)) - allow_report = SCAN_REPORT; - if (eir->name) { - if(adapter_le_service_find_local_name_scan_filter_data(adapter, eir->name)) - allow_report = SCAN_REPORT; - } - if (eir->sd_list) { - GSList *list = NULL; - for (list = eir->sd_list; list != NULL; list = g_slist_next(list)) { - struct eir_sd *sd = list->data; - if (sd != NULL) { - static adapter_le_uuid_params_t *uuid_data = NULL; - static adapter_le_service_data_params_t *service_data = NULL; - static adapter_le_scan_filter_param_t *scan_param_data = NULL; - uuid_data = adapter_le_service_find_uuid_scan_filter_data(adapter, (uint8_t *)sd->uuid); - service_data = adapter_le_service_find_service_scan_filter_data(adapter, sd); - if (service_data != NULL) { - if (!adapter_byte_arr_cmp_with_mask((const char *)service_data->service_data, - (const char *)sd->data, (const char *)service_data->service_data_mask, - service_data->service_data_len)) { - scan_param_data = adapter_le_service_find_scan_filter_params(adapter, - service_data->filter_index); - if (scan_param_data && scan_param_data->rssi_high_threshold > eir->tx_power && - scan_param_data->rssi_low_threshold < eir->tx_power) - allow_report = SCAN_REPORT; - } - } - if (uuid_data != NULL) { - if (!adapter_byte_arr_cmp_with_mask((const char *)uuid_data->uuid, - (const char *)sd->uuid, (const char *)uuid_data->uuid_mask, - uuid_data->uuid_len)) { - scan_param_data = adapter_le_service_find_scan_filter_params(adapter, - uuid_data->filter_index); - if (scan_param_data && scan_param_data->rssi_high_threshold > eir->tx_power && - scan_param_data->rssi_low_threshold < eir->tx_power) - allow_report = SCAN_REPORT; - } - } - if (allow_report) - break; - } - } - } - if (eir->msd_list) { - GSList *list = NULL; - for (list = eir->msd_list; list != NULL; list = g_slist_next(list)) { - struct eir_msd *msd = list->data; - if (msd != NULL) { - static adapter_le_manf_data_params_t *manuf_data; - static adapter_le_scan_filter_param_t *scan_param_data = NULL; - manuf_data = adapter_le_service_find_manufacturer_scan_filter_data(adapter, - msd); - if (manuf_data != NULL) { - if (!adapter_byte_arr_cmp_with_mask((const char *)msd->data, - (const char *)manuf_data->man_data, (const char *)manuf_data->man_data_mask, - manuf_data->man_data_len)) { - scan_param_data = adapter_le_service_find_scan_filter_params(adapter, - manuf_data->filter_index); - if (scan_param_data && scan_param_data->rssi_high_threshold > eir->tx_power && - scan_param_data->rssi_low_threshold < eir->tx_power) - allow_report = SCAN_REPORT; - } - if (msd->company == COMPANY_ID_APPLE) - allow_report = IBEACON_REPORT; - } - } - } - } - } - return allow_report; -} - -gboolean adapter_le_set_platform_scan_filter_params(struct btd_adapter *adapter, - adapter_le_scan_filter_param_t *params) -{ - gboolean ret = TRUE; - DBG("adapter_le_scan_filter_param_t [%d]", params->index); - adapter_le_scan_filter_action_type action_type = params->action; - - if (action_type == ADD) { - ret = adapter_le_service_add_scan_filter_params(adapter, params); - } else if (action_type == DELETE) { - ret = adapter_le_service_delete_scan_filter_params(adapter, params); - } else if (action_type == CLEAR) { - ret = adapter_le_service_clear_scan_filter_params(adapter); - } else { - DBG("filter_action error"); - ret = FALSE; - } - - DBG("Scan Filter VSC :: Action [%x]", - params->action); - return ret; -} - -gboolean adapter_le_set_platform_scan_filter_data(struct btd_adapter *adapter, - int client_if, int action, - int filt_type, int filter_index, - int company_id, - int company_id_mask, - int uuid_len, uint8_t *p_uuid, - int uuid_mask_len, uint8_t *p_uuid_mask, - gchar *string, int addr_type, - int data_len, uint8_t *p_data, - int mask_len, uint8_t *p_mask) -{ - gboolean ret = TRUE; - - DBG(""); - - switch (filt_type) { - case TYPE_DEVICE_ADDRESS: { - /* TYPE_DEVICE_ADDRESS */ - adapter_le_scan_filter_action_type action_type = action; - - if (action_type == ADD) { - ret = adapter_le_service_add_addr_scan_filter_data(adapter, - filter_index, string, addr_type); - } else if (action_type == DELETE) { - ret = adapter_le_service_delete_addr_scan_filter_data(adapter, - filter_index, string, addr_type); - } else if (action_type == CLEAR) { - ret = adapter_le_service_clear_addr_scan_filter_data(adapter); - } else { - DBG("filter_action error"); - ret = FALSE; - } - - break; - } - - case TYPE_SERVICE_UUID: - case TYPE_SOLICIT_UUID: { - adapter_le_scan_filter_action_type action_type = action; - - gboolean is_solicited = (filt_type == TYPE_SOLICIT_UUID) ? TRUE : FALSE; - - if (uuid_len != UUID_16_LEN && uuid_len != UUID_32_LEN - && uuid_len != UUID_128_LEN) { - DBG("UUID length error"); - return FALSE; - } - - if (uuid_len != uuid_mask_len) { - DBG("Both UUID and UUID_MASK length shoule be samed"); - return FALSE; - } - - if (action_type == ADD) { - ret = adapter_le_service_add_uuid_scan_filter_data(adapter, - filter_index, is_solicited, p_uuid, - p_uuid_mask, uuid_len); - } else if (action_type == DELETE) { - ret = adapter_le_service_delete_uuid_scan_filter_data(adapter, - filter_index, is_solicited, p_uuid, - p_uuid_mask, uuid_len); - } else if (action_type == CLEAR) { - ret = adapter_le_service_clear_uuid_scan_filter_data(adapter); - } else { - DBG("filter_action error"); - ret = FALSE; - } - - break; - } - - case TYPE_LOCAL_NAME: { - adapter_le_scan_filter_action_type action_type = action; - - if (action_type == ADD) { - ret = adapter_le_service_add_local_name_scan_filter_data(adapter, - filter_index, (gchar*)string); - } else if (action_type == DELETE) { - ret = adapter_le_service_delete_local_name_scan_filter_data(adapter, - filter_index, (gchar*)string); - } else if (action_type == CLEAR) { - ret = adapter_le_service_clear_local_name_scan_filter_data(adapter); - } else { - DBG("filter_action error"); - ret = FALSE; - } - - break; - } - - case TYPE_MANUFACTURER_DATA: { - adapter_le_scan_filter_action_type action_type = action; - - if (data_len == 0 || (data_len != mask_len)) { - DBG("parameter length error"); - return FALSE; - } - - if (action_type == ADD) { - ret = adapter_le_service_add_manufacturer_scan_filter_data(adapter, - filter_index,company_id, company_id_mask, p_data, p_mask, data_len); - } else if (action_type == DELETE) { - ret = adapter_le_service_delete_manufacturer_scan_filter_data(adapter, - filter_index, company_id, company_id_mask, p_data, p_mask, data_len); - } else if (action_type == CLEAR) { - ret = adapter_le_service_clear_manufacturer_scan_filter_data(adapter); - } else { - DBG("filter_action error"); - ret = FALSE; - } - - break; - } - - case TYPE_SERVICE_DATA: { - adapter_le_scan_filter_action_type action_type = action; - - if (data_len == 0 || (data_len != mask_len)) { - DBG("parameter length error"); - return FALSE; - } - - if (action_type == ADD) { - ret = adapter_le_service_add_service_scan_filter_data(adapter, - filter_index, p_data, p_mask, data_len); - } else if (action_type == DELETE) { - ret = adapter_le_service_delete_service_scan_filter_data(adapter, - filter_index, p_data, p_mask, data_len); - } else if (action_type == CLEAR) { - ret = adapter_le_service_clear_service_scan_filter_data(adapter); - } else { - DBG("filter_action error"); - ret = FALSE; - } - - break; - } - - default: - DBG("filter_type error"); - ret = FALSE; - } - - return ret; -} -#endif - -static int set_adv_data_flag(uint8_t *adv_data, uint8_t *data, int data_len, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - adv_data[0] = 2; - adv_data[1] = EIR_FLAGS; - - if (adapter->le_static_addr.b[5] != 0) - adv_data[2] = EIR_GEN_DISC | EIR_CONTROLLER | - EIR_SIM_HOST | EIR_BREDR_UNSUP; - else - adv_data[2] = EIR_GEN_DISC | EIR_CONTROLLER | EIR_SIM_HOST; - - memcpy(adv_data + 3, data, data_len); - return data_len + 3; -} - -static int set_adv_data_device_name(uint8_t *adv_data, int adv_len, char *name) -{ - int ad_type; - int ad_len; - int i, j; - int name_len; - uint8_t *data = NULL; - - if (!name) - return adv_len; - - data = g_memdup(adv_data, adv_len); - if (!data) - return adv_len; - - name_len = strlen(name); - - for (i = 0; i ADV_DATA_MAX_LENGTH - adv_len) { - adv_data[j] = ADV_DATA_MAX_LENGTH - adv_len + 1; - adv_data[j + 1] = EIR_NAME_SHORT; - memcpy(adv_data + j + 2, name, ADV_DATA_MAX_LENGTH - adv_len); - g_free(data); - return ADV_DATA_MAX_LENGTH; - } else { - adv_data[j + 1] = EIR_NAME_COMPLETE; - memcpy(adv_data + j + 2, name, name_len); - g_free(data); - return adv_len + name_len; - } - - } else { - memcpy(adv_data + i, &data[i], ad_len + 1); - i = i + data[i]; - } - } - - g_free(data); - return adv_len; -} - -static int set_adv_data_tx_power(uint8_t *adv_data, int adv_len, int8_t tx_power) -{ - int ad_type; - int ad_len; - int i, j; - uint8_t *data = NULL; - - data = g_memdup(adv_data, adv_len); - if (!data) - return adv_len; - - for (i = 0; i current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &disc_type, - DBUS_TYPE_INVALID)) { - return btd_error_invalid_args(msg); - } - - DBG("discovery type = %s", disc_type); - - /*Valid strings: "BREDR", "LE", "LE_BREDR" */ - if (g_strcmp0(disc_type, "BREDR") == 0) - adapter->disc_type = BT_DISC_TYPE_BREDR_ONLY; - else if (g_strcmp0(disc_type, "LE") == 0) - adapter->disc_type = BT_DISC_TYPE_LE_ONLY; - else if (g_strcmp0(disc_type, "LE_BREDR") == 0) - adapter->disc_type = BT_DISC_TYPE_LE_BREDR; - else - return btd_error_invalid_args(msg); - - /* - * Every client can only start one discovery, if the client - * already started a discovery then return an error. - */ - list = g_slist_find_custom(adapter->discovery_list, sender, - compare_sender); - if (list) - return btd_error_busy(msg); - - client = g_new0(struct watch_client, 1); - - client->adapter = adapter; - client->owner = g_strdup(sender); - client->watch = g_dbus_add_disconnect_watch(dbus_conn, sender, - discovery_disconnect, client, - discovery_destroy); - - adapter->discovery_list = g_slist_prepend(adapter->discovery_list, - client); - - /* - * Just trigger the discovery here. In case an already running - * discovery in idle phase exists, it will be restarted right - * away. - */ - trigger_start_discovery(adapter, 0); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_start_le_discovery(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct btd_adapter *adapter = user_data; - const char *sender = dbus_message_get_sender(msg); - struct watch_client *client; - GSList *list; - - DBG("sender %s", sender); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - /* - * Every client can only start one discovery, if the client - * already started a discovery then return an error. - */ - - adapter->disc_type = BT_DISC_TYPE_LE_ONLY; - DBG("adapter->disc_type[%d]", adapter->disc_type); - DBG("adapter->discovery_type [%d]", adapter->discovery_type); - - list = g_slist_find_custom(adapter->le_discovery_list, sender, - compare_sender); - if (list) - return btd_error_busy(msg); - - client = g_new0(struct watch_client, 1); - - client->adapter = adapter; - client->owner = g_strdup(sender); - client->watch = g_dbus_add_disconnect_watch(dbus_conn, sender, - le_discovery_disconnect, client, - le_discovery_destroy); - - adapter->le_discovery_list = g_slist_prepend(adapter->le_discovery_list, - client); - - /* - * Just trigger the discovery here. In case an already running - * discovery in idle phase exists, it will be restarted right - * away. - */ -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - trigger_start_discovery(adapter, 0); -#else - trigger_start_le_discovery(adapter, 0); -#endif - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_stop_le_discovery(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct btd_adapter *adapter = user_data; - const char *sender = dbus_message_get_sender(msg); - struct mgmt_cp_stop_le_discovery cp; - struct watch_client *client; - GSList *list; - - DBG("sender %s", sender); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (adapter->le_discovery_idle_timeout > 0) { - DBG("Remove LE scan trigger"); - g_source_remove(adapter->le_discovery_idle_timeout); - adapter->le_discovery_idle_timeout = 0; - } -#endif - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - list = g_slist_find_custom(adapter->le_discovery_list, sender, - compare_sender); - if (!list) - return btd_error_failed(msg, "No discovery started"); - - client = list->data; - - adapter->disc_type = BT_DISC_TYPE_LE_ONLY; - DBG("adapter->disc_type[%d]", adapter->disc_type); - DBG("adapter->discovery_type [%d]", adapter->discovery_type); - - cp.type = adapter->discovery_type; - DBG("cp.type %d", cp.type); - - /* - * The destroy function will cleanup the client information and - * also remove it from the list of discovery clients. - */ - g_dbus_remove_watch(dbus_conn, client->watch); - - /* - * As long as other discovery clients are still active, just - * return success. - */ - DBG("cp.type %d", cp.type); - DBG("adapter->le_discovery_list %d", adapter->discovery_type); - if (adapter->le_discovery_list) - return dbus_message_new_method_return(msg); - - /* - * In the idle phase of a discovery, there is no need to stop it - * and so it is enough to send out the signal and just return. - */ - DBG("cp.type %d", cp.type); - DBG("adapter->discovery_enable %d", adapter->discovery_enable); - if (adapter->discovery_enable == 0x00) { - adapter->le_discovering = false; - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); - - trigger_passive_scanning(adapter); - - return dbus_message_new_method_return(msg); - } - DBG("adapter->discovery_type %d", adapter->discovery_type); - cp.type = 0x06; - DBG("cp.type %d", cp.type); - mgmt_send(adapter->mgmt, MGMT_OP_STOP_LE_DISCOVERY, - adapter->dev_id, sizeof(cp), &cp, - stop_le_discovery_complete, adapter, NULL); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_set_advertising(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - dbus_bool_t err; - dbus_bool_t enable = FALSE; - dbus_int32_t slot_id; - - DBG("adapter_set_advertising"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_BOOLEAN, &enable, - DBUS_TYPE_INT32, &slot_id, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (adapter_le_is_supported_multi_advertising() && slot_id > 0) - err = adapter_le_enable_multi_adv(adapter, enable, slot_id); - else - err = set_mode(adapter, MGMT_OP_SET_ADVERTISING, enable); - - if (!err) - return btd_error_failed(msg, "Set Advertising failed"); - - if (enable) - create_advertiser(adapter, slot_id); - - if (err && slot_id > 0) - advertising_state_changed(adapter, slot_id, enable); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_set_advertising_params(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_set_advertising_params cp; - dbus_uint32_t interval_min; - dbus_uint32_t interval_max; - dbus_uint32_t filter_policy; - dbus_uint32_t type; - dbus_int32_t slot_id; - gboolean ret; - - DBG("Set customised advertising parameters"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_UINT32, &interval_min, - DBUS_TYPE_UINT32, &interval_max, - DBUS_TYPE_UINT32, &filter_policy, - DBUS_TYPE_UINT32, &type, - DBUS_TYPE_INT32, &slot_id, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - memset(&cp, 0, sizeof(cp)); - - DBG("advertising interval min %x, max %x, filter %x type %x", - interval_min, interval_max, filter_policy, type); - - if (filter_policy > 0x03) - return btd_error_invalid_args(msg); - - if (type > 0x04) - return btd_error_invalid_args(msg); - - if (adapter_le_is_supported_multi_advertising() && slot_id > 0) { - adapter_le_adv_inst_info_t *p_inst; - adapter_le_adv_param_t *p_params; - - p_inst = malloc(sizeof(adapter_le_adv_inst_info_t)); - p_params = malloc(sizeof(adapter_le_adv_param_t)); - memset(p_inst, 0, sizeof(adapter_le_adv_inst_info_t)); - memset(p_params, 0, sizeof(adapter_le_adv_param_t)); - p_inst->inst_id = slot_id; - p_params->adv_int_min = interval_min; - p_params->adv_int_max = interval_max; - p_params->adv_type = type; - p_params->channel_map = 0x07; /* fixed channel :: will be used all */ - p_params->adv_filter_policy = filter_policy; - p_params->tx_power = BLE_ADV_TX_POWER_MID; /* TODO:need to optimize */ - if (adapter->le_static_addr.b[5] != 0) { - p_inst->bdaddr_type = 0x01; - bacpy(&p_inst->bdaddr, &adapter->le_static_addr); - } else { - p_inst->bdaddr_type = 0x00; - bacpy(&p_inst->bdaddr, &adapter->bdaddr); - } - - ret = adapter_le_set_multi_adv_params(p_inst, p_params); - - free(p_inst); - free(p_params); - - if (ret) - return dbus_message_new_method_return(msg); - else - return btd_error_failed(msg, "set advertising param failed"); - } else { - cp.interval_max = interval_max; - cp.interval_min = interval_min; - cp.filter_policy = filter_policy; - cp.type = type; - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_ADVERTISING_PARAMS, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "set advertising param failed"); - } -} - -static DBusMessage *adapter_set_advertising_data(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_set_advertising_data cp; - uint8_t *value; - int32_t len = 0; - dbus_int32_t slot_id; - uint8_t *adv_data = NULL; - int adv_len = 0; - char *adapter_name = adapter->name; - char le_name[MAX_NAME_LENGTH + 1] = { 0 }; - - DBG("Set advertising data"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &value, &len, - DBUS_TYPE_INT32, &slot_id, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (len > ADV_DATA_MAX_LENGTH - 3) - return btd_error_invalid_args(msg); - - if (adapter->le_static_addr.b[5] != 0) { - char *ptr = NULL; - - g_strlcpy(le_name, adapter_name, - sizeof(le_name) - LE_BEARER_POSTFIX_LEN); - if (!g_utf8_validate(le_name, -1, (const char **)&ptr)) - *ptr = '\0'; - - g_strlcat(le_name, LE_BEARER_POSTFIX, sizeof(le_name)); - adapter_name = le_name; - } - - adapter_le_set_missed_adv_data(value, len, FALSE, - adapter_name, adapter->adv_tx_power, &adv_data, &adv_len, adapter); - - if (adapter_le_is_supported_multi_advertising() && slot_id > 0) { - if (adapter_le_set_multi_adv_data(slot_id, FALSE, adv_len, adv_data)) { - g_free(adv_data); - return dbus_message_new_method_return(msg); - } else { - g_free(adv_data); - return btd_error_failed(msg, "set advertising data failed"); - } - } else { - memcpy(&cp, adv_data, adv_len); - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_ADVERTISING_DATA, - adapter->dev_id, adv_len, - &cp, NULL, NULL, NULL) > 0) { - g_free(adv_data); - return dbus_message_new_method_return(msg); - } - - g_free(adv_data); - return btd_error_failed(msg, "set advertising data failed"); - } -} - -static DBusMessage *adapter_le_scan_filter_param_setup(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - dbus_bool_t ctlr_filter_support = TRUE; -#endif - dbus_int32_t client_if, action, filt_index; - dbus_int32_t feat_seln, list_logic_type, filt_logic_type; - dbus_int32_t rssi_high_thres, rssi_low_thres, dely_mode; - dbus_int32_t found_timeout, lost_timeout, found_timeout_cnt; - adapter_le_scan_filter_param_t params; - gboolean err; - - DBG("adapter_le_scan_filter_param_setup"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (adapter_le_get_scan_filter_size() == 0) -#ifndef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - return btd_error_not_supported(msg); -#else - ctlr_filter_support = FALSE; -#endif - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &client_if, - DBUS_TYPE_INT32, &action, - DBUS_TYPE_INT32, &filt_index, - DBUS_TYPE_INT32, &feat_seln, - DBUS_TYPE_INT32, &list_logic_type, - DBUS_TYPE_INT32, &filt_logic_type, - DBUS_TYPE_INT32, &rssi_high_thres, - DBUS_TYPE_INT32, &rssi_low_thres, - DBUS_TYPE_INT32, &dely_mode, - DBUS_TYPE_INT32, &found_timeout, - DBUS_TYPE_INT32, &lost_timeout, - DBUS_TYPE_INT32, &found_timeout_cnt, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - memset(¶ms, 0, sizeof(params)); - - params.action = action; - params.index = filt_index; - params.feature = feat_seln; - params.filter_logic_type = filt_logic_type; - params.list_logic_type = list_logic_type; - params.delivery_mode = dely_mode; - params.rssi_high_threshold = rssi_high_thres; - - if (params.delivery_mode == ON_FOUND) { - params.rssi_low_threshold = rssi_low_thres; - params.onfound_timeout = found_timeout; - params.onfound_timeout_cnt = found_timeout_cnt; - params.onlost_timeout = lost_timeout; - } - -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - if (ctlr_filter_support) -#endif - err = adapter_le_set_scan_filter_params(¶ms); -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - else - err = adapter_le_set_platform_scan_filter_params(adapter, ¶ms); -#endif - - if (!err) - return btd_error_failed(msg, "Failed to scan filter param setup"); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_le_scan_filter_add_remove(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct btd_device *dev = NULL; - dbus_int32_t client_if, action, filt_type, filt_index; - dbus_int32_t company_id, company_id_mask; - gchar *address = NULL; - dbus_uint32_t address_type = 0; - uint8_t addr_type; - GSList *list; - char ida_string[18]; - uint8_t *p_uuid, *p_uuid_mask, *p_data, *p_mask; - int32_t uuid_len = 0, uuid_mask_len = 0, data_len = 0, mask_len = 0; - gboolean err; -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - dbus_bool_t ctlr_filter_support = TRUE; -#endif - - DBG("adapter_le_scan_filter_add_remove"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - /* if controller does not support vendor specific scan filtering feature - * then add the filter into platform supported scan filters. - */ - if (adapter_le_get_scan_filter_size() == 0) { -#ifndef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - return btd_error_not_supported(msg); -#else - ctlr_filter_support = FALSE; -#endif - } - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &client_if, - DBUS_TYPE_INT32, &action, - DBUS_TYPE_INT32, &filt_type, - DBUS_TYPE_INT32, &filt_index, - DBUS_TYPE_INT32, &company_id, - DBUS_TYPE_INT32, &company_id_mask, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &p_uuid, &uuid_len, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &p_uuid_mask, &uuid_mask_len, - DBUS_TYPE_STRING, &address, - DBUS_TYPE_UINT32, &address_type, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &p_data, &data_len, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &p_mask, &mask_len, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - list = g_slist_find_custom(adapter->devices, address, device_rpa_cmp); - if (!list) - list = g_slist_find_custom(adapter->devices, address, - device_address_cmp); - if (list) - dev = list->data; - if (dev && device_get_rpa_exist(dev) == true) { - ba2str(device_get_address(dev), ida_string); - if (btd_device_get_bdaddr_type(dev) == BDADDR_LE_PUBLIC) - addr_type = 0x00; - else - addr_type = 0x01; - } else { - memcpy(ida_string, address, sizeof(ida_string)); - addr_type = 0x00; - } - - DBG("addr %s, type %d", ida_string, addr_type); - -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - if (ctlr_filter_support) -#endif - err = adapter_le_set_scan_filter_data(client_if, action, filt_type, - filt_index, company_id, company_id_mask, - uuid_len, p_uuid, uuid_mask_len, p_uuid_mask, - ida_string, addr_type, data_len, p_data, mask_len, p_mask); -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - else - err = adapter_le_set_platform_scan_filter_data(adapter, client_if, action, filt_type, - filt_index, company_id, company_id_mask, - uuid_len, p_uuid, uuid_mask_len, p_uuid_mask, - ida_string, addr_type, data_len, p_data, mask_len, p_mask); -#endif - if (!err) - return btd_error_failed(msg, "Failed to add/remove filter"); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_le_scan_filter_clear(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - dbus_int32_t client_if = 0; - dbus_int32_t filt_index = 0; - gboolean err; -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - dbus_bool_t ctlr_filter_support = TRUE; -#endif - - DBG("adapter_le_scan_filter_clear"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (adapter_le_get_scan_filter_size() == 0) -#ifndef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - return btd_error_not_supported(msg); -#else - ctlr_filter_support = FALSE; -#endif - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &client_if, - DBUS_TYPE_INT32, &filt_index, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - if (ctlr_filter_support) -#endif - err = adapter_le_clear_scan_filter_data(client_if, filt_index); -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - else - err = adapter_le_clear_platform_scan_filter_data(adapter, filt_index); -#endif - - if (!err) - return btd_error_failed(msg, "Failed to clear filter"); - - return dbus_message_new_method_return(msg); -} - - -static DBusMessage *adapter_le_scan_filter_enable(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - dbus_bool_t enable = FALSE; - dbus_int32_t client_if = 0; - gboolean err; -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - dbus_bool_t ctlr_filter_support = TRUE; -#endif - - DBG("adapter_le_scan_filter_enable"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - /* if controller does not support vendor specific scan filtering feature - * then enable platform supported scan filtering functionalites. - */ -#endif - if (adapter_le_get_scan_filter_size() == 0) -#ifndef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - return btd_error_not_supported(msg); -#else - ctlr_filter_support = FALSE; -#endif - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INT32, &client_if, - DBUS_TYPE_BOOLEAN, &enable, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - if (ctlr_filter_support) -#endif - err = adapter_le_enable_scan_filtering(enable); -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - else - err = adapter_le_enable_platform_scan_filtering(adapter, enable); -#endif - - if (!err) - return btd_error_failed(msg, "Failed to enable scan filtering"); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_le_set_scan_params(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_le_set_scan_params cp; - uint32_t type; - uint32_t interval; - uint32_t window; - - DBG("Set scan parameters"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_UINT32, &type, - DBUS_TYPE_UINT32, &interval, - DBUS_TYPE_UINT32, &window, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - DBG("scan type %x, interval %x, window %x", - type, interval, window); - memset(&cp, 0, sizeof(cp)); - - cp.type = type; - cp.interval = interval; - cp.window = window; - adapter->scan_type = type; - - if (mgmt_send(adapter->mgmt, MGMT_OP_LE_SET_SCAN_PARAMS, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "set scan parameters failed"); -} - -static DBusMessage *adapter_set_scan_rsp_data(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_set_scan_rsp_data cp; - uint8_t *value; - int32_t len = 0; - dbus_int32_t slot_id; - uint8_t *adv_data = NULL; - int adv_len = 0; - - char *adapter_name = adapter->name; - char le_name[MAX_NAME_LENGTH + 1] = { 0 }; - - DBG("Set scan response data"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &value, &len, - DBUS_TYPE_INT32, &slot_id, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (len > SCAN_RESPONSE_DATA_LENGTH_MAX) - return btd_error_invalid_args(msg); - - if (adapter->le_static_addr.b[5] != 0) { - char *ptr = NULL; - - g_strlcpy(le_name, adapter_name, - sizeof(le_name) - LE_BEARER_POSTFIX_LEN); - if (!g_utf8_validate(le_name, -1, (const char **)&ptr)) - *ptr = '\0'; - - g_strlcat(le_name, LE_BEARER_POSTFIX, sizeof(le_name)); - adapter_name = le_name; - } - - adapter_le_set_missed_adv_data(value, len, TRUE, - adapter_name, adapter->adv_tx_power, &adv_data, &adv_len, adapter); - - if (adapter_le_is_supported_multi_advertising() && slot_id > 0) { - if (adapter_le_set_multi_adv_data(slot_id, TRUE, adv_len, (uint8_t *)adv_data)) { - g_free(adv_data); - return dbus_message_new_method_return(msg); - } else { - g_free(adv_data); - return btd_error_failed(msg, "set advertising data failed"); - } - } else { - memcpy(&cp, adv_data, adv_len); - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_SCAN_RSP_DATA, - adapter->dev_id, adv_len, &cp, - NULL, NULL, NULL) > 0) { - g_free(adv_data); - return dbus_message_new_method_return(msg); - } - - g_free(adv_data); - return btd_error_failed(msg, "set scan reponse data failed"); - } -} - -static DBusMessage *adapter_add_device_white_list(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_add_dev_white_list cp; - const gchar *address; - bdaddr_t bdaddr; - dbus_uint32_t address_type; - struct btd_device *dev; - - DBG("Add device whie list"); - if (dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &address, - DBUS_TYPE_UINT32, &address_type, - DBUS_TYPE_INVALID) == FALSE) - return btd_error_invalid_args(msg); - - if (bachk(address) < 0) - return btd_error_invalid_args(msg); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - DBG("addr %s, type %d", address, address_type); - str2ba(address, &bdaddr); - - dev = btd_adapter_find_device(adapter, &bdaddr, - address_type ? BDADDR_LE_RANDOM : BDADDR_LE_PUBLIC); - if (dev && device_get_rpa_exist(dev) == true) { - if (adapter_le_is_supported_offloading() == FALSE) { - error("Spec based command is not supported yet"); - return btd_error_not_supported(msg); - } - - /* Add IRK value to list */ - if (adapter_le_add_irk_to_list(device_get_irk_value(dev), - device_get_address(dev), - btd_device_get_bdaddr_type(dev))) { - return dbus_message_new_method_return(msg); - } else { - return btd_error_failed(msg, "Add LE IRK to list failed"); - } - } - - memset(&cp, 0, sizeof(cp)); - - cp.bdaddr_type = address_type; - memcpy(&cp.bdaddr, &bdaddr, sizeof(bdaddr_t)); - - if (mgmt_send(adapter->mgmt, MGMT_OP_ADD_DEV_WHITE_LIST, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "add device white list failed"); -} - -static DBusMessage *adapter_remove_device_white_list(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_remove_dev_white_list cp; - const gchar *address; - bdaddr_t bdaddr; - dbus_uint32_t address_type; - struct btd_device *dev; - - DBG("Remove device whie list"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &address, - DBUS_TYPE_UINT32, &address_type, - DBUS_TYPE_INVALID) == FALSE) - return btd_error_invalid_args(msg); - - if (bachk(address) < 0) - return btd_error_invalid_args(msg); - - DBG("addr %s, type %d", address, address_type); - str2ba(address, &bdaddr); - - dev = btd_adapter_find_device(adapter, &bdaddr, - address_type ? BDADDR_LE_RANDOM : BDADDR_LE_PUBLIC); - if (dev && device_get_rpa_exist(dev) == true) { - if (adapter_le_is_supported_offloading() == FALSE) { - error("Spec based command is not supported yet"); - return btd_error_not_supported(msg); - } - - /* Remove IRK value to list */ - if (adapter_le_remove_irk_to_list(device_get_address(dev), - btd_device_get_bdaddr_type(dev))) { - return dbus_message_new_method_return(msg); - } else { - return btd_error_failed(msg, "Remove IRK is failed"); - } - } - - memset(&cp, 0, sizeof(cp)); - - cp.bdaddr_type = address_type; - memcpy(&cp.bdaddr, &bdaddr, sizeof(bdaddr_t)); - - if (mgmt_send(adapter->mgmt, MGMT_OP_REMOVE_DEV_FROM_WHITE_LIST, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "remove device white list failed"); -} - -static DBusMessage *adapter_clear_device_white_list(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - - DBG("Clear device whie list"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (mgmt_send(adapter->mgmt, MGMT_OP_CLEAR_DEV_WHITE_LIST, - adapter->dev_id, 0, NULL, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "clear white list failed"); -} - -static DBusMessage *adapter_set_le_privacy(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - dbus_bool_t err; - dbus_bool_t enable_privacy = FALSE; - - if (!(adapter->supported_settings & MGMT_SETTING_PRIVACY)) - return btd_error_not_supported(msg); - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_BOOLEAN, - &enable_privacy, DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (enable_privacy) { - if (adapter->current_settings & MGMT_SETTING_PRIVACY) - return btd_error_already_exists(msg); - } else { - if (!(adapter->current_settings & MGMT_SETTING_PRIVACY)) - return btd_error_already_exists(msg); - } - - err = set_privacy(adapter, enable_privacy); - - if (!err) - return btd_error_failed(msg, "Set Le Privacy failed"); - - return dbus_message_new_method_return(msg); -} - -static void set_le_static_address(struct btd_adapter *adapter) -{ - int fd; - int ret; - char address[18]; - char dirname[PATH_MAX]; - - snprintf(dirname, PATH_MAX, STORAGEDIR "/%s", "le_static_addr"); - if (access(dirname, F_OK) < 0) { - int i; - bdaddr_t le_static_addr; - - le_static_addr.b[5] = adapter->bdaddr.b[5] | 0xc0; - for (i = 0; i < 5; i++) { - le_static_addr.b[i] = - (adapter->bdaddr.b[i] & 0x7f) << 1 | - (adapter->bdaddr.b[i] & 0x80) >> 7; - } - - /* - * < How to get Public address from above static address > - * - * for (i = 0; i < 5; i++) { - * bredr_addr.b[i] = - * (adapter->le_static_addr.b[i] & 0xfe) >> 1 | - * (adapter->le_static_addr.b[i] & 0x01) << 7; - * } - * bredr_addr.b[5] = {the value from advertising data} - */ - - fd = open(dirname, O_WRONLY | O_CREAT, 0644); - if (fd >= 0) { - ba2str(&le_static_addr, address); - DBG("LE static random : %s", address); - ret = write(fd, address, strlen(address)); - if (ret < 0) { - error("Cannot save LE address : %s", - strerror(errno)); - } - - ret = fdatasync(fd); - if (ret < 0) - error("sync failed : %s", strerror(errno)); - - close(fd); - } else { - error("Cannot save LE address"); - } - bacpy(&adapter->le_static_addr, &le_static_addr); - } else { - fd = open(dirname, O_RDONLY); - if (fd >= 0) { - ret = read(fd, address, sizeof(address)); - if (ret >= 17) { - /* xx:xx:xx:xx:xx:xx */ - address[17] = '\0'; - DBG("LE static random : %s", address); - str2ba(address, &adapter->le_static_addr); - adapter->le_static_addr.b[5] |= 0xc0; - } else - error("Invalid LE address"); - close(fd); - } else { - error("Cannot get LE address"); - } - } - - return; -} - -static void set_le_static_address_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - DBG("index %u status 0x%02x", adapter->dev_id, status); - - if (status != MGMT_STATUS_SUCCESS) { - error("Failed to set static address for index %u: %s (0x%02x)", - adapter->dev_id, mgmt_errstr(status), status); - if (adapter->le_static_addr.b[5] != 0) - bacpy(&adapter->le_static_addr, BDADDR_ANY); - else - set_le_static_address(adapter); - return; - } - - return; -} - -static DBusMessage *adapter_set_le_static_address(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - dbus_bool_t is_enable = FALSE; - struct mgmt_cp_set_static_address cp; - - if (!(adapter->supported_settings & MGMT_OP_SET_STATIC_ADDRESS)) { - error("LE static address is not supported"); - return btd_error_not_supported(msg); - } - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_BOOLEAN, &is_enable, - DBUS_TYPE_INVALID)) { - error("Invalid arguments"); - return btd_error_invalid_args(msg); - } - - memset(&cp, 0x00, sizeof(cp)); - if (is_enable) { - if (adapter->le_static_addr.b[5] != 0) { - DBG("LE static address is already configured"); - return dbus_message_new_method_return(msg); - } - set_le_static_address(adapter); - bacpy(&cp.bdaddr, &adapter->le_static_addr); - } else { - if (adapter->le_static_addr.b[5] == 0) { - DBG("LE static address is not configured"); - return dbus_message_new_method_return(msg); - } - bacpy(&adapter->le_static_addr, BDADDR_ANY); - } - DBG("Set static random address : %d", is_enable); - - if (mgmt_send(mgmt_master, MGMT_OP_SET_STATIC_ADDRESS, adapter->dev_id, - sizeof(cp), &cp, - set_le_static_address_complete, adapter, NULL) <= 0) { - error("Failed to set static address : %d", is_enable); - if (is_enable) - bacpy(&adapter->le_static_addr, BDADDR_ANY); - else - set_le_static_address(adapter); - return btd_error_failed(msg, "Unable to set static address"); - } - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_enable_rssi(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_set_enable_rssi cp; - struct mgmt_cp_disable_rssi cp_dis; - bdaddr_t bt_addr = { { 0, } }; - const gchar *address = NULL; - - const char *sender = dbus_message_get_sender(msg); - dbus_int32_t link_type; - dbus_int32_t low_threshold; - dbus_int32_t in_range_threshold; - dbus_int32_t high_threshold; - - DBG("Enable RSSI called"); - DBG("sender %s", sender); - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &address, - DBUS_TYPE_INT32, &link_type, - DBUS_TYPE_INT32, &low_threshold, - DBUS_TYPE_INT32, &in_range_threshold, - DBUS_TYPE_INT32, &high_threshold, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - DBG("Enable RSSI: [%s %d %d %d %d]", address, link_type, - low_threshold, in_range_threshold, high_threshold); - - DBG("BT address [%s]", address); - memset(&bt_addr, 0, sizeof(bdaddr_t)); - str2ba(address, &bt_addr); - memset(&cp, 0, sizeof(struct mgmt_cp_set_enable_rssi)); - memset(&cp_dis, 0, sizeof(struct mgmt_cp_disable_rssi)); - - if (bachk(address) < 0) - return btd_error_invalid_args(msg); - -// if (!btd_adapter_find_device(adapter, address)) -// return btd_error_not_found(msg); - - if (low_threshold == 0 && in_range_threshold == 0 && high_threshold == 0) { - cp_dis.bdaddr = bt_addr; - cp_dis.link_type = link_type; - DBG("Disable Request"); - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_RSSI_DISABLE, - adapter->dev_id, sizeof(cp_dis), &cp_dis, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - } else { - cp.low_th = low_threshold; - cp.in_range_th = in_range_threshold; - cp.high_th = high_threshold; - cp.bdaddr = bt_addr; - cp.link_type = link_type; - DBG("Enable Request"); - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_RSSI_ENABLE, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - } - return btd_error_failed(msg, "Enable/Disable RSSI Failed"); -} - -static DBusMessage *adapter_get_rssi(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_get_raw_rssi cp; - bdaddr_t bt_addr; - const gchar *address = NULL; - dbus_int32_t link_type; - const char *sender = dbus_message_get_sender(msg); - - DBG("Get RSSI called"); - DBG("sender %s", sender); - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &address, - DBUS_TYPE_INT32, &link_type, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - DBG("BT address [%s] link type [%d]", address, link_type); - memset(&bt_addr, 0, sizeof(bdaddr_t)); - str2ba(address, &bt_addr); - memset(&cp, 0, sizeof(struct mgmt_cp_get_raw_rssi)); - - if (bachk(address) < 0) - return btd_error_invalid_args(msg); - -// if (!btd_adapter_find_device(adapter, address)) -// return btd_error_not_found(msg); - - memcpy(&(cp.bt_address), &bt_addr, sizeof(bdaddr_t)); - cp.link_type = link_type; - DBG("RAW RSSI Request"); - if (mgmt_send(adapter->mgmt, MGMT_OP_GET_RAW_RSSI, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "Get Raw RSSI Failed"); -} - -#if !defined(__SPRD_PATCH__) -static void get_adv_tx_power_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - const struct mgmt_rp_get_adv_tx_power *rp = param; - - if (!rp) { - error("Error ocurred in Getting adv tx power, rp is NULL"); - return; - } - - if (status != MGMT_STATUS_SUCCESS) { - error("Failed to get adv tx power: %s (0x%02x)", - mgmt_errstr(status), status); - return; - } - - if (length < sizeof(*rp)) { - error("Wrong size of get adv tx power"); - return; - } - - adapter->adv_tx_power = rp->adv_tx_power; - return; -} - -static void adapter_get_adv_tx_power(void *data) -{ - struct btd_adapter *adapter = data; - - mgmt_send(adapter->mgmt, MGMT_OP_GET_ADV_TX_POWER, - adapter->dev_id, 0, NULL, - get_adv_tx_power_complete, adapter, NULL); - return; -} -#endif - -static DBusMessage *set_wbs_parameters(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - const gchar *role = NULL; - const gchar *address = NULL; - struct mgmt_cp_set_voice_setting cp; - bdaddr_t bt_addr = { { 0, } }; - - DBG("+"); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &role, - DBUS_TYPE_STRING, &address, - DBUS_TYPE_INVALID)) { - return btd_error_invalid_args(msg); - } - - DBG("Role = %s", role); - DBG("Address = %s", address); - - memset(&cp, 0, sizeof(cp)); - - cp.voice_setting = BT_VOICE_TRANSPARENT | BT_VOICE_CVSD_16BIT; - - if (g_strcmp0(role, "Handsfree") == 0) - cp.sco_role = MGMT_SCO_ROLE_HANDSFREE; - else if (g_strcmp0(role, "Gateway") == 0) - cp.sco_role = MGMT_SCO_ROLE_AUDIO_GATEWAY; - - str2ba(address, &bt_addr); - memcpy(&(cp.bdaddr), &bt_addr, sizeof(bdaddr_t)); - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_VOICE_SETTING, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) == 0) - error("mgmt_send failed for voice setting"); - - DBG("-"); - return dbus_message_new_method_return(msg); -} - -static DBusMessage *set_nb_parameters(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - const gchar *role; - const gchar *address = NULL; - struct mgmt_cp_set_voice_setting cp; - bdaddr_t bt_addr = { { 0, } }; - - DBG("+"); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &role, - DBUS_TYPE_STRING, &address, - DBUS_TYPE_INVALID)) { - return btd_error_invalid_args(msg); - } - - DBG("Role = %s", role); - DBG("Address = %s", address); - - memset(&cp, 0, sizeof(cp)); - - cp.voice_setting = BT_VOICE_CVSD_16BIT; - - if (g_strcmp0(role, "Handsfree") == 0) - cp.sco_role = MGMT_SCO_ROLE_HANDSFREE; - else if (g_strcmp0(role, "Gateway") == 0) - cp.sco_role = MGMT_SCO_ROLE_AUDIO_GATEWAY; - - str2ba(address, &bt_addr); - memcpy(&(cp.bdaddr), &bt_addr, sizeof(bdaddr_t)); - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_VOICE_SETTING, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) == 0) - error("mgmt_send failed for voice setting"); - - DBG("-"); - - return dbus_message_new_method_return(msg); -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void btd_adapter_set_read_le_data_length_handler( - struct btd_adapter *adapter, - struct le_data_length_read_handler *handler) -{ - adapter->read_handler = handler; -} - -static void le_read_maximum_data_length_return_param_complete( - uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - const struct mgmt_rp_le_read_maximum_data_length *rp = param; - uint16_t max_tx_octects, max_tx_time; - uint16_t max_rx_octects, max_rx_time; - - if (!rp) { - error("Error ocurred in Reading maximum data length, rp is NULL"); - g_free(adapter->read_handler); - return; - } - - if (status != MGMT_STATUS_SUCCESS) { - error("le read maximum data length failed: %s (0x%02x)", - mgmt_errstr(status), status); - max_tx_octects = 0; - max_tx_time =0; - max_rx_octects = 0; - max_rx_time = 0; - - g_free(adapter->read_handler); - return; - } - - if (length < sizeof(*rp)) { - error("Too small le read maximum data length response"); - g_free(adapter->read_handler); - return; - } else { - max_tx_octects = rp->max_tx_octets; - max_tx_time =rp->max_tx_time; - max_rx_octects = rp->max_rx_octets; - max_rx_time = rp->max_rx_time; - } - - if (!adapter->read_handler || - !adapter->read_handler->read_callback) { - g_free(adapter->read_handler); - return; - } - - adapter->read_handler->read_callback(adapter, - max_tx_octects, max_tx_time, - max_rx_octects, max_rx_time, - adapter->read_handler->user_data); - - g_free(adapter->read_handler); - adapter->read_handler = NULL; -} - -int btd_adapter_le_read_maximum_data_length( - struct btd_adapter *adapter) -{ - if (mgmt_send(adapter->mgmt, - MGMT_OP_LE_READ_MAXIMUM_DATA_LENGTH, - adapter->dev_id, 0, NULL, - le_read_maximum_data_length_return_param_complete, - adapter, NULL) > 0) - return 0; - - return -EIO; -} - -static gint read_request_cmp(gconstpointer a, gconstpointer b) -{ - const struct le_data_length_read_request *data = a; - const struct btd_adapter *adapter = b; - - return data->adapter != adapter; -} - -static struct le_data_length_read_request *find_read_le_data_length_request( - struct btd_adapter *adapter) -{ - GSList *match; - - match = g_slist_find_custom(read_requests, adapter, read_request_cmp); - - if (match) - return match->data; - - return NULL; -} - -static void le_read_data_length_complete( - struct btd_adapter *adapter, - uint16_t max_tx_octects, uint16_t max_tx_time, - uint16_t max_rx_octects, uint16_t max_rx_time, - void *user_data) -{ - DBusMessage *reply; - struct le_data_length_read_request *read_request; - - read_request = find_read_le_data_length_request(adapter); - if (!read_request) - return; - - reply = g_dbus_create_reply(read_request->msg, - DBUS_TYPE_UINT16, &max_tx_octects, - DBUS_TYPE_UINT16, &max_tx_time, - DBUS_TYPE_UINT16, &max_rx_octects, - DBUS_TYPE_UINT16, &max_rx_time, - DBUS_TYPE_INVALID); - - if (!reply) { - btd_error_failed(read_request->msg, - "Failed to read max data length."); - return; - } - - read_requests = g_slist_remove(read_requests, read_request); - dbus_message_unref(read_request->msg); - g_free(read_request); - - if (!g_dbus_send_message(dbus_conn, reply)) - error("D-Bus send failed"); -} - -static DBusMessage *le_read_maximum_data_length( - DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_adapter *adapter = user_data; - struct le_data_length_read_request *read_request; - struct le_data_length_read_handler *handler; - - if (find_read_le_data_length_request(adapter)) - return btd_error_in_progress(msg); - - if (btd_adapter_le_read_maximum_data_length(adapter)) - return btd_error_failed(msg, "Unable to read maximum le data length"); - - read_request = g_new(struct le_data_length_read_request, 1); - - read_request->msg = dbus_message_ref(msg); - read_request->adapter = adapter; - - read_requests = g_slist_append(read_requests, read_request); - - handler = g_new0(struct le_data_length_read_handler, 1); - - handler->read_callback = - (read_max_data_length_cb_t)le_read_data_length_complete; - - btd_adapter_set_read_le_data_length_handler( - read_request->adapter, handler); - - return NULL; - -} - -void le_write_host_suggested_data_length_return_param_complete( - uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - if (status != MGMT_STATUS_SUCCESS) { - error("le write host suggested data length failed: %s (0x%02x)", - mgmt_errstr(status), status); - } - - return; -} - -static DBusMessage *le_write_host_suggested_default_data_length( - DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_adapter *adapter = user_data; - struct mgmt_cp_le_write_host_suggested_data_length cp; - dbus_uint16_t def_tx_Octets; - dbus_uint16_t def_tx_time; - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_UINT16, &def_tx_Octets, - DBUS_TYPE_UINT16, &def_tx_time, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - memset(&cp, 0, sizeof(cp)); - cp.def_tx_octets = def_tx_Octets; - cp.def_tx_time = def_tx_time; - - if (mgmt_send(adapter->mgmt, - MGMT_OP_LE_WRITE_HOST_SUGGESTED_DATA_LENGTH, - adapter->dev_id, sizeof(cp), &cp, - le_write_host_suggested_data_length_return_param_complete, - adapter, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "Unable to write host suggested le data length values"); -} - -static void le_read_suggested_default_data_length_return_param_complete( - uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - const struct mgmt_rp_le_read_host_suggested_data_length *rp = param; - uint16_t def_tx_octects, def_tx_time; - - if (!rp) { - error("Error ocurred in Reading suggested data length, rp is NULL"); - if (adapter->def_read_handler) - g_free(adapter->def_read_handler->user_data); - - g_free(adapter->def_read_handler); - return; - } - - if (status != MGMT_STATUS_SUCCESS) { - error("Read host suggested def le data length values failed: %s (0x%02x)", - mgmt_errstr(status), status); - def_tx_octects = 0; - def_tx_time =0; - - if (adapter->def_read_handler) - g_free(adapter->def_read_handler->user_data); - - g_free(adapter->def_read_handler); - return; - } - - if (length < sizeof(*rp)) { - goto done; - } else { - def_tx_octects = rp->def_tx_octets; - def_tx_time =rp->def_tx_time; - DBG("retrieving host suggested data length values %d %d", def_tx_octects, def_tx_time); - } - - if (!adapter->def_read_handler) - return; - - if(!adapter->def_read_handler->read_callback) { - goto done; - } - - adapter->def_read_handler->read_callback(adapter, - def_tx_octects, def_tx_time, - adapter->def_read_handler->user_data); -done: - if (adapter->def_read_handler) - g_free(adapter->def_read_handler->user_data); - - g_free(adapter->def_read_handler); - adapter->def_read_handler = NULL; -} - -int btd_adapter_le_read_suggested_default_data_length( - struct btd_adapter *adapter) -{ - if (mgmt_send(adapter->mgmt, - MGMT_OP_LE_READ_HOST_SUGGESTED_DATA_LENGTH, - adapter->dev_id, 0, NULL, - le_read_suggested_default_data_length_return_param_complete, - adapter, NULL) > 0) { - return 0; - } - - return -EIO; -} - -static void le_read_host_suggested_default_length_complete( - struct btd_adapter *adapter, - uint16_t def_tx_octects, uint16_t def_tx_time, - void *user_data) -{ - DBusMessage *reply; - struct le_data_length_read_request *read_request; - - read_request = find_read_le_data_length_request(adapter); - if (!read_request) - return; - - reply = g_dbus_create_reply(read_request->msg, - DBUS_TYPE_UINT16, &def_tx_octects, - DBUS_TYPE_UINT16, &def_tx_time, - DBUS_TYPE_INVALID); - - if (!reply) { - btd_error_failed(read_request->msg, - "Failed to read host suggested def data length values"); - return; - } - - read_requests = g_slist_remove(read_requests, read_request); - dbus_message_unref(read_request->msg); - g_free(read_request); - - if (!g_dbus_send_message(dbus_conn, reply)) - error("D-Bus send failed"); -} - -static DBusMessage *le_read_host_suggested_default_data_length( - DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_adapter *adapter = user_data; - struct le_data_length_read_request *read_request; - struct le_data_length_read_default_data_length_handler *handler; - - if (find_read_le_data_length_request(adapter)) - return btd_error_in_progress(msg); - - if (btd_adapter_le_read_suggested_default_data_length(adapter)) - return btd_error_failed(msg, "Unable to read host suggested def data length"); - - read_request = g_new(struct le_data_length_read_request, 1); - - read_request->msg = dbus_message_ref(msg); - read_request->adapter = adapter; - - read_requests = g_slist_append(read_requests, read_request); - - handler = g_new0(struct le_data_length_read_default_data_length_handler, 1); - - handler->read_callback = - (read_host_suggested_default_data_length_cb_t)le_read_host_suggested_default_length_complete; - - read_request->adapter->def_read_handler = handler; - - return NULL; -} - -void le_set_data_length_return_param_complete( - uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - if (status != MGMT_STATUS_SUCCESS) { - error("le_set_data_length failed: %s (0x%02x)", - mgmt_errstr(status), status); - } - - return; -} - -int btd_adapter_le_set_data_length(struct btd_adapter *adapter, bdaddr_t *bdaddr, - uint16_t max_tx_octets, uint16_t max_tx_time) -{ - struct mgmt_cp_le_set_data_length cp; - - memset(&cp, 0, sizeof(cp)); - - bacpy(&cp.bdaddr, bdaddr); - - cp.max_tx_octets = max_tx_octets; - cp.max_tx_time = max_tx_time; - - if (mgmt_send(adapter->mgmt, MGMT_OP_LE_SET_DATA_LENGTH, - adapter->dev_id, sizeof(cp), &cp, - le_set_data_length_return_param_complete, - adapter, NULL) > 0) - return 0; - - return -EIO; -} - -#endif - -static DBusMessage *adapter_set_manufacturer_data(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - struct mgmt_cp_set_manufacturer_data cp; - uint8_t *value; - int32_t len = 0; - - DBG("Set manufacturer data"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &value, &len, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - if (len > EIR_MANUFACTURER_DATA_LENGTH_MAX) - return btd_error_invalid_args(msg); - - memcpy(&cp, value, len); - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_MANUFACTURER_DATA, - adapter->dev_id, EIR_MANUFACTURER_DATA_LENGTH_MAX, - &cp, NULL, NULL, NULL) > 0) - return dbus_message_new_method_return(msg); - - return btd_error_failed(msg, "Set manufacturer data failed"); -} - -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - - -static DBusMessage *start_discovery(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct btd_adapter *adapter = user_data; - const char *sender = dbus_message_get_sender(msg); - struct watch_client *client; - bool is_discovering; - - DBG("sender %s", sender); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - is_discovering = get_discovery_client(adapter, sender, &client); - - /* - * Every client can only start one discovery, if the client - * already started a discovery then return an error. - */ - if (is_discovering) - return btd_error_busy(msg); - - /* - * If there was pre-set filter, just reconnect it to discovery_list, - * and trigger scan. - */ - if (client) { - adapter->set_filter_list = g_slist_remove( - adapter->set_filter_list, client); - adapter->discovery_list = g_slist_prepend( - adapter->discovery_list, client); - update_discovery_filter(adapter); - return dbus_message_new_method_return(msg); - } - - client = g_new0(struct watch_client, 1); - - client->adapter = adapter; - client->owner = g_strdup(sender); - client->discovery_filter = NULL; - client->watch = g_dbus_add_disconnect_watch(dbus_conn, sender, - discovery_disconnect, client, - discovery_destroy); - adapter->discovery_list = g_slist_prepend(adapter->discovery_list, - client); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter->disc_type = BT_DISC_TYPE_BREDR_ONLY; -#endif - - /* - * Just trigger the discovery here. In case an already running - * discovery in idle phase exists, it will be restarted right - * away. - */ - update_discovery_filter(adapter); - - return dbus_message_new_method_return(msg); -} - -static bool parse_uuids(DBusMessageIter *value, GSList **uuids) -{ - DBusMessageIter arriter; - - if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_ARRAY) - return false; - - dbus_message_iter_recurse(value, &arriter); - while (dbus_message_iter_get_arg_type(&arriter) != DBUS_TYPE_INVALID) { - bt_uuid_t uuid, u128; - char uuidstr[MAX_LEN_UUID_STR + 1]; - char *uuid_param; + dbus_message_iter_recurse(value, &arriter); + while (dbus_message_iter_get_arg_type(&arriter) != DBUS_TYPE_INVALID) { + bt_uuid_t uuid, u128; + char uuidstr[MAX_LEN_UUID_STR + 1]; + char *uuid_param; if (dbus_message_iter_get_arg_type(&arriter) != DBUS_TYPE_STRING) @@ -5735,9 +2187,7 @@ static bool parse_transport(DBusMessageIter *value, uint8_t *transport) *transport = SCAN_TYPE_BREDR; else if (!strcmp(transport_str, "le")) *transport = SCAN_TYPE_LE; - else if (!strcmp(transport_str, "auto")) - *transport = SCAN_TYPE_DUAL; - else + else if (strcmp(transport_str, "auto")) return false; return true; @@ -5768,8 +2218,9 @@ static bool parse_discovery_filter_entry(char *key, DBusMessageIter *value, * successful, sets *filter to proper value. * Returns false on any error, and true on success. */ -static bool parse_discovery_filter_dict(struct discovery_filter **filter, - DBusMessage *msg) +static bool parse_discovery_filter_dict(struct btd_adapter *adapter, + struct discovery_filter **filter, + DBusMessage *msg) { DBusMessageIter iter, subiter, dictiter, variantiter; bool is_empty = true; @@ -5781,7 +2232,7 @@ static bool parse_discovery_filter_dict(struct discovery_filter **filter, (*filter)->uuids = NULL; (*filter)->pathloss = DISTANCE_VAL_INVALID; (*filter)->rssi = DISTANCE_VAL_INVALID; - (*filter)->type = SCAN_TYPE_DUAL; + (*filter)->type = get_scan_type(adapter); dbus_message_iter_init(msg, &iter); if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY || @@ -5856,7 +2307,7 @@ static DBusMessage *set_discovery_filter(DBusConnection *conn, return btd_error_not_supported(msg); /* parse parameters */ - if (!parse_discovery_filter_dict(&discovery_filter, msg)) + if (!parse_discovery_filter_dict(adapter, &discovery_filter, msg)) return btd_error_invalid_args(msg); is_discovering = get_discovery_client(adapter, sender, &client); @@ -5917,9 +2368,6 @@ static DBusMessage *stop_discovery(DBusConnection *conn, client = list->data; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter->disc_type = BT_DISC_TYPE_BREDR_ONLY; -#endif cp.type = adapter->discovery_type; /* @@ -5946,9 +2394,7 @@ static DBusMessage *stop_discovery(DBusConnection *conn, return dbus_message_new_method_return(msg); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - cp.type = 0x01; -#endif + mgmt_send(adapter->mgmt, MGMT_OP_STOP_DISCOVERY, adapter->dev_id, sizeof(cp), &cp, stop_discovery_complete, adapter, NULL); @@ -5970,38 +2416,6 @@ static gboolean property_get_address(const GDBusPropertyTable *property, return TRUE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean property_get_le_address(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *user_data) -{ - struct btd_adapter *adapter = user_data; - DBusMessageIter entry; - char addr[18]; - const char *str = addr; - char *type = NULL; - - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, - DBUS_TYPE_STRING_AS_STRING, &entry); - - if (adapter->le_static_addr.b[5] != 0) { - ba2str(&adapter->le_static_addr, addr); - type = g_strdup_printf("%d", BDADDR_LE_RANDOM); - } else { - ba2str(&adapter->bdaddr, addr); - type = g_strdup_printf("%d", BDADDR_LE_PUBLIC); - } - - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &type); - g_free((void *)type); - - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &str); - - dbus_message_iter_close_container(iter, &entry); - - return TRUE; -} -#endif - static gboolean property_get_name(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) { @@ -6178,7 +2592,6 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting, len = sizeof(mode); break; case MGMT_SETTING_DISCOVERABLE: -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (kernel_conn_control) { if (mode) { set_mode(adapter, MGMT_OP_SET_CONNECTABLE, @@ -6190,7 +2603,6 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting, break; } } -#endif memset(&cp, 0, sizeof(cp)); cp.val = mode; @@ -6206,13 +2618,6 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting, param = &mode; len = sizeof(mode); break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case MGMT_SETTING_CONNECTABLE: - opcode = MGMT_OP_SET_CONNECTABLE; - param = &mode; - len = sizeof(mode); - break; -#endif default: goto failed; } @@ -6227,16 +2632,8 @@ static void property_set_mode(struct btd_adapter *adapter, uint32_t setting, data->adapter = adapter; data->id = id; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* - * Use mgmt_send_nowait to avoid dbus timeout in a state of bonding. - */ - if (mgmt_send_nowait(adapter->mgmt, opcode, adapter->dev_id, len, param, - property_set_mode_complete, data, g_free) > 0) -#else if (mgmt_send(adapter->mgmt, opcode, adapter->dev_id, len, param, property_set_mode_complete, data, g_free) > 0) -#endif return; g_free(data); @@ -6415,124 +2812,8 @@ static void iter_append_uuid(gpointer key, gpointer value, gpointer user_data) DBusMessageIter *iter = user_data; const char *uuid = key; - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid); -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean property_get_le_discovering(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *user_data) -{ - struct btd_adapter *adapter = user_data; - dbus_bool_t discovering = adapter->le_discovering; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &discovering); - - return TRUE; -} - -static gboolean property_get_connectable(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - return property_get_mode(adapter, MGMT_SETTING_CONNECTABLE, iter); -} - -static void property_set_connectable(const GDBusPropertyTable *property, - DBusMessageIter *iter, - GDBusPendingPropertySet id, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - property_set_mode(adapter, MGMT_SETTING_CONNECTABLE, iter, id); -} - -static gboolean property_get_version(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *user_data) -{ - struct btd_adapter *adapter = user_data; - const char *str = adapter->version ? : ""; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str); - - return TRUE; -} - -static gboolean property_get_supported_le_features( - const GDBusPropertyTable *property, - DBusMessageIter *iter, void *user_data) -{ - const char *str, *val; - int value; - DBusMessageIter entry; - - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, - DBUS_TYPE_STRING_AS_STRING, &entry); - - value = adapter_le_get_max_adv_instance(); - if (value > 0) { - str = g_strdup("adv_inst_max"); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &str); - - val = g_strdup_printf("%d", value); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &val); - - g_free((void *)str); - g_free((void *)val); - } - - value = adapter_le_is_supported_offloading(); - if (value > 0) { - str = g_strdup("rpa_offloading"); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &str); - - val = g_strdup_printf("%d", value); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &val); - - g_free((void *)str); - g_free((void *)val); - } - - value = adapter_le_get_scan_filter_size(); -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - if (value <= 0) - value = SCAN_FILTER_SLOTS_MAX; -#endif - if (value > 0) { - str = g_strdup("max_filter"); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &str); - - val = g_strdup_printf("%d", value); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &val); - - g_free((void *)str); - g_free((void *)val); - } - - dbus_message_iter_close_container(iter, &entry); - - return TRUE; -} - -static gboolean property_get_ipsp_init_state( - const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_adapter *adapter = data; - dbus_bool_t ipsp_initialized; - - DBG("property_get_ipsp_init_state called"); - if (adapter->ipsp_intialized) - ipsp_initialized = TRUE; - else - ipsp_initialized = FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, - &ipsp_initialized); - - return TRUE; + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid); } -#endif static gboolean property_get_uuids(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) @@ -6602,249 +2883,6 @@ static int device_path_cmp(gconstpointer a, gconstpointer b) return strcasecmp(dev_path, path); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *adapter_unpair_device(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - DBG("+"); - struct btd_adapter *adapter = user_data; - struct btd_device *device; - const char *path; - GSList *list; - - if (dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID) == FALSE) - return btd_error_invalid_args(msg); - - list = g_slist_find_custom(adapter->devices, path, device_path_cmp); - if (!list) - return btd_error_does_not_exist(msg); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - device = list->data; - - btd_device_set_temporary(device, TRUE); - - if (!btd_device_is_connected(device)) { - btd_adapter_unpair_device(adapter, device); - return dbus_message_new_method_return(msg); - } - - device_request_disconnect(device, msg); - - DBG("-"); - return NULL; -} - -static DBusMessage *create_device(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - const gchar *address; - bdaddr_t addr; - DBG("+"); - - if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &address, - DBUS_TYPE_INVALID) == FALSE) - return btd_error_invalid_args(msg); - - if (bachk(address) < 0) - return btd_error_invalid_args(msg); - - DBG("%s", address); - - str2ba(address, &addr); - btd_adapter_get_device(adapter, &addr, BDADDR_BREDR); - - DBG("-"); - return dbus_message_new_method_return(msg); -} - -static DBusMessage *find_device(DBusConnection *conn, DBusMessage *msg, - void *data) -{ - struct btd_adapter *adapter = data; - struct btd_device *device; - DBusMessage *reply; - const gchar *address; - GSList *l; - const gchar *dev_path; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &address, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - l = g_slist_find_custom(adapter->devices, address, device_rpa_cmp); - if (!l) - l = g_slist_find_custom(adapter->devices, address, - device_address_cmp); - if (!l) - return btd_error_does_not_exist(msg); - - device = l->data; - - reply = dbus_message_new_method_return(msg); - if (!reply) - return NULL; - - dev_path = device_get_path(device); - - dbus_message_append_args(reply, - DBUS_TYPE_OBJECT_PATH, &dev_path, - DBUS_TYPE_INVALID); - - return reply; -} - -static gboolean adapter_ipsp_connected(struct btd_adapter *adapter) -{ - GSList *l, *next; - - DBG("%s", adapter->path); - - for (l = adapter->connections; l != NULL; l = next) { - struct btd_device *dev = l->data; - - next = g_slist_next(l); - - if (device_is_ipsp_connected(dev)) - return TRUE; - } - - return FALSE; -} - -static void adapter_set_ipsp_init_state(struct btd_adapter *adapter, gboolean initialized) -{ - if (adapter->ipsp_intialized == initialized) - return; - - adapter->ipsp_intialized = initialized; - - DBG("Set Ipsp init state for adapter %s", adapter->path); - - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "IpspInitStateChanged"); -} - -static void deinitialize_6lowpan_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - bool initialized = FALSE; - - if (status != MGMT_STATUS_SUCCESS) - error("De-Initialize BT 6lowpan failed for hci%u: %s (0x%02x)", - adapter->dev_id, mgmt_errstr(status), status); - else { - adapter_set_ipsp_init_state(adapter, initialized); - DBG("De-Initialize BT 6lowpan successfully for hci%u", - adapter->dev_id); - } -} - -static bool deinitialize_6lowpan(struct btd_adapter *adapter) -{ - struct mgmt_cp_enable_6lowpan cp; - - memset(&cp, 0, sizeof(cp)); - - cp.enable_6lowpan = DEINIT_6LOWPAN; - if (mgmt_send(adapter->mgmt, MGMT_OP_ENABLE_6LOWPAN, - adapter->dev_id, sizeof(cp), &cp, - deinitialize_6lowpan_complete, adapter, NULL) > 0) - return true; - - error("Failed to de-initialize BT 6Lowpan for index %u", - adapter->dev_id); - return false; -} - -static void initialize_6lowpan_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - bool initialized = TRUE; - - if (status != MGMT_STATUS_SUCCESS) - error("Initialize BT 6lowpan failed for hci%u: %s (0x%02x)", - adapter->dev_id, mgmt_errstr(status), status); - else { - adapter_set_ipsp_init_state(adapter, initialized); - DBG("Initialize BT 6lowpan successfully for hci%u", - adapter->dev_id); - } -} - -static bool initialize_6lowpan(struct btd_adapter *adapter) -{ - struct mgmt_cp_enable_6lowpan cp; - - memset(&cp, 0, sizeof(cp)); - - cp.enable_6lowpan = INIT_6LOWPAN; - if (mgmt_send(adapter->mgmt, MGMT_OP_ENABLE_6LOWPAN, - adapter->dev_id, sizeof(cp), &cp, - initialize_6lowpan_complete, adapter, NULL) > 0) - return true; - - error("Failed to initialize BT 6Lowpan for index %u", - adapter->dev_id); - return false; -} - -static DBusMessage *adapter_initialize_ipsp(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - dbus_bool_t err; - - DBG("Initialize IPSP"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (adapter->ipsp_intialized) - return btd_error_already_exists(msg); - - /* Enable BT 6lowpan in kernel */ - err = initialize_6lowpan(adapter); - - if (!err) - return btd_error_failed(msg, "Failed to initialize BT 6lowpan"); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *adapter_deinitialize_ipsp(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_adapter *adapter = data; - dbus_bool_t err; - - DBG("De-initialize IPSP"); - - if (!(adapter->current_settings & MGMT_SETTING_POWERED)) - return btd_error_not_ready(msg); - - if (!adapter->ipsp_intialized) - return btd_error_not_permitted(msg, "IPSP not initialized"); - - if (adapter_ipsp_connected(adapter)) - return btd_error_not_permitted(msg, "IPSP Client device found connected"); - - /* Disable BT 6lowpan in kernel */ - err = deinitialize_6lowpan(adapter); - - if (!err) - return btd_error_failed(msg, "Failed to deinitialize BT 6lowpan"); - - return dbus_message_new_method_return(msg); -} -#endif - static DBusMessage *remove_device(DBusConnection *conn, DBusMessage *msg, void *user_data) { @@ -6884,157 +2922,10 @@ static const GDBusMethodTable adapter_methods[] = { GDBUS_ARGS({ "properties", "a{sv}" }), NULL, set_discovery_filter) }, { GDBUS_METHOD("StopDiscovery", NULL, NULL, stop_discovery) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_METHOD("StartCustomDiscovery", - GDBUS_ARGS({ "type", "s" }), NULL, - adapter_start_custom_discovery) }, - { GDBUS_METHOD("StartLEDiscovery", NULL, NULL, - adapter_start_le_discovery) }, - { GDBUS_ASYNC_METHOD("StopLEDiscovery", NULL, NULL, - adapter_stop_le_discovery) }, - { GDBUS_METHOD("SetAdvertising", - GDBUS_ARGS({ "enable", "b" }, - { "slot_id", "i" }), NULL, - adapter_set_advertising) }, - { GDBUS_METHOD("SetAdvertisingParameters", - GDBUS_ARGS({ "interval_min", "u" }, - { "interval_max", "u" }, - { "filter_policy", "u" }, - { "type", "u" }, - { "slot_id", "i" }), NULL, - adapter_set_advertising_params) }, - { GDBUS_METHOD("SetAdvertisingData", - GDBUS_ARGS({ "value", "ay" }, - { "slot_id", "i" }), NULL, - adapter_set_advertising_data) }, - { GDBUS_METHOD("SetScanParameters", - GDBUS_ARGS({ "type", "u" }, - { "interval", "u" }, - { "window", "u" }), NULL, - adapter_le_set_scan_params) }, - { GDBUS_ASYNC_METHOD("scan_filter_param_setup", - GDBUS_ARGS({ "client_if", "i" }, { "action", "i" }, - { "filt_index", "i" }, { "feat_seln", "i"}, - { "list_logic_type", "i" }, { "filt_logic_type", "i"}, - { "rssi_high_thres", "i" }, { "rssi_low_thres", "i"}, - { "dely_mode", "i" }, { "found_timeout", "i"}, - { "lost_timeout", "i" }, { "found_timeout_cnt", "i"}), NULL, - adapter_le_scan_filter_param_setup) }, - { GDBUS_ASYNC_METHOD("scan_filter_add_remove", - GDBUS_ARGS({ "client_if", "i" }, { "action", "i" }, - { "filt_type", "i" }, { "filt_index", "i"}, - { "company_id", "i" }, { "company_id_mask", "i"}, - { "p_uuid", "ay" }, { "p_uuid_mask", "ay" }, - { "string", "s" }, { "address_type", "u" }, - /*{ "data_len", "i" },*/ { "p_data", "ay" }, - /*{ "mask_len", "i" },*/ { "p_mask", "ay" }), NULL, - adapter_le_scan_filter_add_remove) }, - { GDBUS_ASYNC_METHOD("scan_filter_clear", - GDBUS_ARGS({ "client_if", "i" }, { "filt_index", "i" }), NULL, - adapter_le_scan_filter_clear) }, - { GDBUS_ASYNC_METHOD("scan_filter_enable", - GDBUS_ARGS({ "client_if", "i" }, { "enable", "b" }), NULL, - adapter_le_scan_filter_enable) }, - { GDBUS_METHOD("InitializeIpsp", - NULL, NULL, - adapter_initialize_ipsp) }, - { GDBUS_METHOD("DeinitializeIpsp", - NULL, NULL, - adapter_deinitialize_ipsp) }, - { GDBUS_METHOD("SetScanRespData", - GDBUS_ARGS({ "value", "ay" }, - { "slot_id", "i" }), NULL, - adapter_set_scan_rsp_data) }, - { GDBUS_METHOD("AddDeviceWhiteList", - GDBUS_ARGS({ "address", "s" }, - { "address_type", "u" }), NULL, - adapter_add_device_white_list) }, - { GDBUS_METHOD("RemoveDeviceWhiteList", - GDBUS_ARGS({ "address", "s" }, - { "address_type", "u" }), NULL, - adapter_remove_device_white_list) }, - { GDBUS_METHOD("ClearDeviceWhiteList", - NULL, NULL, - adapter_clear_device_white_list) }, - { GDBUS_METHOD("SetLePrivacy", - GDBUS_ARGS({ "enable", "b" }), NULL, - adapter_set_le_privacy) }, - { GDBUS_METHOD("SetLeStaticRandomAddress", - GDBUS_ARGS({ "enable", "b" }), NULL, - adapter_set_le_static_address) }, - { GDBUS_ASYNC_METHOD("EnableRssi", - GDBUS_ARGS({ "bt_address", "s" }, - { "link_type", "i" }, - { "low_th", "i" }, - { "in_range_th", "i" }, - { "high_th", "i"}), - NULL, - adapter_enable_rssi) }, - { GDBUS_ASYNC_METHOD("GetRssiStrength", - GDBUS_ARGS({ "bt_address", "s" }, { "link_type", "i" }), - NULL, - adapter_get_rssi) }, - { GDBUS_ASYNC_METHOD("UnpairDevice", - GDBUS_ARGS({ "device", "o" }), NULL, adapter_unpair_device) }, - { GDBUS_METHOD("FindDevice", - GDBUS_ARGS({ "address", "s" }), - GDBUS_ARGS({ "device", "o" }), - find_device) }, - { GDBUS_METHOD("SetWbsParameters", - GDBUS_ARGS({ "role", "s" }, { "bt_address", "s" }), - NULL, - set_wbs_parameters) }, - { GDBUS_METHOD("SetNbParameters", - GDBUS_ARGS({ "role", "s" }, { "bt_address", "s" }), - NULL, - set_nb_parameters) }, - { GDBUS_METHOD("SetManufacturerData", - GDBUS_ARGS({ "value", "ay" }), NULL, - adapter_set_manufacturer_data) }, - { GDBUS_ASYNC_METHOD("CreateDevice", - GDBUS_ARGS({ "address", "s" }), NULL, - create_device) }, -#endif { GDBUS_ASYNC_METHOD("RemoveDevice", GDBUS_ARGS({ "device", "o" }), NULL, remove_device) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_ASYNC_METHOD("LEReadMaximumDataLength", NULL, - GDBUS_ARGS({"maxTxOctets", "q" }, { "maxTxTime", "q" }, - {"maxRxOctets", "q" }, { "maxRxTime", "q" }), - le_read_maximum_data_length)}, - { GDBUS_ASYNC_METHOD("LEWriteHostSuggestedDataLength", - GDBUS_ARGS({"def_tx_octets", "q" }, { "def_tx_time", "q" }), NULL, - le_write_host_suggested_default_data_length)}, - { GDBUS_ASYNC_METHOD("LEReadHostSuggestedDataLength", NULL, - GDBUS_ARGS({"def_tx_octets", "q" }, { "def_tx_time", "q" }), - le_read_host_suggested_default_data_length)}, -#endif - { } -}; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static const GDBusSignalTable adapter_signals[] = { - { GDBUS_SIGNAL("AdvertisingEnabled", - GDBUS_ARGS({ "slot_id", "i" }, - { "enabled", "b"})) }, - { GDBUS_SIGNAL("RssiEnabled", - GDBUS_ARGS({"address","s"}, - { "link_type", "i" }, - { "enabled", "b"})) }, - { GDBUS_SIGNAL("RssiAlert", - GDBUS_ARGS({"address","s"}, - { "link_type", "i" }, - { "alert_type", "i" }, - { "rssi_dbm", "i"})) }, - { GDBUS_SIGNAL("RawRssi", - GDBUS_ARGS({"address","s"}, - { "link_type", "i" }, - { "rssi_dbm", "i"})) }, - { GDBUS_SIGNAL("HardwareError", NULL) }, - { GDBUS_SIGNAL("TxTimeoutError", NULL) }, { } }; -#endif static const GDBusPropertyTable adapter_properties[] = { { "Address", "s", property_get_address }, @@ -7050,21 +2941,9 @@ static const GDBusPropertyTable adapter_properties[] = { { "PairableTimeout", "u", property_get_pairable_timeout, property_set_pairable_timeout }, { "Discovering", "b", property_get_discovering }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "LEDiscovering", "b", property_get_le_discovering }, -#endif { "UUIDs", "as", property_get_uuids }, { "Modalias", "s", property_get_modalias, NULL, property_exists_modalias }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "Connectable", "b", property_get_connectable, - property_set_connectable }, - { "Version", "s", property_get_version }, - { "SupportedLEFeatures", "as", property_get_supported_le_features}, - { "IpspInitStateChanged", "b", property_get_ipsp_init_state}, - { "LEAddress", "as", property_get_le_address }, -#endif - { } }; @@ -7195,78 +3074,190 @@ static GSList *get_ltk_info(GKeyFile *key_file, const char *peer, DBG("%s", peer); - ltk = get_ltk(key_file, peer, bdaddr_type, "LongTermKey"); - if (ltk) - l = g_slist_append(l, ltk); + ltk = get_ltk(key_file, peer, bdaddr_type, "LongTermKey"); + if (ltk) + l = g_slist_append(l, ltk); + + ltk = get_ltk(key_file, peer, bdaddr_type, "SlaveLongTermKey"); + if (ltk) { + ltk->master = false; + l = g_slist_append(l, ltk); + } + + return l; +} + +static struct irk_info *get_irk_info(GKeyFile *key_file, const char *peer, + uint8_t bdaddr_type) +{ + struct irk_info *irk = NULL; + char *str; + + str = g_key_file_get_string(key_file, "IdentityResolvingKey", "Key", NULL); + if (!str || strlen(str) < 32) + goto failed; + + irk = g_new0(struct irk_info, 1); + + str2ba(peer, &irk->bdaddr); + irk->bdaddr_type = bdaddr_type; + + if (!strncmp(str, "0x", 2)) + str2buf(&str[2], irk->val, sizeof(irk->val)); + else + str2buf(&str[0], irk->val, sizeof(irk->val)); + +failed: + g_free(str); + + return irk; +} + +static struct conn_param *get_conn_param(GKeyFile *key_file, const char *peer, + uint8_t bdaddr_type) +{ + struct conn_param *param; + + if (!g_key_file_has_group(key_file, "ConnectionParameters")) + return NULL; + + param = g_new0(struct conn_param, 1); + + param->min_interval = g_key_file_get_integer(key_file, + "ConnectionParameters", + "MinInterval", NULL); + param->max_interval = g_key_file_get_integer(key_file, + "ConnectionParameters", + "MaxInterval", NULL); + param->latency = g_key_file_get_integer(key_file, + "ConnectionParameters", + "Latency", NULL); + param->timeout = g_key_file_get_integer(key_file, + "ConnectionParameters", + "Timeout", NULL); + str2ba(peer, ¶m->bdaddr); + param->bdaddr_type = bdaddr_type; + + return param; +} + +static int generate_and_write_irk(uint8_t *irk, GKeyFile *key_file, + const char *filename) +{ + struct bt_crypto *crypto; + char str_irk_out[33]; + gsize length = 0; + char *str; + int i; + + crypto = bt_crypto_new(); + if (!crypto) { + error("Failed to open crypto"); + return -1; + } + + if (!bt_crypto_random_bytes(crypto, irk, 16)) { + error("Failed to generate IRK"); + bt_crypto_unref(crypto); + return -1; + } + + bt_crypto_unref(crypto); + + for (i = 0; i < 16; i++) + sprintf(str_irk_out + (i * 2), "%02x", irk[i]); + + str_irk_out[32] = '\0'; + info("Generated IRK successfully"); + + g_key_file_set_string(key_file, "General", "IdentityResolvingKey", + str_irk_out); + str = g_key_file_to_data(key_file, &length, NULL); + g_file_set_contents(filename, str, length, NULL); + g_free(str); + DBG("Generated IRK written to file"); + return 0; +} + +static int load_irk(struct btd_adapter *adapter, uint8_t *irk) +{ + char filename[PATH_MAX]; + GKeyFile *key_file; + char address[18]; + char *str_irk; + int ret; + + ba2str(&adapter->bdaddr, address); + snprintf(filename, PATH_MAX, STORAGEDIR "/%s/identity", address); + + key_file = g_key_file_new(); + g_key_file_load_from_file(key_file, filename, 0, NULL); + + str_irk = g_key_file_get_string(key_file, "General", + "IdentityResolvingKey", NULL); + if (!str_irk) { + info("No IRK for %s, creating new IRK", address); + ret = generate_and_write_irk(irk, key_file, filename); + g_key_file_free(key_file); + return ret; + } + + g_key_file_free(key_file); - ltk = get_ltk(key_file, peer, bdaddr_type, "SlaveLongTermKey"); - if (ltk) { - ltk->master = false; - l = g_slist_append(l, ltk); + if (strlen(str_irk) != 32 || str2buf(str_irk, irk, 16)) { + /* TODO re-create new IRK here? */ + error("Invalid IRK format, disabling privacy"); + g_free(str_irk); + return -1; } - return l; + g_free(str_irk); + DBG("Successfully read IRK from file"); + return 0; } -static struct irk_info *get_irk_info(GKeyFile *key_file, const char *peer, - uint8_t bdaddr_type) +static void set_privacy_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) { - struct irk_info *irk; - char *str; + struct btd_adapter *adapter = user_data; - str = g_key_file_get_string(key_file, "IdentityResolvingKey", "Key", NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!str) - return NULL; - if (strlen(str) < 32) { - g_free(str); - return NULL; + if (status != MGMT_STATUS_SUCCESS) { + btd_error(adapter->dev_id, "Failed to set privacy: %s (0x%02x)", + mgmt_errstr(status), status); + return; } -#else - if (!str || strlen(str) < 32) - return NULL; -#endif - irk = g_new0(struct irk_info, 1); - str2ba(peer, &irk->bdaddr); - irk->bdaddr_type = bdaddr_type; + DBG("Successfuly set privacy for index %u", adapter->dev_id); +} - if (!strncmp(str, "0x", 2)) - str2buf(&str[2], irk->val, sizeof(irk->val)); - else - str2buf(&str[0], irk->val, sizeof(irk->val)); +static int set_privacy(struct btd_adapter *adapter, uint8_t privacy) +{ + struct mgmt_cp_set_privacy cp; - g_free(str); + memset(&cp, 0, sizeof(cp)); - return irk; -} + if (privacy) { + uint8_t irk[16]; -static struct conn_param *get_conn_param(GKeyFile *key_file, const char *peer, - uint8_t bdaddr_type) -{ - struct conn_param *param; + if (load_irk(adapter, irk) == 0) { + cp.privacy = privacy; + memcpy(cp.irk, irk, 16); + } + } - if (!g_key_file_has_group(key_file, "ConnectionParameters")) - return NULL; + DBG("sending set privacy command for index %u", adapter->dev_id); + DBG("setting privacy mode 0x%02x for index %u", cp.privacy, + adapter->dev_id); - param = g_new0(struct conn_param, 1); + if (mgmt_send(adapter->mgmt, MGMT_OP_SET_PRIVACY, + adapter->dev_id, sizeof(cp), &cp, + set_privacy_complete, adapter, NULL) > 0) + return 0; - param->min_interval = g_key_file_get_integer(key_file, - "ConnectionParameters", - "MinInterval", NULL); - param->max_interval = g_key_file_get_integer(key_file, - "ConnectionParameters", - "MaxInterval", NULL); - param->latency = g_key_file_get_integer(key_file, - "ConnectionParameters", - "Latency", NULL); - param->timeout = g_key_file_get_integer(key_file, - "ConnectionParameters", - "Timeout", NULL); - str2ba(peer, ¶m->bdaddr); - param->bdaddr_type = bdaddr_type; + btd_error(adapter->dev_id, "Failed to set privacy for index %u", + adapter->dev_id); - return param; + return -1; } static void load_link_keys_complete(uint8_t status, uint16_t length, @@ -7620,47 +3611,6 @@ static uint8_t get_le_addr_type(GKeyFile *keyfile) return addr_type; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static uint8_t get_addr_type(GKeyFile *keyfile) -{ - char **techno, **t; - char *str; - uint8_t bdaddr_type = BDADDR_BREDR; - bool le = false; - - /* Load device technology */ - techno = g_key_file_get_string_list(keyfile, "General", - "SupportedTechnologies", NULL, NULL); - if (!techno) - return 0xff; - - for (t = techno; *t; t++) { - if (g_str_equal(*t, "LE")) - le = true; - } - - if (!le) { - bdaddr_type = BDADDR_BREDR; - } else { - str = g_key_file_get_string(keyfile, "General", - "AddressType", NULL); - - if (str && g_str_equal(str, "public")) - bdaddr_type = BDADDR_LE_PUBLIC; - else if (str && g_str_equal(str, "static")) - bdaddr_type = BDADDR_LE_RANDOM; - else - error("Unknown LE device technology"); - - g_free(str); - } - - g_strfreev(techno); - - return bdaddr_type; -} -#endif - static void probe_devices(void *user_data) { struct btd_device *device = user_data; @@ -7696,14 +3646,8 @@ static void load_devices(struct btd_adapter *adapter) struct btd_device *device; char filename[PATH_MAX]; GKeyFile *key_file; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct link_key_info *key_info = NULL; - GSList *list, *ltk_info = NULL; - struct device_addr_type addr; -#else struct link_key_info *key_info; GSList *list, *ltk_info; -#endif struct irk_info *irk_info; struct conn_param *param; uint8_t bdaddr_type; @@ -7714,18 +3658,6 @@ static void load_devices(struct btd_adapter *adapter) if (entry->d_type != DT_DIR || bachk(entry->d_name) < 0) continue; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -{ - bdaddr_t bdaddr; - - str2ba(entry->d_name, &bdaddr); - - if (!bacmp(&bdaddr, BDADDR_ANY)) { - error("No Bluetooth address"); - continue; - } -} -#endif snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", srcaddr, entry->d_name); @@ -7749,25 +3681,9 @@ static void load_devices(struct btd_adapter *adapter) if (param) params = g_slist_append(params, param); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - str2ba(entry->d_name, &addr.bdaddr); - addr.bdaddr_type = get_addr_type(key_file); - if (addr.bdaddr_type == 0xff) { - error("No SupportedTechnologies. Skipping"); - goto free; - } - - list = g_slist_find_custom(adapter->devices, &addr, - device_addr_type_strict_cmp); -#else list = g_slist_find_custom(adapter->devices, entry->d_name, device_address_cmp); -#endif if (list) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("Skip already loaded device [%s] [%d]", - entry->d_name, addr.bdaddr_type); -#endif device = list->data; goto device_exist; } @@ -7777,42 +3693,6 @@ static void load_devices(struct btd_adapter *adapter) if (!device) goto free; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -{ - char idaddr[18]; - - /* - * After loading IRK information from file, - * store it into device->bdaddr. - * RPA is stored in device->rpa_addr - */ - ba2str(device_get_address(device), idaddr); - - DBG("irk address: %s, rpa_exist %d", - idaddr, device_get_rpa_exist(device)); - - if (device_get_rpa_exist(device) == true) { - if (key_info) - str2ba(idaddr, &key_info->bdaddr); - - if (ltk_info) { - ltks = g_slist_remove(ltks, ltk_info); - ltk_info = get_ltk_info(key_file, - idaddr, bdaddr_type); - ltks = g_slist_concat(ltks, ltk_info); - } - - if (irk_info) { - str2ba(idaddr, &irk_info->bdaddr); - device_set_irk_value(device, irk_info->val); - } - - if (param) - str2ba(idaddr, ¶m->bdaddr); - } -} -#endif - btd_device_set_temporary(device, false); adapter->devices = g_slist_append(adapter->devices, device); @@ -8396,30 +4276,8 @@ void adapter_auto_connect_remove(struct btd_adapter *adapter, static void adapter_start(struct btd_adapter *adapter) { -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && !defined(__SPRD_PATCH__) - if (adapter_le_read_ble_feature_info()) - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "SupportedLEFeatures"); -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - else - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "SupportedLEFeatures"); -#endif - - adapter_get_adv_tx_power(adapter); - - /* By default enable offloading for testing, this should be modified */ - if (adapter_le_is_supported_offloading()) - adapter_le_enable_offloading(TRUE); -#endif - -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY g_dbus_emit_property_changed(dbus_conn, adapter->path, ADAPTER_INTERFACE, "Powered"); -#else - g_dbus_emit_property_changed_full(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "Powered", 1); -#endif DBG("adapter %s has been enabled", adapter->path); @@ -9376,9 +5234,7 @@ static void load_config(struct btd_adapter *adapter) char address[18]; struct stat st; GError *gerr = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *str; -#endif + ba2str(&adapter->bdaddr, address); key_file = g_key_file_new(); @@ -9428,35 +5284,12 @@ static void load_config(struct btd_adapter *adapter) gerr = NULL; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Get A2DP Role */ - str = g_key_file_get_string(key_file, "General", "DefaultA2DPRole", &gerr); - if (gerr || !str) { - adapter->a2dp_role = BLUETOOTH_A2DP_SOURCE_ROLE; - g_error_free(gerr); - gerr = NULL; - } else { - if (g_strcmp0(str, "sink") == 0) - adapter->a2dp_role = BLUETOOTH_A2DP_SINK_ROLE; - else if (g_strcmp0(str, "source") == 0) - adapter->a2dp_role = BLUETOOTH_A2DP_SOURCE_ROLE; - } -#endif - g_key_file_free(key_file); } static struct btd_adapter *btd_adapter_new(uint16_t index) { struct btd_adapter *adapter; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH - DBusConnection *conn = btd_get_dbus_connection(); - DBusMessage *msg = NULL; - DBusMessage *reply = NULL; - int charging_state = 0; -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif adapter = g_try_new0(struct btd_adapter, 1); if (!adapter) @@ -9483,11 +5316,6 @@ static struct btd_adapter *btd_adapter_new(uint16_t index) main_opts.did_version); adapter->discoverable_timeout = main_opts.discovto; adapter->pairable_timeout = main_opts.pairto; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter->advertising = FALSE; - adapter->auto_pairing = main_opts.auto_pairing; - adapter->pin_code = main_opts.pin_code; -#endif DBG("System name: %s", adapter->system_name); DBG("Major class: %u", adapter->major_class); @@ -9495,39 +5323,8 @@ static struct btd_adapter *btd_adapter_new(uint16_t index) DBG("Modalias: %s", adapter->modalias); DBG("Discoverable timeout: %u seconds", adapter->discoverable_timeout); DBG("Pairable timeout: %u seconds", adapter->pairable_timeout); - adapter->auths = g_queue_new(); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH - adapter->charging_watch = g_dbus_add_signal_watch(conn, DEVICED_DEST, - DEVICED_BATT_OBJECT_PATH, - DEVICED_BATT_INTERFACE, "ChargerType", - charging_state_changed, adapter, NULL); - if (adapter->charging_watch == 0) - error("Cannot add signal watch for ChargerType"); - - msg = dbus_message_new_method_call(DEVICED_DEST, - DEVICED_BATT_OBJECT_PATH, - DEVICED_BATT_INTERFACE, "ChargerType"); - if (msg) { - reply = dbus_connection_send_with_reply_and_block(conn, - msg, 1000, NULL); - if (reply) { - if (dbus_message_get_args(reply, NULL, - DBUS_TYPE_INT32, &charging_state, - DBUS_TYPE_INVALID) == TRUE) { - set_charging_state(adapter, charging_state); - } - dbus_message_unref(reply); - } else { - error("Reply is NULL"); - } - dbus_message_unref(msg); - } else { - error("Unable to create dbus message for charging state"); - } -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif + adapter->auths = g_queue_new(); return btd_adapter_ref(adapter); } @@ -9535,27 +5332,10 @@ static struct btd_adapter *btd_adapter_new(uint16_t index) static void adapter_remove(struct btd_adapter *adapter) { GSList *l; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY struct gatt_db *db; -#endif DBG("Removing adapter %s", adapter->path); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH - if (adapter->charging_watch > 0) { - g_dbus_remove_watch(btd_get_dbus_connection(), - adapter->charging_watch); - adapter->charging_watch = 0; - } - - if (adapter->charging_timeout) { - g_source_remove(adapter->charging_timeout); - adapter->charging_timeout = 0; - } -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif - if (adapter->discovery_idle_timeout > 0) { g_source_remove(adapter->discovery_idle_timeout); adapter->discovery_idle_timeout = 0; @@ -9579,16 +5359,12 @@ static void adapter_remove(struct btd_adapter *adapter) unload_drivers(adapter); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY db = btd_gatt_database_get_db(adapter->database); gatt_db_unregister(db, adapter->db_id); adapter->db_id = 0; btd_gatt_database_destroy(adapter->database); adapter->database = NULL; -#else - btd_adapter_gatt_server_stop(adapter); -#endif btd_advertising_manager_destroy(adapter->adv_manager); adapter->adv_manager = NULL; @@ -9613,24 +5389,6 @@ const bdaddr_t *btd_adapter_get_address(struct btd_adapter *adapter) return &adapter->bdaddr; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -const bdaddr_t *btd_adapter_get_le_address(struct btd_adapter *adapter) -{ - if (adapter->le_static_addr.b[5] != 0) - return &adapter->le_static_addr; - else - return &adapter->bdaddr; -} - -uint8_t btd_adapter_get_le_address_type(struct btd_adapter * adapter) -{ - if (adapter->le_static_addr.b[5] != 0) - return BDADDR_LE_RANDOM; - else - return BDADDR_LE_PUBLIC; -} -#endif - static gboolean confirm_name_timeout(gpointer user_data) { struct btd_adapter *adapter = user_data; @@ -9796,53 +5554,28 @@ static bool is_filter_match(GSList *discovery_filter, struct eir_data *eir_data, return got_match; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void update_found_devices(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, - uint8_t bdaddr_type, int8_t rssi, - bool confirm, bool legacy, uint8_t adv_type, - const uint8_t *data, uint8_t data_len) -#else static void update_found_devices(struct btd_adapter *adapter, const bdaddr_t *bdaddr, uint8_t bdaddr_type, int8_t rssi, bool confirm, bool legacy, bool not_connectable, const uint8_t *data, uint8_t data_len) -#endif { struct btd_device *dev; struct eir_data eir_data; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY bool name_known, discoverable; -#else - bool name_known; -#endif -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - uint8_t allow_report; -#endif char addr[18]; memset(&eir_data, 0, sizeof(eir_data)); eir_parse(&eir_data, data, data_len); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - if (bdaddr_type == BDADDR_BREDR) + + if (bdaddr_type == BDADDR_BREDR || adapter->filtered_discovery) discoverable = true; else discoverable = eir_data.flags & (EIR_LIM_DISC | EIR_GEN_DISC); -#endif + ba2str(bdaddr, addr); -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - /* Check if the any filter policy */ - allow_report = validate_for_filter_policy(adapter, &eir_data, addr); - if (allow_report == NONE_REPORT && - ((adapter->scan_type == LE_ACTIVE_SCAN && adv_type == ADV_TYPE_SCAN_RESPONSE) || - adapter->scan_type == LE_PASSIVE_SCAN)) { - eir_data_free(&eir_data); - return; - } -#endif dev = btd_adapter_find_device(adapter, bdaddr, bdaddr_type); if (!dev) { /* @@ -9850,21 +5583,10 @@ static void update_found_devices(struct btd_adapter *adapter, * not marked as discoverable, then do not create new * device objects. */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /*DBG("List BREDR:%p LE:%p Discoverable:%d", adapter->discovery_list, - adapter->le_discovery_list, discoverable);*/ - if ((adapter->discovery_list == NULL && - adapter->le_discovery_list == NULL)) { - DBG("discovery list is NULL"); - eir_data_free(&eir_data); - return; - } -#else if (!adapter->discovery_list || !discoverable) { eir_data_free(&eir_data); return; } -#endif dev = adapter_create_device(adapter, bdaddr, bdaddr_type); } @@ -9876,11 +5598,6 @@ static void update_found_devices(struct btd_adapter *adapter, return; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if(device_get_rpa_exist(dev) == true) - bdaddr_type = BDADDR_LE_RANDOM; -#endif - device_update_last_seen(dev, bdaddr_type); /* @@ -9890,8 +5607,11 @@ static void update_found_devices(struct btd_adapter *adapter, * supports this we can make the non-zero check conditional. */ if (bdaddr_type != BDADDR_BREDR && eir_data.flags && - !(eir_data.flags & EIR_BREDR_UNSUP)) + !(eir_data.flags & EIR_BREDR_UNSUP)) { device_set_bredr_support(dev); + /* Update last seen for BR/EDR in case its flag is set */ + device_update_last_seen(dev, BDADDR_BREDR); + } if (eir_data.name != NULL && eir_data.name_complete) device_store_cached_name(dev, eir_data.name); @@ -9900,26 +5620,11 @@ static void update_found_devices(struct btd_adapter *adapter, * If no client has requested discovery, then only update * already paired devices (skip temporary ones). */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device_is_temporary(dev) && adapter->discovery_list == NULL && - adapter->le_discovery_list == NULL) { - DBG("discovery list is NULL"); - eir_data_free(&eir_data); - return; - } - - device_set_last_addr_type(dev, bdaddr_type); - device_set_ipsp_connected(dev, FALSE, NULL); -#else if (device_is_temporary(dev) && !adapter->discovery_list) { eir_data_free(&eir_data); return; } -#endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (bdaddr_type == BDADDR_BREDR) { -#endif if (adapter->filtered_discovery && !is_filter_match(adapter->discovery_list, &eir_data, rssi)) { eir_data_free(&eir_data); @@ -9935,23 +5640,13 @@ static void update_found_devices(struct btd_adapter *adapter, if (eir_data.tx_power != 127) device_set_tx_power(dev, eir_data.tx_power); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } -#endif if (eir_data.appearance != 0) device_set_appearance(dev, eir_data.appearance); /* Report an unknown name to the kernel even if there is a short name * known, but still update the name with the known short name. */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (eir_data.name_complete) - name_known = device_name_known(dev); - else - name_known = false; -#else name_known = device_name_known(dev); -#endif if (eir_data.name && (eir_data.name_complete || !name_known)) btd_device_device_set_name(dev, eir_data.name); @@ -9968,19 +5663,6 @@ static void update_found_devices(struct btd_adapter *adapter, device_add_eir_uuids(dev, eir_data.services); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (eir_data.flags != 0) - device_set_remote_feature_flag(dev, eir_data.flags); - - if (bdaddr_type == BDADDR_BREDR) - device_set_manufacturer_info(dev, &eir_data); - else { - /* if the application has registered for iBeacon report, - * then send ibeacon report along with advertisement report */ - device_set_adv_report_info(dev, (void*)data, data_len, adv_type, rssi); - } -#endif - if (eir_data.msd_list) { device_set_manufacturer_data(dev, eir_data.msd_list); adapter_msd_notify(adapter, dev, eir_data.msd_list); @@ -9989,6 +5671,9 @@ static void update_found_devices(struct btd_adapter *adapter, if (eir_data.sd_list) device_set_service_data(dev, eir_data.sd_list); + if (bdaddr_type != BDADDR_BREDR) + device_set_flags(dev, eir_data.flags); + eir_data_free(&eir_data); /* @@ -9997,11 +5682,7 @@ static void update_found_devices(struct btd_adapter *adapter, * Otherwise, this is an event from passive discovery and we * should check if the device needs connecting to. */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!adapter->discovery_list && !adapter->le_discovery_list) -#else if (!adapter->discovery_list) -#endif goto connect_le; if (g_slist_find(adapter->discovery_found, dev)) @@ -10016,11 +5697,9 @@ static void update_found_devices(struct btd_adapter *adapter, return; connect_le: -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY /* Ignore non-connectable events */ if (not_connectable) return; -#endif /* * If we're in the process of stopping passive scanning and @@ -10089,65 +5768,11 @@ static void device_found_callback(uint16_t index, uint16_t length, confirm_name = (flags & MGMT_DEV_FOUND_CONFIRM_NAME); legacy = (flags & MGMT_DEV_FOUND_LEGACY_PAIRING); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - update_found_devices(adapter, &ev->addr.bdaddr, ev->addr.type, - ev->rssi, confirm_name, legacy, 0, - eir, eir_len); -#else update_found_devices(adapter, &ev->addr.bdaddr, ev->addr.type, ev->rssi, confirm_name, legacy, flags & MGMT_DEV_FOUND_NOT_CONNECTABLE, eir, eir_len); -#endif -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void le_device_found_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_ev_le_device_found *ev = param; - struct btd_adapter *adapter = user_data; - const uint8_t *eir; - uint16_t eir_len; - uint32_t flags; - bool confirm_name; - bool legacy; - char addr[18]; - - if (length < sizeof(*ev)) { - error("Too short device found event (%u bytes)", length); - return; - } - - eir_len = btohs(ev->eir_len); - if (length != sizeof(*ev) + eir_len) { - error("Device found event size mismatch (%u != %zu)", - length, sizeof(*ev) + eir_len); - return; - } - - if (eir_len == 0) - eir = NULL; - else - eir = ev->eir; - - flags = btohl(ev->flags); - - ba2str(&ev->addr.bdaddr, addr); - /*DBG("hci%u addr %s, rssi %d flags 0x%04x eir_len %u", - index, addr, ev->rssi, flags, eir_len);*/ - - confirm_name = (flags & MGMT_DEV_FOUND_CONFIRM_NAME); - legacy = (flags & MGMT_DEV_FOUND_LEGACY_PAIRING); - - /*DBG("hci%u addr %s, addr_type %d rssi %d flags 0x%04x eir_len %u confirm_name %d legacy %d, adv_type %02x", - index, addr, ev->addr.type, ev->rssi, flags, eir_len, confirm_name, legacy, ev->adv_type);*/ - - update_found_devices(adapter, &ev->addr.bdaddr, ev->addr.type, - ev->rssi, confirm_name, legacy, ev->adv_type, - eir, eir_len); } -#endif struct agent *adapter_get_agent(struct btd_adapter *adapter) { @@ -10167,11 +5792,7 @@ static void adapter_remove_connection(struct btd_adapter *adapter, device_remove_connection(device, bdaddr_type); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device_is_authenticating(device, bdaddr_type)) -#else if (device_is_authenticating(device)) -#endif device_cancel_authentication(device, TRUE); /* If another bearer is still connected */ @@ -10179,31 +5800,12 @@ static void adapter_remove_connection(struct btd_adapter *adapter, return; adapter->connections = g_slist_remove(adapter->connections, device); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("isPaired %d, isBonded %d", device_is_paired(device, bdaddr_type), - device_is_bonded(device, bdaddr_type)); - if ((device_is_temporary(device) && !device_is_retrying(device)) || - (!device_is_bonded(device, bdaddr_type))) { -#else + if (device_is_temporary(device) && !device_is_retrying(device)) { -#endif const char *path = device_get_path(device); DBG("Removing temporary device %s", path); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* device_is_paired is added incase of tempoary bonded - * oop file transfer in that device is not bonded it's paired. - */ - if (!(device_is_bonded(device, bdaddr_type) || - device_is_paired(device, bdaddr_type))) { - DBG("addr type %d, bonded", bdaddr_type); - return; - } - - btd_adapter_unpair_device(adapter, device); -#else btd_adapter_remove_device(adapter, device); -#endif } } @@ -10256,10 +5858,6 @@ static void adapter_stop(struct btd_adapter *adapter) g_dbus_emit_property_changed(dbus_conn, adapter->path, ADAPTER_INTERFACE, "Discovering"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_dbus_emit_property_changed(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "LEDiscovering"); -#endif if (adapter->dev_class) { /* the kernel should reset the class of device when powering @@ -10269,9 +5867,6 @@ static void adapter_stop(struct btd_adapter *adapter) ADAPTER_INTERFACE, "Class"); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - advertiser_cleanup(adapter); -#endif g_dbus_emit_property_changed(dbus_conn, adapter->path, ADAPTER_INTERFACE, "Powered"); @@ -10354,31 +5949,14 @@ static gboolean process_auth_queue(gpointer user_data) const char *dev_path; /* Wait services to be resolved before asking authorization */ - if (auth->svc_id > 0) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("Wait services to be resolved before asking authorization"); -#endif + if (auth->svc_id > 0) return FALSE; - } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (device_is_trusted(device) == TRUE) { -#else - if (device_is_trusted(device) == TRUE || - device_is_profile_trusted(device, auth->uuid)) { -#endif auth->cb(NULL, auth->user_data); goto next; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* If Profile is Blocked, Simply reject Authorization*/ - if (device_is_profile_blocked(device, auth->uuid) == TRUE) { - auth->cb(&err, auth->user_data); - goto next; - } -#endif - /* If agent is set authorization is already ongoing */ if (auth->agent) return FALSE; @@ -10642,556 +6220,207 @@ int btd_adapter_pincode_reply(struct btd_adapter *adapter, id = mgmt_reply(adapter->mgmt, MGMT_OP_PIN_CODE_NEG_REPLY, adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL); - } else { - struct mgmt_cp_pin_code_reply cp; - - if (pin_len > 16) - return -EINVAL; - - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = BDADDR_BREDR; - cp.pin_len = pin_len; - memcpy(cp.pin_code, pin, pin_len); - - /* Since a pincode was requested, update the starting time to - * the point where the pincode is provided. */ - device = btd_adapter_find_device(adapter, bdaddr, BDADDR_BREDR); - device_bonding_restart_timer(device); - - id = mgmt_reply(adapter->mgmt, MGMT_OP_PIN_CODE_REPLY, - adapter->dev_id, sizeof(cp), &cp, - pincode_reply_complete, device, NULL); - } - - if (id == 0) - return -EIO; - - return 0; -} - -int btd_adapter_confirm_reply(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, uint8_t bdaddr_type, - gboolean success) -{ - struct mgmt_cp_user_confirm_reply cp; - uint16_t opcode; - char addr[18]; - - ba2str(bdaddr, addr); - DBG("hci%u addr %s success %d", adapter->dev_id, addr, success); - - if (success) - opcode = MGMT_OP_USER_CONFIRM_REPLY; - else - opcode = MGMT_OP_USER_CONFIRM_NEG_REPLY; - - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = bdaddr_type; - - if (mgmt_reply(adapter->mgmt, opcode, adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return 0; - - return -EIO; -} - -static void user_confirm_request_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_ev_user_confirm_request *ev = param; - struct btd_adapter *adapter = user_data; - struct btd_device *device; - char addr[18]; - int err; - - if (length < sizeof(*ev)) { - btd_error(adapter->dev_id, - "Too small user confirm request event"); - return; - } - - ba2str(&ev->addr.bdaddr, addr); - DBG("hci%u %s confirm_hint %u", adapter->dev_id, addr, - ev->confirm_hint); - device = btd_adapter_get_device(adapter, &ev->addr.bdaddr, - ev->addr.type); - if (!device) { - btd_error(adapter->dev_id, - "Unable to get device object for %s", addr); - return; - } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_set_auth_addr_type(device, ev->addr.type); -#endif - - err = device_confirm_passkey(device, btohl(ev->value), - ev->confirm_hint); - if (err < 0) { - btd_error(adapter->dev_id, - "device_confirm_passkey: %s", strerror(-err)); - btd_adapter_confirm_reply(adapter, &ev->addr.bdaddr, - ev->addr.type, FALSE); - } -} - -int btd_adapter_passkey_reply(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, uint8_t bdaddr_type, - uint32_t passkey) -{ - unsigned int id; - char addr[18]; - - ba2str(bdaddr, addr); - DBG("hci%u addr %s passkey %06u", adapter->dev_id, addr, passkey); - - if (passkey == INVALID_PASSKEY) { - struct mgmt_cp_user_passkey_neg_reply cp; - - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = bdaddr_type; - - id = mgmt_reply(adapter->mgmt, MGMT_OP_USER_PASSKEY_NEG_REPLY, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL); - } else { - struct mgmt_cp_user_passkey_reply cp; - - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = bdaddr_type; - cp.passkey = htobl(passkey); - - id = mgmt_reply(adapter->mgmt, MGMT_OP_USER_PASSKEY_REPLY, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL); - } - - if (id == 0) - return -EIO; - - return 0; -} - -static void user_passkey_request_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_ev_user_passkey_request *ev = param; - struct btd_adapter *adapter = user_data; - struct btd_device *device; - char addr[18]; - int err; - - if (length < sizeof(*ev)) { - btd_error(adapter->dev_id, "Too small passkey request event"); - return; - } - - ba2str(&ev->addr.bdaddr, addr); - DBG("hci%u %s", index, addr); - - device = btd_adapter_get_device(adapter, &ev->addr.bdaddr, - ev->addr.type); - if (!device) { - btd_error(adapter->dev_id, - "Unable to get device object for %s", addr); - return; - } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_set_auth_addr_type(device, ev->addr.type); -#endif - - err = device_request_passkey(device); - if (err < 0) { - btd_error(adapter->dev_id, - "device_request_passkey: %s", strerror(-err)); - btd_adapter_passkey_reply(adapter, &ev->addr.bdaddr, - ev->addr.type, INVALID_PASSKEY); - } -} - -static void user_passkey_notify_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_ev_passkey_notify *ev = param; - struct btd_adapter *adapter = user_data; - struct btd_device *device; - uint32_t passkey; - char addr[18]; - int err; - - if (length < sizeof(*ev)) { - btd_error(adapter->dev_id, "Too small passkey notify event"); - return; - } - - ba2str(&ev->addr.bdaddr, addr); - DBG("hci%u %s", index, addr); - - device = btd_adapter_get_device(adapter, &ev->addr.bdaddr, - ev->addr.type); - if (!device) { - btd_error(adapter->dev_id, - "Unable to get device object for %s", addr); - return; - } - - passkey = get_le32(&ev->passkey); - - DBG("passkey %06u entered %u", passkey, ev->entered); - - err = device_notify_passkey(device, passkey, ev->entered); - if (err < 0) - btd_error(adapter->dev_id, - "device_notify_passkey: %s", strerror(-err)); -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void rssi_alert_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_ev_vendor_specific_rssi_alert *ev = param; - struct btd_adapter *adapter = user_data; - char addr[18]; - char *bt_addr = NULL; - int link_type = -1; - int alert_type = -1; - int rssi_dbm = 0; - - if (length < sizeof(*ev)) { - error("Too small rssi alert event"); - return; - } - - ba2str(&ev->bdaddr, addr); - DBG("hci%u %s %d", index, addr, ev->link_type); - DBG("RSSI Alert Params [%d %d]", ev->alert_type, ev->rssi_dbm); - - bt_addr = (char *)&addr; - link_type = ev->link_type; - alert_type = ev->alert_type; - rssi_dbm = ev->rssi_dbm; - g_dbus_emit_signal(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "RssiAlert", - DBUS_TYPE_STRING, &bt_addr, - DBUS_TYPE_INT32, &link_type, - DBUS_TYPE_INT32, &alert_type, - DBUS_TYPE_INT32, &rssi_dbm, - DBUS_TYPE_INVALID); -} - -static void get_raw_rssi_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_cc_rp_get_raw_rssi *ev = param; - struct btd_adapter *adapter = user_data; - char addr[18]; - char *bt_addr = NULL; - int link_type = -1; - int rssi_dbm = 0; - - if (length < sizeof(*ev)) { - error("Too small raw RSSI event"); - return; - } - - ba2str(&ev->bt_address, addr); - DBG("hci%u %s", index, addr); - DBG("Raw RSSI Params [%d %d]", ev->link_type, ev->rssi_dbm); - - bt_addr = (char *)&addr; - link_type = ev->link_type; - rssi_dbm = ev->rssi_dbm; - - g_dbus_emit_signal(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "RawRssi", - DBUS_TYPE_STRING, &bt_addr, - DBUS_TYPE_INT32, &link_type, - DBUS_TYPE_INT32, &rssi_dbm, - DBUS_TYPE_INVALID); -} - -static void rssi_enabled_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_cc_rsp_enable_rssi *ev = param; - struct btd_adapter *adapter = user_data; - char addr[18]; - char *bt_addr = NULL; - int enabled = TRUE; - int link_type = -1; - - if (length < sizeof(*ev)) { - error("Too small rssi enabled event"); - return; - } - - ba2str(&ev->bt_address, addr); - DBG("hci%u %s %d", index, addr, ev->link_type); - DBG("RSSI Enabled [%d %d]", ev->le_ext_opcode, ev->status); - - bt_addr = (char *)&addr; - link_type = ev->link_type; - - g_dbus_emit_signal(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "RssiEnabled", - DBUS_TYPE_STRING, &bt_addr, - DBUS_TYPE_INT32, &link_type, - DBUS_TYPE_BOOLEAN, &enabled, - DBUS_TYPE_INVALID); -} - -static void rssi_disabled_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_cc_rp_disable_rssi *ev = param; - struct btd_adapter *adapter = user_data; - char addr[18]; - char *bt_addr = NULL; - int disabled = FALSE; - int link_type = -1; - - if (length < sizeof(*ev)) { - error("Too small RSSI disabled event"); - return; - } - - ba2str(&ev->bt_address, addr); - DBG("hci%u %s %d", index, addr, ev->link_type); - DBG("RSSI Disabled Params [%d %d]", ev->le_ext_opcode, ev->status); + NULL, NULL, NULL); + } else { + struct mgmt_cp_pin_code_reply cp; - bt_addr = (char *)&addr; - link_type = ev->link_type; + if (pin_len > 16) + return -EINVAL; - g_dbus_emit_signal(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "RssiEnabled", - DBUS_TYPE_STRING, &bt_addr, - DBUS_TYPE_INT32, &link_type, - DBUS_TYPE_BOOLEAN, &disabled, - DBUS_TYPE_INVALID); -} + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.addr.bdaddr, bdaddr); + cp.addr.type = BDADDR_BREDR; + cp.pin_len = pin_len; + memcpy(cp.pin_code, pin, pin_len); -void adapter_check_version(struct btd_adapter *adapter, uint8_t hci_ver) -{ - char *ver; + /* Since a pincode was requested, update the starting time to + * the point where the pincode is provided. */ + device = btd_adapter_find_device(adapter, bdaddr, BDADDR_BREDR); + device_bonding_restart_timer(device); - switch (hci_ver) { - case 0: - ver = "Bluetooth 1.0b"; - break; - case 1: - ver = "Bluetooth 1.1"; - break; - case 2: - ver = "Bluetooth 1.2"; - break; - case 3: - ver = "Bluetooth 2.0 + EDR"; - break; - case 4: - ver = "Bluetooth 2.1 + EDR"; - break; - case 5: - ver = "Bluetooth 3.0 + HS"; - break; - case 6: - ver = "Bluetooth 4.0"; - break; - case 7: - ver = "Bluetooth 4.1"; - break; - default: - ver = "Unknown"; - break; + id = mgmt_reply(adapter->mgmt, MGMT_OP_PIN_CODE_REPLY, + adapter->dev_id, sizeof(cp), &cp, + pincode_reply_complete, device, NULL); } - if (adapter->version) - g_free(adapter->version); + if (id == 0) + return -EIO; - adapter->version = g_strdup(ver); + return 0; } -static void hardware_error_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) +int btd_adapter_confirm_reply(struct btd_adapter *adapter, + const bdaddr_t *bdaddr, uint8_t bdaddr_type, + gboolean success) { - const struct mgmt_ev_hardware_error *ev = param; - struct btd_adapter *adapter = user_data; + struct mgmt_cp_user_confirm_reply cp; + uint16_t opcode; + char addr[18]; - if (length < sizeof(*ev)) { - error("Too small Hardware error event"); - return; - } + ba2str(bdaddr, addr); + DBG("hci%u addr %s success %d", adapter->dev_id, addr, success); - error("Hardware error occurred : %d", ev->error_code); - g_dbus_emit_signal(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "HardwareError", - DBUS_TYPE_INVALID); -} + if (success) + opcode = MGMT_OP_USER_CONFIRM_REPLY; + else + opcode = MGMT_OP_USER_CONFIRM_NEG_REPLY; -static void tx_timeout_error_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.addr.bdaddr, bdaddr); + cp.addr.type = bdaddr_type; + + if (mgmt_reply(adapter->mgmt, opcode, adapter->dev_id, sizeof(cp), &cp, + NULL, NULL, NULL) > 0) + return 0; - error("Tx Timeout error occurred"); - g_dbus_emit_signal(dbus_conn, adapter->path, - ADAPTER_INTERFACE, "TxTimeoutError", - DBUS_TYPE_INVALID); + return -EIO; } -static void device_name_update_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) +static void user_confirm_request_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) { - const struct mgmt_ev_device_name_update *ev = param; + const struct mgmt_ev_user_confirm_request *ev = param; struct btd_adapter *adapter = user_data; struct btd_device *device; char addr[18]; - const uint8_t *eir_name; - struct eir_data eir_data; + int err; if (length < sizeof(*ev)) { - error("Name update error event"); + btd_error(adapter->dev_id, + "Too small user confirm request event"); return; } ba2str(&ev->addr.bdaddr, addr); - DBG("hci%u %s", index, addr); - + DBG("hci%u %s confirm_hint %u", adapter->dev_id, addr, + ev->confirm_hint); device = btd_adapter_get_device(adapter, &ev->addr.bdaddr, ev->addr.type); if (!device) { - error("Unable to get device object for %s", addr); + btd_error(adapter->dev_id, + "Unable to get device object for %s", addr); return; } - if (ev->eir_len == 0) - return; - - eir_name = ev->eir; - - memset(&eir_data, 0, sizeof(eir_data)); - eir_parse(&eir_data, eir_name, ev->eir_len); - - if (eir_data.name) - btd_device_device_set_name(device, eir_data.name); - - eir_data_free(&eir_data); + err = device_confirm_passkey(device, ev->addr.type, btohl(ev->value), + ev->confirm_hint); + if (err < 0) { + btd_error(adapter->dev_id, + "device_confirm_passkey: %s", strerror(-err)); + btd_adapter_confirm_reply(adapter, &ev->addr.bdaddr, + ev->addr.type, FALSE); + } } -static void multi_adv_state_change_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) +int btd_adapter_passkey_reply(struct btd_adapter *adapter, + const bdaddr_t *bdaddr, uint8_t bdaddr_type, + uint32_t passkey) { - const struct mgmt_ev_vendor_specific_multi_adv_state_changed *ev = param; - struct btd_adapter *adapter = user_data; + unsigned int id; + char addr[18]; - if (length < sizeof(*ev)) { - error("Too small adv state change event"); - return; - } + ba2str(bdaddr, addr); + DBG("hci%u addr %s passkey %06u", adapter->dev_id, addr, passkey); - DBG("adv id %d, state change reason %d, connection_handle %x", - ev->adv_instance, ev->state_change_reason, ev->connection_handle); + if (passkey == INVALID_PASSKEY) { + struct mgmt_cp_user_passkey_neg_reply cp; - if ((ev->adv_instance > 0 && ev->adv_instance < adapter_le_get_max_adv_instance()) && - ev->state_change_reason == 0) - adapter_le_enable_multi_adv(adapter, TRUE, ev->adv_instance); -} + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.addr.bdaddr, bdaddr); + cp.addr.type = bdaddr_type; -static void le_conn_update_completed_callback(uint16_t index, uint16_t length, - const void *param, void *user_data) -{ - const struct mgmt_ev_conn_updated *ev = param; - struct btd_adapter *adapter = user_data; - struct btd_device *device; - char addr[18]; - GSList *list; + id = mgmt_reply(adapter->mgmt, MGMT_OP_USER_PASSKEY_NEG_REPLY, + adapter->dev_id, sizeof(cp), &cp, + NULL, NULL, NULL); + } else { + struct mgmt_cp_user_passkey_reply cp; - if (length < sizeof(*ev)) { - error("Too small le conn update completed event"); - return; - } + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.addr.bdaddr, bdaddr); + cp.addr.type = bdaddr_type; + cp.passkey = htobl(passkey); - ba2str(&ev->addr.bdaddr, addr); - list = g_slist_find_custom(adapter->devices, addr, - device_address_cmp); - if (list) { - device = list->data; - if (device_get_conn_update_state(device)) - device_set_conn_update_state(device, false); + id = mgmt_reply(adapter->mgmt, MGMT_OP_USER_PASSKEY_REPLY, + adapter->dev_id, sizeof(cp), &cp, + NULL, NULL, NULL); } + + if (id == 0) + return -EIO; + + return 0; } -static void bt_6lowpan_conn_state_change_callback(uint16_t index, uint16_t length, +static void user_passkey_request_callback(uint16_t index, uint16_t length, const void *param, void *user_data) { - const struct mgmt_ev_6lowpan_conn_state_changed *ev = param; + const struct mgmt_ev_user_passkey_request *ev = param; struct btd_adapter *adapter = user_data; struct btd_device *device; char addr[18]; - gboolean connected = 0; + int err; if (length < sizeof(*ev)) { - btd_error(adapter->dev_id, - "Too small device connected event"); + btd_error(adapter->dev_id, "Too small passkey request event"); return; } ba2str(&ev->addr.bdaddr, addr); + DBG("hci%u %s", index, addr); - DBG("hci%u device %s", index, addr); - - device = btd_adapter_find_device(adapter, &ev->addr.bdaddr, + device = btd_adapter_get_device(adapter, &ev->addr.bdaddr, ev->addr.type); if (!device) { btd_error(adapter->dev_id, - "Unable to get device object for %s", addr); + "Unable to get device object for %s", addr); return; } - if (ev->connected) - connected = TRUE; - else - connected = FALSE; - - device_set_ipsp_connected(device, connected, ev->ifname); + err = device_request_passkey(device, ev->addr.type); + if (err < 0) { + btd_error(adapter->dev_id, + "device_request_passkey: %s", strerror(-err)); + btd_adapter_passkey_reply(adapter, &ev->addr.bdaddr, + ev->addr.type, INVALID_PASSKEY); + } } -static void bt_le_data_length_changed_callback(uint16_t index, uint16_t length, +static void user_passkey_notify_callback(uint16_t index, uint16_t length, const void *param, void *user_data) { - const struct mgmt_ev_le_data_length_changed *ev = param; + const struct mgmt_ev_passkey_notify *ev = param; struct btd_adapter *adapter = user_data; struct btd_device *device; + uint32_t passkey; char addr[18]; + int err; if (length < sizeof(*ev)) { - btd_error(adapter->dev_id, - "Too small data length changed event"); + btd_error(adapter->dev_id, "Too small passkey notify event"); return; } ba2str(&ev->addr.bdaddr, addr); + DBG("hci%u %s", index, addr); - DBG("hci%u device %s", index, addr); - - device = btd_adapter_find_device(adapter, &ev->addr.bdaddr, + device = btd_adapter_get_device(adapter, &ev->addr.bdaddr, ev->addr.type); if (!device) { btd_error(adapter->dev_id, - "Unable to get device object for %s", addr); + "Unable to get device object for %s", addr); return; } - device_le_data_length_changed(device, ev->max_tx_octets, ev->max_tx_time, - ev->max_rx_octets, ev->max_rx_time); -} + passkey = get_le32(&ev->passkey); -#endif + DBG("passkey %06u entered %u", passkey, ev->entered); + + err = device_notify_passkey(device, ev->addr.type, passkey, + ev->entered); + if (err < 0) + btd_error(adapter->dev_id, + "device_notify_passkey: %s", strerror(-err)); +} struct btd_adapter_pin_cb_iter *btd_adapter_pin_cb_iter_new( struct btd_adapter *adapter) @@ -11270,9 +6499,6 @@ static void pin_code_request_callback(uint16_t index, uint16_t length, /* Flag the request of a pincode to allow a bonding retry. */ adapter->pincode_requested = true; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - btd_device_set_legacy_pairing(device, true); -#endif memset(pin, 0, sizeof(pin)); @@ -11300,14 +6526,7 @@ static void pin_code_request_callback(uint16_t index, uint16_t length, } return; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* check auto pairing mode */ - if (adapter->auto_pairing) { - btd_adapter_pincode_reply(adapter, &ev->addr.bdaddr, - adapter->pin_code, adapter->pin_code ? strlen(adapter->pin_code) : 0); - return; - } -#endif + err = device_request_pincode(device, ev->secure); if (err < 0) { btd_error(adapter->dev_id, "device_request_pin: %s", @@ -11367,9 +6586,8 @@ static void bonding_complete(struct btd_adapter *adapter, if (device != NULL) device_bonding_complete(device, addr_type, status); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY resume_discovery(adapter); -#endif + check_oob_bonding_complete(adapter, bdaddr, status); } @@ -11486,9 +6704,8 @@ int adapter_create_bonding(struct btd_adapter *adapter, const bdaddr_t *bdaddr, return -EBUSY; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY suspend_discovery(adapter); -#endif + return adapter_bonding_attempt(adapter, bdaddr, addr_type, io_cap); } @@ -11558,38 +6775,16 @@ static void dev_disconnected(struct btd_adapter *adapter, { struct btd_device *device; char dst[18]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct device_addr_type t_addr; -#endif ba2str(&addr->bdaddr, dst); DBG("Device %s disconnected, reason %u", dst, reason); device = btd_adapter_find_device(adapter, &addr->bdaddr, addr->type); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device) { - device_get_tizen_addr(device, addr->type, &t_addr); - - device_set_disconnect_reason(device, reason); - adapter_remove_connection(adapter, device, t_addr.bdaddr_type); - disconnect_notify(device, reason); - if (device_is_bonded(device, t_addr.bdaddr_type)) { - DBG("addr type %d, bonded", t_addr.bdaddr_type); - return; - } - - bonding_attempt_complete(adapter, &t_addr.bdaddr, - t_addr.bdaddr_type, MGMT_STATUS_DISCONNECTED); - return; - } -#else if (device) { adapter_remove_connection(adapter, device, addr->type); disconnect_notify(device, reason); } -#endif bonding_attempt_complete(adapter, &addr->bdaddr, addr->type, MGMT_STATUS_DISCONNECTED); @@ -11627,12 +6822,7 @@ static void disconnect_complete(uint8_t status, uint16_t length, return; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Use HCI error code instead of MGMT disconnection reason */ - dev_disconnected(adapter, &rp->addr, 0x16); -#else dev_disconnected(adapter, &rp->addr, MGMT_DEV_DISCONN_LOCAL_HOST); -#endif } int btd_adapter_disconnect_device(struct btd_adapter *adapter, @@ -11748,16 +6938,7 @@ static void new_link_key_callback(uint16_t index, uint16_t length, key->pin_len); device_set_bonded(device, BDADDR_BREDR); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } else { - if (btd_adapter_get_a2dp_role(adapter) == BLUETOOTH_A2DP_SINK_ROLE) { - DBG("store_hint %d", ev->store_hint); - btd_device_set_temporary(device, false); - } - } -#else } -#endif bonding_complete(adapter, &addr->bdaddr, addr->type, 0); } @@ -11824,9 +7005,6 @@ static void new_long_term_key_callback(uint16_t index, uint16_t length, struct btd_device *device; bool persistent; char dst[18]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct device_addr_type t_addr; -#endif if (length < sizeof(*ev)) { btd_error(adapter->dev_id, "Too small long term key event"); @@ -11871,16 +7049,9 @@ static void new_long_term_key_callback(uint16_t index, uint16_t length, ediv = le16_to_cpu(key->ediv); rand = le64_to_cpu(key->rand); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_get_tizen_addr(device, addr->type, &t_addr); - store_longtermkey(bdaddr, &t_addr.bdaddr, t_addr.bdaddr_type, - key->val, key->master, key->type, - key->enc_size, ediv, rand); -#else store_longtermkey(bdaddr, &key->addr.bdaddr, key->addr.type, key->val, key->master, key->type, key->enc_size, ediv, rand); -#endif device_set_bonded(device, addr->type); } @@ -11960,9 +7131,6 @@ static void new_csrk_callback(uint16_t index, uint16_t length, const bdaddr_t *bdaddr = btd_adapter_get_address(adapter); struct btd_device *device; char dst[18]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct device_addr_type t_addr; -#endif if (length < sizeof(*ev)) { btd_error(adapter->dev_id, "Too small CSRK event"); @@ -11984,14 +7152,8 @@ static void new_csrk_callback(uint16_t index, uint16_t length, if (!ev->store_hint) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_get_tizen_addr(device, addr->type, &t_addr); - store_csrk(bdaddr, &t_addr.bdaddr, t_addr.bdaddr_type, key->val, 0, - key->type); -#else store_csrk(bdaddr, &key->addr.bdaddr, key->addr.type, key->val, 0, key->type); -#endif btd_device_set_temporary(device, false); } @@ -12040,9 +7202,6 @@ static void new_irk_callback(uint16_t index, uint16_t length, struct btd_device *device, *duplicate; bool persistent; char dst[18], rpa[18]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct device_addr_type t_addr; -#endif if (length < sizeof(*ev)) { btd_error(adapter->dev_id, "Too small New IRK event"); @@ -12056,16 +7215,11 @@ static void new_irk_callback(uint16_t index, uint16_t length, if (bacmp(&ev->rpa, BDADDR_ANY)) { device = btd_adapter_get_device(adapter, &ev->rpa, - BDADDR_LE_RANDOM); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + BDADDR_LE_RANDOM); duplicate = btd_adapter_find_device(adapter, &addr->bdaddr, - addr->type); + addr->type); if (duplicate == device) duplicate = NULL; -#else - device_set_rpa(device, &ev->rpa); - duplicate = NULL; -#endif } else { device = btd_adapter_get_device(adapter, &addr->bdaddr, addr->type); @@ -12083,20 +7237,11 @@ static void new_irk_callback(uint16_t index, uint16_t length, if (duplicate) device_merge_duplicate(device, duplicate); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_set_irk_value(device, irk->val); -#endif - persistent = !!ev->store_hint; if (!persistent) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_get_tizen_addr(device, addr->type, &t_addr); - store_irk(adapter, &t_addr.bdaddr, t_addr.bdaddr_type, irk->val); -#else store_irk(adapter, &addr->bdaddr, addr->type, irk->val); -#endif btd_device_set_temporary(device, false); } @@ -12149,9 +7294,7 @@ static void new_conn_param(uint16_t index, uint16_t length, uint16_t min, max, latency, timeout; struct btd_device *dev; char dst[18]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct device_addr_type t_addr; -#endif + if (length < sizeof(*ev)) { btd_error(adapter->dev_id, @@ -12179,71 +7322,19 @@ static void new_conn_param(uint16_t index, uint16_t length, if (!ev->store_hint) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_get_tizen_addr(dev, ev->addr.type, &t_addr); - store_conn_param(adapter, &t_addr.bdaddr, t_addr.bdaddr_type, - ev->min_interval, ev->max_interval, - ev->latency, ev->timeout); -#else - store_conn_param(adapter, &ev->addr.bdaddr, ev->addr.type, - ev->min_interval, ev->max_interval, - ev->latency, ev->timeout); -#endif -} - -int adapter_set_io_capability(struct btd_adapter *adapter, uint8_t io_cap) -{ - struct mgmt_cp_set_io_capability cp; - - memset(&cp, 0, sizeof(cp)); - cp.io_capability = io_cap; - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_IO_CAPABILITY, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return 0; - - return -EIO; -} - -int btd_adapter_add_remote_oob_data(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, - uint8_t *hash, uint8_t *randomizer) -{ - struct mgmt_cp_add_remote_oob_data cp; - char addr[18]; - - ba2str(bdaddr, addr); - DBG("hci%d bdaddr %s", adapter->dev_id, addr); - - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); - memcpy(cp.hash192, hash, 16); - - if (randomizer) - memcpy(cp.rand192, randomizer, 16); - - if (mgmt_send(adapter->mgmt, MGMT_OP_ADD_REMOTE_OOB_DATA, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return 0; - - return -EIO; + store_conn_param(adapter, &ev->addr.bdaddr, ev->addr.type, + ev->min_interval, ev->max_interval, + ev->latency, ev->timeout); } -int btd_adapter_remove_remote_oob_data(struct btd_adapter *adapter, - const bdaddr_t *bdaddr) +int adapter_set_io_capability(struct btd_adapter *adapter, uint8_t io_cap) { - struct mgmt_cp_remove_remote_oob_data cp; - char addr[18]; - - ba2str(bdaddr, addr); - DBG("hci%d bdaddr %s", adapter->dev_id, addr); + struct mgmt_cp_set_io_capability cp; memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); + cp.io_capability = io_cap; - if (mgmt_send(adapter->mgmt, MGMT_OP_REMOVE_REMOTE_OOB_DATA, + if (mgmt_send(adapter->mgmt, MGMT_OP_SET_IO_CAPABILITY, adapter->dev_id, sizeof(cp), &cp, NULL, NULL, NULL) > 0) return 0; @@ -12251,31 +7342,22 @@ int btd_adapter_remove_remote_oob_data(struct btd_adapter *adapter, return -EIO; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int btd_adapter_add_remote_oob_ext_data(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, uint8_t bdaddr_type, - uint8_t *hash192, uint8_t *randomizer192, - uint8_t *hash256, uint8_t *randomizer256) +int btd_adapter_add_remote_oob_data(struct btd_adapter *adapter, + const bdaddr_t *bdaddr, + uint8_t *hash, uint8_t *randomizer) { struct mgmt_cp_add_remote_oob_data cp; char addr[18]; ba2str(bdaddr, addr); - DBG("hci%d bdaddr %s type %d", adapter->dev_id, addr, bdaddr_type); + DBG("hci%d bdaddr %s", adapter->dev_id, addr); memset(&cp, 0, sizeof(cp)); bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = bdaddr_type; - - if (hash192 && randomizer192) { - memcpy(cp.hash192, hash192, 16); - memcpy(cp.rand192, randomizer192, 16); - } + memcpy(cp.hash192, hash, 16); - if (hash256 && randomizer256) { - memcpy(cp.hash256, hash256, 16); - memcpy(cp.rand256, randomizer256, 16); - } + if (randomizer) + memcpy(cp.rand192, randomizer, 16); if (mgmt_send(adapter->mgmt, MGMT_OP_ADD_REMOTE_OOB_DATA, adapter->dev_id, sizeof(cp), &cp, @@ -12285,18 +7367,17 @@ int btd_adapter_add_remote_oob_ext_data(struct btd_adapter *adapter, return -EIO; } -int btd_adapter_remove_remote_oob_ext_data(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, uint8_t bdaddr_type) +int btd_adapter_remove_remote_oob_data(struct btd_adapter *adapter, + const bdaddr_t *bdaddr) { struct mgmt_cp_remove_remote_oob_data cp; char addr[18]; ba2str(bdaddr, addr); - DBG("hci%d bdaddr %s type %d", adapter->dev_id, addr, bdaddr_type); + DBG("hci%d bdaddr %s", adapter->dev_id, addr); memset(&cp, 0, sizeof(cp)); bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = bdaddr_type; if (mgmt_send(adapter->mgmt, MGMT_OP_REMOVE_REMOTE_OOB_DATA, adapter->dev_id, sizeof(cp), &cp, @@ -12305,7 +7386,6 @@ int btd_adapter_remove_remote_oob_ext_data(struct btd_adapter *adapter, return -EIO; } -#endif bool btd_adapter_ssp_enabled(struct btd_adapter *adapter) { @@ -12332,10 +7412,6 @@ static void read_local_oob_data_complete(uint8_t status, uint16_t length, const struct mgmt_rp_read_local_oob_data *rp = param; struct btd_adapter *adapter = user_data; const uint8_t *hash, *randomizer; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - const uint8_t *hash256 = NULL; - const uint8_t *randomizer256 = NULL; -#endif if (status != MGMT_STATUS_SUCCESS) { btd_error(adapter->dev_id, @@ -12343,36 +7419,20 @@ static void read_local_oob_data_complete(uint8_t status, uint16_t length, mgmt_errstr(status), status); hash = NULL; randomizer = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } else if (length < 32) { -#else } else if (length < sizeof(*rp)) { -#endif btd_error(adapter->dev_id, "Too small read local OOB data response"); return; } else { hash = rp->hash192; randomizer = rp->rand192; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (length > 32) { - hash256 = rp->hash256; - randomizer256 = rp->rand256; - } -#endif } if (!adapter->oob_handler || !adapter->oob_handler->read_local_cb) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter->oob_handler->read_local_cb(adapter, hash, randomizer, - hash256, randomizer256, - adapter->oob_handler->user_data); -#else adapter->oob_handler->read_local_cb(adapter, hash, randomizer, adapter->oob_handler->user_data); -#endif g_free(adapter->oob_handler); adapter->oob_handler = NULL; @@ -12484,11 +7544,7 @@ static int adapter_register(struct btd_adapter *adapter) if (!g_dbus_register_interface(dbus_conn, adapter->path, ADAPTER_INTERFACE, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter_methods, adapter_signals, -#else adapter_methods, NULL, -#endif adapter_properties, adapter, adapter_free)) { btd_error(adapter->dev_id, @@ -12542,30 +7598,6 @@ static int adapter_register(struct btd_adapter *adapter) clear_blocked(adapter); load_devices(adapter); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter_print_devices(adapter); - - if (load_local_irk(adapter)) { - if (!(adapter->supported_settings & MGMT_SETTING_PRIVACY)) - main_opts.le_privacy = false; - - /* - * Some Android devices don't consider the device as LE one, - * if the device doesn't distribute IRK when pairing. - * Because of this compatibility issue, set IRK - * even though privacy feature is disabled. - */ - set_local_irk(adapter); - - if (main_opts.le_privacy) { - DBG("Enable LE Privacy feature"); - set_privacy(adapter, true); - } else { - DBG("Disable LE Privacy feature"); - } - } -#endif - /* retrieve the active connections: address the scenario where * the are active connections before the daemon've started */ if (adapter->current_settings & MGMT_SETTING_POWERED) @@ -12793,13 +7825,11 @@ static void connect_failed_callback(uint16_t index, uint16_t length, device_bonding_failed(device, ev->status); } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY /* In the case the bonding was canceled or did exists, remove the device * when it is temporary. */ if (device && !device_is_bonding(device, NULL) && device_is_temporary(device)) btd_adapter_remove_device(adapter, device); -#endif } static void remove_keys(struct btd_adapter *adapter, @@ -12815,11 +7845,6 @@ static void remove_keys(struct btd_adapter *adapter, ba2str(btd_adapter_get_address(adapter), adapter_addr); ba2str(device_get_address(device), device_addr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device_get_rpa_exist(device) == true) - ba2str(device_get_rpa(device), device_addr); -#endif - snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", adapter_addr, device_addr); key_file = g_key_file_new(); @@ -12870,264 +7895,6 @@ static void unpaired_callback(uint16_t index, uint16_t length, device_set_unpaired(device, ev->addr.type); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static uint8_t *generate_irk(void) -{ - int fd; - uint8_t *irk; - - DBG("Generate IRK"); - - fd = open("/dev/urandom", O_RDONLY); - if (fd < 0) - return NULL; - - irk = g_malloc0(MGMT_IRK_SIZE); - if (read(fd, irk, MGMT_IRK_SIZE) != MGMT_IRK_SIZE) { - error("Cannot read random bytes"); - g_free(irk); - close(fd); - return NULL; - } - close(fd); - - return irk; -} - -#define LOCAL_IRK_DIRNAME "/csa/bluetooth" -#define LOCAL_IRK_FILENAME ".local_irk" - -static bool store_local_irk(struct btd_adapter *adapter) -{ - int fd; - int ret; - - if (adapter->local_irk == NULL) { - error("Local IRK is not proper"); - return false; - } - - if (access(LOCAL_IRK_DIRNAME, F_OK) < 0) { - if (mkdir(LOCAL_IRK_DIRNAME, 0755) < 0) { - error("Cannot create a directory for local IRK : %s", - strerror(errno)); - return false; - } - } - - fd = open(LOCAL_IRK_DIRNAME"/"LOCAL_IRK_FILENAME, - O_WRONLY | O_CREAT | O_TRUNC, 0644); - if (fd < 0) { - error("Cannot open a file for local IRK : %s", strerror(errno)); - return false; - } - - ret = write(fd, adapter->local_irk, MGMT_IRK_SIZE); - if (ret != MGMT_IRK_SIZE) { - error("Cannot write local IRK [%d] : %s", ret, strerror(errno)); - - close(fd); - unlink(LOCAL_IRK_DIRNAME"/"LOCAL_IRK_FILENAME); - return false; - } - - ret = fdatasync(fd); - if (ret < 0) - error("sync failed : %s", strerror(errno)); - - close(fd); - return true; -} - -static bool load_local_irk(struct btd_adapter *adapter) -{ - int fd; - int ret; - - if (access(LOCAL_IRK_DIRNAME"/"LOCAL_IRK_FILENAME, F_OK) < 0) { - adapter->local_irk = generate_irk(); - if (store_local_irk(adapter) == false) { - error("Cannot store Local IRK"); - g_free(adapter->local_irk); - return false; - } - - return true; - } - - if (adapter->local_irk) { - DBG("Local IRK is already loaded"); - return true; - } - - fd = open(LOCAL_IRK_DIRNAME"/"LOCAL_IRK_FILENAME, O_RDONLY); - if (fd < 0) { - error("Cannot open local IRK file : %s", strerror(errno)); - return false; - } - - adapter->local_irk = g_malloc0(MGMT_IRK_SIZE); - - ret = read(fd, adapter->local_irk, MGMT_IRK_SIZE); - if (ret != MGMT_IRK_SIZE) { - error("Cannot read local IRK [%d] : %s", ret, strerror(errno)); - g_free(adapter->local_irk); - close(fd); - return false; - } - - close(fd); - return true; -} - -static void set_privacy_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - if (status != MGMT_STATUS_SUCCESS) - error("Setting privacy failed for hci%u: %s (0x%02x)", - adapter->dev_id, mgmt_errstr(status), status); - else - DBG("Privacy feature is set/unset successfully for hci%u", - adapter->dev_id); -} - -static bool set_privacy(struct btd_adapter *adapter, bool privacy) -{ - struct mgmt_cp_set_privacy cp; - - if (!adapter->local_irk) { - error("Local IRK is not available"); - return false; - } - - memset(&cp, 0, sizeof(cp)); - memcpy(cp.irk, adapter->local_irk, MGMT_IRK_SIZE); - - if (privacy) - cp.privacy = 0x01; - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_PRIVACY, - adapter->dev_id, sizeof(cp), &cp, - set_privacy_complete, adapter, NULL) > 0) - return true; - - error("Failed to set privacy and load local irk for index %u", - adapter->dev_id); - return false; -} - -static void set_irk_complete(uint8_t status, uint16_t length, - const void *param, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - if (status != MGMT_STATUS_SUCCESS) - error("Setting IRK is failed for hci%u: %s (0x%02x)", - adapter->dev_id, mgmt_errstr(status), status); - else - DBG("Setting IRK is succeed for hci%u", adapter->dev_id); -} - -static bool set_local_irk(struct btd_adapter *adapter) -{ - struct mgmt_cp_set_irk cp; - - if (!adapter->local_irk) { - error("Local IRK is not available"); - return false; - } - - memcpy(cp.irk, adapter->local_irk, MGMT_IRK_SIZE); - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_IRK, - adapter->dev_id, sizeof(cp), &cp, - set_irk_complete, adapter, NULL) > 0) - return true; - - error("Failed to set irk %u", adapter->dev_id); - return false; -} - -int btd_adapter_connect_ipsp(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, - uint8_t bdaddr_type) - -{ - struct mgmt_cp_connect_6lowpan cp; - - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = bdaddr_type; - - if (mgmt_send(adapter->mgmt, MGMT_OP_CONNECT_6LOWPAN, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return 0; - - return -EIO; -} - -int btd_adapter_disconnect_ipsp(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, - uint8_t bdaddr_type) - -{ - struct mgmt_cp_disconnect_6lowpan cp; - - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.addr.bdaddr, bdaddr); - cp.addr.type = bdaddr_type; - - if (mgmt_send(adapter->mgmt, MGMT_OP_DISCONNECT_6LOWPAN, - adapter->dev_id, sizeof(cp), &cp, - NULL, NULL, NULL) > 0) - return 0; - - return -EIO; -} - -uint8_t btd_adapter_get_rpa_res_support_value( - struct btd_adapter *adapter) -{ - return adapter->central_rpa_res_support; -} - -static void set_dev_rpa_res_support_complete(uint8_t status, - uint16_t length, const void *param, - void *user_data) -{ - if (status != MGMT_STATUS_SUCCESS) - error("Failed to set RPA resolution support of device : %s (0x%02x)", - mgmt_errstr(status), status); - else - DBG("Set RPA resolution support successful"); -} - -int btd_adapter_set_dev_rpa_res_support(struct btd_adapter *adapter, - struct btd_device *device) - -{ - struct mgmt_cp_set_dev_rpa_res_support cp; - - DBG("btd_adapter_set_dev_rpa_res_support called"); - - memset(&cp, 0, sizeof(cp)); - - bacpy(&cp.addr.bdaddr, device_get_address(device)); - cp.addr.type = btd_device_get_bdaddr_type(device); - cp.res_support = device_get_rpa_res_char_value(device); - - if (mgmt_send(adapter->mgmt, MGMT_OP_SET_DEV_RPA_RES_SUPPORT, - adapter->dev_id, sizeof(cp), &cp, - set_dev_rpa_res_support_complete, NULL, NULL) > 0) - return 0; - - return -EIO; -} -#endif - static void clear_devices_complete(uint8_t status, uint16_t length, const void *param, void *user_data) { @@ -13160,17 +7927,6 @@ static int clear_devices(struct btd_adapter *adapter) return -EIO; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean adapter_start_idle_cb(gpointer user_data) -{ - struct btd_adapter *adapter = (struct btd_adapter*)user_data; - - adapter_start(adapter); - - return FALSE; -} -#endif - static void read_info_complete(uint8_t status, uint16_t length, const void *param, void *user_data) { @@ -13217,10 +7973,6 @@ static void read_info_complete(uint8_t status, uint16_t length, adapter->supported_settings = btohl(rp->supported_settings); adapter->current_settings = btohl(rp->current_settings); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - adapter_check_version(adapter, rp->version); -#endif - clear_uuids(adapter); clear_devices(adapter); @@ -13267,17 +8019,13 @@ static void read_info_complete(uint8_t status, uint16_t length, if (missing_settings & MGMT_SETTING_SECURE_CONN) set_mode(adapter, MGMT_OP_SET_SECURE_CONN, 0x01); + if (adapter->supported_settings & MGMT_SETTING_PRIVACY) + set_privacy(adapter, main_opts.privacy); + if (main_opts.fast_conn && (missing_settings & MGMT_SETTING_FAST_CONNECTABLE)) set_mode(adapter, MGMT_OP_SET_FAST_CONNECTABLE, 0x01); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Set the RPA resolution value to '1' if privacy is supported */ - if (main_opts.le_privacy && - adapter->supported_settings & MGMT_SETTING_PRIVACY) - adapter->central_rpa_res_support = 0x01; -#endif - err = adapter_register(adapter); if (err < 0) { btd_error(adapter->dev_id, "Unable to register new adapter"); @@ -13313,13 +8061,6 @@ static void read_info_complete(uint8_t status, uint16_t length, device_found_callback, adapter, NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - mgmt_register(adapter->mgmt, MGMT_EV_LE_DEVICE_FOUND, - adapter->dev_id, - le_device_found_callback, - adapter, NULL); -#endif - mgmt_register(adapter->mgmt, MGMT_EV_DEVICE_DISCONNECTED, adapter->dev_id, disconnected_callback, @@ -13399,63 +8140,6 @@ static void read_info_complete(uint8_t status, uint16_t length, user_passkey_notify_callback, adapter, NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - mgmt_register(adapter->mgmt, MGMT_EV_RSSI_ALERT, - adapter->dev_id, - rssi_alert_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_RAW_RSSI, - adapter->dev_id, - get_raw_rssi_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_RSSI_ENABLED, - adapter->dev_id, - rssi_enabled_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_RSSI_DISABLED, - adapter->dev_id, - rssi_disabled_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_HARDWARE_ERROR, - adapter->dev_id, - hardware_error_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_TX_TIMEOUT_ERROR, - adapter->dev_id, - tx_timeout_error_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_DEVICE_NAME_UPDATE, - adapter->dev_id, - device_name_update_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_MULTI_ADV_STATE_CHANGED, - adapter->dev_id, - multi_adv_state_change_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_6LOWPAN_CONN_STATE_CHANGED, - adapter->dev_id, - bt_6lowpan_conn_state_change_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_LE_DATA_LENGTH_CHANGED, - adapter->dev_id, - bt_le_data_length_changed_callback, - adapter, NULL); - - mgmt_register(adapter->mgmt, MGMT_EV_CONN_UPDATED, - adapter->dev_id, - le_conn_update_completed_callback, - adapter, NULL); -#endif - set_dev_class(adapter); set_name(adapter, btd_adapter_get_name(adapter)); @@ -13472,15 +8156,7 @@ static void read_info_complete(uint8_t status, uint16_t length, set_discoverable(adapter, 0x01, 0); if (adapter->current_settings & MGMT_SETTING_POWERED) -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_idle_add(adapter_start_idle_cb, adapter); -#else adapter_start(adapter); -#endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else - set_mode(adapter, MGMT_OP_SET_POWERED, 0x01); -#endif return; @@ -13515,7 +8191,7 @@ static void index_added(uint16_t index, uint16_t length, const void *param, adapter = btd_adapter_new(index); if (!adapter) { - btd_error(adapter->dev_id, + btd_error(index, "Unable to create new adapter for index %u", index); return; } diff --git a/src/adapter.h b/src/adapter.h old mode 100644 new mode 100755 index 985e28e..f2947fe --- a/src/adapter.h +++ b/src/adapter.h @@ -25,75 +25,21 @@ #include #include #include -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include -#include -#include -#include -#endif #define MAX_NAME_LENGTH 248 /* Invalid SSP passkey value used to indicate negative replies */ #define INVALID_PASSKEY 0xffffffff -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define BT_DISC_TYPE_DEFAULT 0 -#define BT_DISC_TYPE_BREDR_ONLY 1 -#define BT_DISC_TYPE_LE_ONLY 2 -#define BT_DISC_TYPE_LE_BREDR 3 - -#define TIZEN_FEATURE_PLATFROM_SCAN_FILTER -#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER - -#define COMPANY_ID_APPLE 0x004C -/* Deafult value set to 16(same as vendor specific value) - * and value shall be changed when required */ -#define SCAN_FILTER_SLOTS_MAX 16 -#define ADV_TYPE_SCAN_RESPONSE 04 - -typedef enum { - NONE_REPORT, - SCAN_REPORT, - IBEACON_REPORT, -} adapter_le_scan_report_type; - -typedef enum { - LE_PASSIVE_SCAN, - LE_ACTIVE_SCAN, -} adapter_le_scan_type; -#endif /* TIZEN_FEATURE_PLATFROM_SCAN_FILTER */ - -#endif - struct btd_adapter; struct btd_device; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef enum { - BLUETOOTH_A2DP_SOURCE_ROLE = 0, - BLUETOOTH_A2DP_SINK_ROLE, -} bluetooth_a2dp_role_t; -#endif - struct btd_adapter *btd_adapter_get_default(void); bool btd_adapter_is_default(struct btd_adapter *adapter); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -bluetooth_a2dp_role_t btd_adapter_get_a2dp_role(struct btd_adapter *adapter); -void btd_adapter_set_a2dp_role(struct btd_adapter *adapter, bluetooth_a2dp_role_t role); -#endif uint16_t btd_adapter_get_index(struct btd_adapter *adapter); typedef void (*adapter_cb) (struct btd_adapter *adapter, gpointer user_data); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef void (*oob_ext_read_local_cb_t) (struct btd_adapter *adapter, - const uint8_t *hash192, - const uint8_t *randomizer192, - const uint8_t *hash256, - const uint8_t *randomizer256, - void *user_data); -#endif typedef void (*oob_read_local_cb_t) (struct btd_adapter *adapter, const uint8_t *hash, const uint8_t *randomizer, @@ -103,26 +49,12 @@ typedef void (*oob_bonding_cb_t) (struct btd_adapter *adapter, void *user_data); struct oob_handler { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - oob_ext_read_local_cb_t read_local_cb; -#else oob_read_local_cb_t read_local_cb; -#endif oob_bonding_cb_t bonding_cb; bdaddr_t remote_addr; void *user_data; }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH -typedef enum { - NONE_CHARGING, - WIRE_CHARGING, - WIRELESS_CHARGING, -} charging_state_e; -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif - int adapter_init(void); void adapter_cleanup(void); void adapter_shutdown(void); @@ -160,10 +92,6 @@ struct btd_device *btd_adapter_find_device(struct btd_adapter *adapter, const char *adapter_get_path(struct btd_adapter *adapter); const bdaddr_t *btd_adapter_get_address(struct btd_adapter *adapter); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -const bdaddr_t *btd_adapter_get_le_address(struct btd_adapter *adapter); -uint8_t btd_adapter_get_le_address_type(struct btd_adapter * adapter); -#endif int adapter_set_name(struct btd_adapter *adapter, const char *name); int adapter_service_add(struct btd_adapter *adapter, sdp_record_t *rec); @@ -270,16 +198,6 @@ int btd_adapter_add_remote_oob_data(struct btd_adapter *adapter, int btd_adapter_remove_remote_oob_data(struct btd_adapter *adapter, const bdaddr_t *bdaddr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int btd_adapter_add_remote_oob_ext_data(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, uint8_t bdaddr_type, - uint8_t *hash192, uint8_t *randomizer192, - uint8_t *hash256, uint8_t *randomizer256); - -int btd_adapter_remove_remote_oob_ext_data(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, uint8_t bdaddr_type); -#endif - int btd_adapter_gatt_server_start(struct btd_adapter *adapter); void btd_adapter_gatt_server_stop(struct btd_adapter *adapter); @@ -308,48 +226,3 @@ void btd_adapter_for_each_device(struct btd_adapter *adapter, bool btd_le_connect_before_pairing(void); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int btd_adapter_connect_ipsp(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, - uint8_t bdaddr_type); -int btd_adapter_disconnect_ipsp(struct btd_adapter *adapter, - const bdaddr_t *bdaddr, - uint8_t bdaddr_type); - -uint8_t btd_adapter_get_rpa_res_support_value( - struct btd_adapter *adapter); - -int btd_adapter_set_dev_rpa_res_support(struct btd_adapter *adapter, - struct btd_device *device); -#endif - -typedef void (*read_max_data_length_cb_t) (struct btd_adapter *adapter, - const uint16_t max_txOctects, - const uint16_t max_txTime, - const uint16_t max_rxOctects, - const uint16_t max_rxTime, - void *user_data); - -struct le_data_length_read_handler { - read_max_data_length_cb_t read_callback; - void *user_data; -}; - -typedef void (*read_host_suggested_default_data_length_cb_t) (struct btd_adapter *adapter, - const uint16_t def_txOctects, - const uint16_t def_txTime, - void *user_data); - -struct le_data_length_read_default_data_length_handler { - read_host_suggested_default_data_length_cb_t read_callback; - void *user_data; -}; - -int btd_adapter_le_set_data_length(struct btd_adapter *adapter, bdaddr_t *bdaddr, - uint16_t max_tx_octets, uint16_t max_tx_time); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void adapter_check_version(struct btd_adapter *adapter, uint8_t hci_ver); -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH -charging_state_e get_charging_state(struct btd_adapter *adapter); -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif diff --git a/src/adapter_le_vsc_features.c b/src/adapter_le_vsc_features.c deleted file mode 100644 index 6c586eb..0000000 --- a/src/adapter_le_vsc_features.c +++ /dev/null @@ -1,769 +0,0 @@ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - -#include - -#include "log.h" -#include "adapter.h" -#include "eir.h" - -#include "adapter_le_vsc_features.h" - - -static apater_le_vsc_rp_get_vendor_cap ble_vsc_cb = { -1, }; - -static int update_le_address(const bdaddr_t *le_addr) -{ - int hdev = 0; - le_set_random_address_cp cp; - - hdev = hci_open_dev(0); - if (hdev < 0) { - error("Cannot open hdev"); - return -1; - } - - bacpy(&cp.bdaddr, le_addr); - - if (hci_send_cmd(hdev, OGF_LE_CTL, OCF_LE_SET_RANDOM_ADDRESS, - LE_SET_RANDOM_ADDRESS_CP_SIZE, &cp) < 0) { - error("hci_send_cmd is failed"); - hci_close_dev(hdev); - return -1; - } - - hci_close_dev(hdev); - - return 0; -} - -static int send_vsc_command(uint16_t ocf, uint8_t *cp, uint8_t cp_len, - uint8_t *rp, uint8_t rp_len) -{ - int dd; - struct hci_request rq; - - dd = hci_open_dev(0); - if (dd < 0) { - error("hci_open_dev is failed"); - return -1; - } - - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_VENDOR_CMD; - rq.ocf = ocf; - rq.cparam = cp; - rq.clen = cp_len; - rq.rparam = rp; - rq.rlen = rp_len; - - if (hci_send_req(dd, &rq, 5000) < 0) { - error("Fail to send VSC"); - hci_close_dev(dd); - return -1; - } - - hci_close_dev(dd); - return 0; -} - -gboolean adapter_le_read_ble_feature_info(void) -{ - int ret; - - DBG(""); - - ret = send_vsc_command(OCF_BCM_LE_GET_VENDOR_CAP, (uint8_t *) NULL, 0, - (uint8_t *) &ble_vsc_cb, sizeof(ble_vsc_cb)); - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != ble_vsc_cb.status) { - error("Fail to read ble feature info"); - return FALSE; - } - - DBG("======== BLE support info ========"); - DBG("adv_inst_max [%d]", ble_vsc_cb.adv_inst_max); - DBG("rpa_offloading [%d]", ble_vsc_cb.rpa_offloading); - DBG("tot_scan_results_strg [%d]", ble_vsc_cb.tot_scan_results_strg); - DBG("max_irk_list_sz [%d]", ble_vsc_cb.max_irk_list_sz); - DBG("filter_support [%d]", ble_vsc_cb.filter_support); - DBG("max_filter [%d]", ble_vsc_cb.max_filter); - DBG("energy_support [%d]", ble_vsc_cb.energy_support); - DBG("onlost_follow [%d]", ble_vsc_cb.onlost_follow); - DBG("================================="); - - return TRUE; -} - -int adapter_le_get_max_adv_instance(void) -{ - if (HCI_SUCCESS != ble_vsc_cb.status) { - error("not yet acquired chipset info"); - return 0; - } - - /* GearS does not support multi advertising. - but its official firmware returns adv_inst_max vaule to 5. - So here check rpa_offloading support and filter_support */ - if (!ble_vsc_cb.rpa_offloading || !ble_vsc_cb.max_filter) - return 0; - - return ble_vsc_cb.adv_inst_max; -} - -gboolean adapter_le_is_supported_multi_advertising(void) -{ - if (HCI_SUCCESS != ble_vsc_cb.status) { - error("not yet acquired chipset info"); - return FALSE; - } - - /* GearS does not support multi advertising. - but its official firmware returns adv_inst_max vaule to 5. - So here check rpa_offloading support and filter_support */ - if (!ble_vsc_cb.rpa_offloading || !ble_vsc_cb.max_filter) - return FALSE; - - if (ble_vsc_cb.adv_inst_max >= 5) - return TRUE; - else - return FALSE; -} - -gboolean adapter_le_is_supported_offloading(void) -{ - if (HCI_SUCCESS != ble_vsc_cb.status) { - error("not yet acquired chipset info"); - return FALSE; - } - - return ble_vsc_cb.rpa_offloading ? TRUE : FALSE; -} - -int adapter_le_get_scan_filter_size(void) -{ - if (HCI_SUCCESS != ble_vsc_cb.status) { - error("not yet acquired chipset info"); - return 0; - } -#if 0 - if (!ble_vsc_cb.filter_support) { - error("filter_support is not supported"); - return 0; - } -#endif - return ble_vsc_cb.max_filter; -} - -gboolean adapter_le_set_multi_adv_params (adapter_le_adv_inst_info_t *p_inst, - adapter_le_adv_param_t *p_params) -{ - int ret; - adapter_le_vsc_cp_set_multi_adv_params cp; - apater_le_vsc_rp_multi_adv rp; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_MULTI_ADV_SET_PARAM; - cp.adv_int_min = p_params->adv_int_min; - cp.adv_int_max = p_params->adv_int_max; - cp.adv_type = p_params->adv_type; - cp.bdaddr_type = p_inst->bdaddr_type; - bacpy(&cp.bdaddr, &p_inst->bdaddr); - cp.direct_bdaddr_type = 0; - bacpy(&cp.direct_bdaddr, BDADDR_ANY); - - cp.channel_map = p_params->channel_map; - cp.adv_filter_policy = p_params->adv_filter_policy; - cp.inst_id = p_inst->inst_id; - cp.tx_power = p_params->tx_power; - - ret = send_vsc_command(OCF_BCM_LE_MULTI_ADV, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [0x%02x]", rp.subcode, rp.status); - return FALSE; - } - - return TRUE; -} - -gboolean adapter_le_set_multi_adv_data(uint8_t inst_id, gboolean is_scan_rsp, - uint8_t data_len, uint8_t *p_data) -{ - int ret; - adapter_le_vsc_cp_set_multi_adv_data cp; - apater_le_vsc_rp_multi_adv rp; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = (is_scan_rsp) ? - SUB_CMD_LE_MULTI_ADV_WRITE_SCAN_RSP_DATA : - SUB_CMD_LE_MULTI_ADV_WRITE_ADV_DATA; - cp.data_len = data_len; - memcpy(&cp.data, p_data, data_len); - cp.inst_id = inst_id; - - ret = send_vsc_command(OCF_BCM_LE_MULTI_ADV, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [0x%02x]", rp.subcode, rp.status); - return FALSE; - } - - return TRUE; -} - -gboolean adapter_le_enable_multi_adv (struct btd_adapter *adapter, - gboolean enable, uint8_t inst_id) -{ - int ret; - adapter_le_vsc_cp_enable_multi_adv cp; - apater_le_vsc_rp_multi_adv rp; - uint8_t bdaddr_type; - const bdaddr_t *bdaddr; - - DBG(""); - if (enable) { - bdaddr_type = btd_adapter_get_le_address_type(adapter); - if (bdaddr_type == BDADDR_LE_RANDOM) { - bdaddr = btd_adapter_get_le_address(adapter); - update_le_address(bdaddr); - } - } - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_MULTI_ADV_ENB; - cp.enable = enable; - cp.inst_id = inst_id; - - ret = send_vsc_command(OCF_BCM_LE_MULTI_ADV, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [0x%02x]", rp.subcode, rp.status); - return FALSE; - } - - return TRUE; -} - -gboolean adapter_le_enable_scan_filtering (gboolean enable) -{ - int ret; - adapter_le_vsc_cp_enable_scan_filter cp; - apater_le_vsc_rp_enable_scan_filter rp; - - DBG(" enable[%d]", enable); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_META_PF_ENABLE; - cp.enable = enable; - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x]", rp.subcode, rp.status); - return FALSE; - } - - return TRUE; -} - -gboolean adapter_le_set_scan_filter_params(adapter_le_scan_filter_param_t *params) -{ - int ret; - adapter_le_vsc_cp_apcf_set_filter_params cp; - adapter_le_vsc_rp_apcf_set_scan_filter rp; - - DBG("filter_index [%d]", params->index); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_META_PF_FEAT_SEL; - cp.action = params->action; - cp.filter_index= params->index; - cp.feature= params->feature; - cp.feature_list_logic = params->filter_logic_type; - cp.filter_logic = params->filter_logic_type; - cp.rssi_high_threshold = params->rssi_high_threshold; - cp.rssi_low_thresh = params->rssi_low_threshold; - cp.delivery_mode = params->delivery_mode; - cp.onfound_timeout = params->onfound_timeout; - cp.onfound_timeout_cnt = params->onfound_timeout_cnt; - cp.onlost_timeout = params->onlost_timeout; - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x] Available space [%x]", - rp.subcode, rp.status, rp.available_space); - return FALSE; - } - - DBG("Scan Filter VSC :: sub[%x] - status [%x] Action [%x] Available space [%x]", - rp.subcode, rp.status, rp.action, rp.available_space); - return TRUE; -} - -gboolean adapter_le_service_address_scan_filtering(adapter_le_address_filter_params_t *params) -{ - int ret; - adapter_le_vsc_cp_address_scan_filter cp; - adapter_le_vsc_rp_apcf_set_scan_filter rp; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_META_PF_ADDR; - cp.action= params ->action; - cp.filter_index = params->filter_index; - - bacpy(&cp.bdaddr, ¶ms->broadcaster_addr); - cp.bdaddr_type = params->bdaddr_type; - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x]", rp.subcode, rp.status); - return FALSE; - } - - DBG("Scan Filter VSC :: sub[%x] - status [%x] Action [%x] Available space [%x]", - rp.subcode, rp.status, rp.action, rp.available_space); - - return TRUE; -} - -gboolean adapter_le_service_uuid_scan_filtering(gboolean is_solicited, - adapter_le_uuid_params_t *params) -{ - int ret; - adapter_le_vsc_cp_service_uuid_scan_filter cp; - adapter_le_vsc_rp_apcf_set_scan_filter rp; - uint8_t *p = cp.data; - int cp_len = UUID_SCAN_FILTER_HEADER_SIZE; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = (is_solicited) ? SUB_CMD_LE_META_PF_SOL_UUID : - SUB_CMD_LE_META_PF_UUID; - - cp.action= params ->action; - cp.filter_index = params->filter_index; - - memcpy(&cp.data, params->uuid, params->uuid_len); - cp_len += params->uuid_len; - - memcpy(p + params->uuid_len, params->uuid_mask, params->uuid_len); - cp_len += params->uuid_len; - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, cp_len, - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x]", rp.subcode, rp.status); - return FALSE; - } - - DBG("Scan Filter VSC :: sub[%x] - status [%x] Action [%x] Available space [%x]", - rp.subcode, rp.status, rp.action, rp.available_space); - - return TRUE; -} - -gboolean adapter_le_local_name_scan_filtering(adapter_le_local_name_params_t *params) -{ - int ret; - adapter_le_vsc_cp_local_name_scan_filter cp; - adapter_le_vsc_rp_apcf_set_scan_filter rp; - int cp_len = NAME_SCAN_FILTER_HEADER_SIZE; - int name_len; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_META_PF_LOCAL_NAME; - cp.action= params->action; - cp.filter_index = params->filter_index; - - name_len = params->name_len; - DBG("name [%s], len [%d]",params->local_name, name_len); - - if (name_len > SCAN_FILTER_DATA_MAX_LEN) - name_len = SCAN_FILTER_DATA_MAX_LEN; - - if (name_len > 0) { - memcpy(&cp.name, params->local_name, name_len); - cp_len += name_len; - } - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, cp_len, - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x]", rp.subcode, rp.status); - return FALSE; - } - - DBG("Scan Filter VSC :: sub[%x] - status [%x] Action [%x] Available space [%x]", - rp.subcode, rp.status, rp.action, rp.available_space); - - return TRUE; -} - -gboolean adapter_le_manf_data_scan_filtering (adapter_le_manf_data_params_t *params) -{ - int ret; - adapter_le_vsc_cp_manf_data_scan_filter cp; - adapter_le_vsc_rp_apcf_set_scan_filter rp; - uint8_t *p = cp.data; - int data_len = 0; - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_META_PF_MANU_DATA; - cp.action= params->action; - cp.filter_index = params->filter_index; - - /* add company_id and data */ - cp.data[data_len++] = (uint8_t) params->company_id; - cp.data[data_len++] = (uint8_t) (params->company_id >> 8); - DBG(""); - memcpy(p + data_len, params->man_data, params->man_data_len); - data_len += params->man_data_len; - - /* add company_id mask and data mask */ - cp.data[data_len++] = (uint8_t) params->company_id_mask; - cp.data[data_len++] = (uint8_t) (params->company_id_mask >> 8); - memcpy(p + data_len, params->man_data_mask, params->man_data_len); - data_len += params->man_data_len; - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, - MANF_DATA_SCAN_FILTER_HEADER_SIZE + data_len, - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x]", rp.subcode, rp.status); - return FALSE; - } - - DBG("Scan Filter VSC :: sub[%x] - status [%x] Action [%x] Available space [%x]", - rp.subcode, rp.status, rp.action, rp.available_space); - - return TRUE; -} - -gboolean adapter_le_service_data_scan_filtering (adapter_le_service_data_params_t *params) -{ - int ret; - adapter_le_vsc_cp_service_data_scan_filter cp; - adapter_le_vsc_rp_apcf_set_scan_filter rp; - uint8_t *p = cp.data; - int cp_len = SERVICE_DATA_SCAN_FILTER_HEADER_SIZE; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_META_PF_SRVC_DATA; - cp.action= params->action; - cp.filter_index = params->filter_index; - - memcpy(&cp.data, params->service_data, params->service_data_len); - cp_len += params->service_data_len; - - memcpy(p+params->service_data_len, params->service_data_mask, - params->service_data_len); - cp_len += params->service_data_len; - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, cp_len, - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x]", rp.subcode, rp.status); - return FALSE; - } - - DBG("Scan Filter VSC :: sub[%x] - status [%x] Action [%x] Available space [%x]", - rp.subcode, rp.status, rp.action, rp.available_space); - - return TRUE; -} - -gboolean adapter_le_set_scan_filter_data(int client_if, int action, - int filt_type, int filter_index, - int company_id, - int company_id_mask, - int uuid_len, uint8_t *p_uuid, - int uuid_mask_len, uint8_t *p_uuid_mask, - gchar *string, int addr_type, - int data_len, uint8_t *p_data, - int mask_len, uint8_t *p_mask) -{ - gboolean ret; - - DBG(""); - - switch (filt_type) { - case TYPE_DEVICE_ADDRESS: { - /* TYPE_DEVICE_ADDRESS */ - adapter_le_address_filter_params_t params; - bdaddr_t bd_addr; - - str2ba(string, &bd_addr); - - params.action = action; - params.filter_index = filter_index; - bacpy(¶ms.broadcaster_addr, &bd_addr); - params.bdaddr_type = addr_type; - - ret = adapter_le_service_address_scan_filtering(¶ms); - break; - } - - case TYPE_SERVICE_UUID: - case TYPE_SOLICIT_UUID: { - adapter_le_uuid_params_t params; - gboolean is_solicited = (filt_type == TYPE_SOLICIT_UUID) ? TRUE : FALSE; - - if (uuid_len != UUID_16_LEN && uuid_len != UUID_32_LEN - && uuid_len != UUID_128_LEN) { - DBG("UUID length error"); - return FALSE; - } - - if (uuid_len != uuid_mask_len) { - DBG("Both UUID and UUID_MASK length shoule be samed"); - return FALSE; - } - - params.action = action; - params.filter_index = filter_index; - params.uuid = p_uuid; - params.uuid_mask = p_uuid_mask; - params.uuid_len = uuid_len; - - ret = adapter_le_service_uuid_scan_filtering(is_solicited, ¶ms); - break; - } - - case TYPE_LOCAL_NAME: { - adapter_le_local_name_params_t params; - - params.action = action; - params.filter_index = filter_index; - params.local_name = string; - params.name_len = strlen(string); - ret = adapter_le_local_name_scan_filtering(¶ms); - break; - } - - case TYPE_MANUFACTURER_DATA: { - adapter_le_manf_data_params_t params; - - if (data_len == 0 || (data_len != mask_len)) { - DBG("parameter length error"); - return FALSE; - } - - params.action = action; - params.filter_index = filter_index; - params.company_id = company_id; - params.company_id_mask = company_id_mask; - params.man_data = p_data; - params.man_data_mask = p_mask; - params.man_data_len = data_len; - - ret = adapter_le_manf_data_scan_filtering(¶ms); - break; - } - - case TYPE_SERVICE_DATA: { - adapter_le_service_data_params_t params; - - if (data_len == 0 || (data_len != mask_len)) { - DBG("parameter length error"); - return FALSE; - } - - params.action = action; - params.filter_index = filter_index; - params.service_data = p_data; - params.service_data_mask = p_mask; - params.service_data_len = data_len; - - ret = adapter_le_service_data_scan_filtering(¶ms); - break; - } - - default: - DBG("filter_type error"); - ret = FALSE; - } - - return ret; -} - -gboolean adapter_le_clear_scan_filter_data(int client_if, int filter_index) -{ - int ret; - adapter_le_vsc_cp_service_data_scan_filter cp; - adapter_le_vsc_rp_apcf_set_scan_filter rp; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_META_PF_FEAT_SEL; - cp.action= 0x02; // (Add - 0x00, Delete - 0x01, Clear - 0x02) - cp.filter_index = filter_index; - - ret = send_vsc_command(OCF_BCM_LE_SCAN_FILTER, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [%x] Available space [%x]", - rp.subcode, rp.status, rp.available_space); - return FALSE; - } - - DBG("Scan Filter VSC :: sub[%x] - status [%x] Action [%x] Available space [%x]", - rp.subcode, rp.status, rp.action, rp.available_space); - return TRUE; -} - -gboolean adapter_le_enable_offloading(gboolean enable) -{ - int ret; - adapter_le_vsc_cp_enable_rpa_offload cp; - adapter_le_vsc_rp_enable_rpa_offload rp; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_ENABLE_OFFLOADING; - cp.enable = enable; - - ret = send_vsc_command(OCF_BCM_LE_RPA_OFFLOAD, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [0x%02x]", rp.subcode, rp.status); - return FALSE; - } - - return TRUE; -} - -gboolean adapter_le_add_irk_to_list(const uint8_t *le_irk, const bdaddr_t *bdaddr, uint8_t bdaddr_type) -{ - int ret; - adapter_le_vsc_cp_add_irk_to_list cp; - adapter_le_vsc_rp_irk_to_list rp; - - DBG("addr_type %d, irk %x %x %x...", bdaddr_type, le_irk[0], le_irk[1], le_irk[2]); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_ADD_IRK_TO_LIST; - memcpy(&cp.le_irk, le_irk, sizeof(cp.le_irk)); - bacpy(&cp.bdaddr, bdaddr); - - if (bdaddr_type == BDADDR_LE_PUBLIC) - cp.bdaddr_type = 0x0; - else - cp.bdaddr_type = 0x1; - - ret = send_vsc_command(OCF_BCM_LE_RPA_OFFLOAD, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [0x%02x]", rp.subcode, rp.status); - return FALSE; - } - - DBG("Add IRK to VCS :: available space[%d]", rp.available_space); - - return TRUE; -} - -gboolean adapter_le_remove_irk_to_list(const bdaddr_t *bdaddr, uint8_t bdaddr_type) -{ - int ret; - adapter_le_vsc_cp_remove_irk_to_list cp; - adapter_le_vsc_rp_irk_to_list rp; - - DBG(""); - - memset(&cp, 0, sizeof(cp)); - cp.subcode = SUB_CMD_LE_REMOVE_IRK_TO_LIST; - bacpy(&cp.bdaddr, bdaddr); - - if (bdaddr_type == BDADDR_LE_PUBLIC) - cp.bdaddr_type = 0x0; - else - cp.bdaddr_type = 0x1; - - ret = send_vsc_command(OCF_BCM_LE_RPA_OFFLOAD, (uint8_t *) &cp, sizeof(cp), - (uint8_t *) &rp, sizeof(rp)); - - if (ret < 0) - return FALSE; - - if (HCI_SUCCESS != rp.status) { - DBG("Fail to send VSC :: sub[%x] - status [0x%02x]", rp.subcode, rp.status); - return FALSE; - } - - DBG("Remove IRK to VCS :: available space[%d]", rp.available_space); - - return TRUE; -} - - -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ diff --git a/src/adapter_le_vsc_features.h b/src/adapter_le_vsc_features.h deleted file mode 100644 index 44a4bcc..0000000 --- a/src/adapter_le_vsc_features.h +++ /dev/null @@ -1,503 +0,0 @@ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - -typedef enum { - BLE_ADV_TX_POWER_MIN = 0x00, - BLE_ADV_TX_POWER_LOW = 0x01, - BLE_ADV_TX_POWER_MID = 0x02, - BLE_ADV_TX_POWER_UPPER = 0x03, - BLE_ADV_TX_POWER_MAX = 0x04, -} adapter_le_tx_power_t; - -typedef struct { - uint8_t inst_id; - uint8_t bdaddr_type; - bdaddr_t bdaddr; -} adapter_le_adv_inst_info_t; - -typedef struct { - uint16_t adv_int_min; /* minimum adv interval */ - uint16_t adv_int_max; /* maximum adv interval */ - uint8_t adv_type; /* adv event type (0x00 ~ 0x04) */ - uint8_t channel_map; /* adv channel map (all channel = 0x07) */ - uint8_t adv_filter_policy; /* advertising filter policy (0x00 ~ 0x04) */ - adapter_le_tx_power_t tx_power; /* adv tx power */ -} adapter_le_adv_param_t; - -typedef enum { - ADD, - DELETE, - CLEAR, -} adapter_le_scan_filter_action_type; - -typedef enum { - ADDR_LE_PUBLIC, - ADDR_LE_RANDOM, -} adapter_vsc_le_addr_type; - -typedef enum { - TYPE_DEVICE_ADDRESS = 0x01, - TYPE_SERVICE_DATA_CHANGED = 0x02, - TYPE_SERVICE_UUID = 0x04, - TYPE_SOLICIT_UUID = 0x08, - TYPE_LOCAL_NAME = 0x10, - TYPE_MANUFACTURER_DATA = 0x20, - TYPE_SERVICE_DATA = 0x40, -} adapter_le_scan_filter_type; - -#define BDADDR_BREDR 0x00 -#define BDADDR_LE_PUBLIC 0x01 - -#define BROADCAST_ADDR_FILTER 0x01 -#define SERVICE_DATA_CHANGE_FILTER 0x02 -#define SERVICE_UUID_CHECK 0x04 -#define SERVICE_SOLICITATION_UUID_CHECK 0x08 -#define LOCAL_NAME_CHECK 0x10 -#define MANUFACTURE_DATA_CHECK 0x20 -#define SERVICE_DATA_CHECK 0x40 - -typedef uint16_t adapter_le_scan_filter_feature_t; - -typedef enum { - OR, - AND, -} adapter_le_scan_filter_logic_type; - -typedef enum { - IMMEDIATE, - ON_FOUND, - BATCHED, -} adapter_le_scan_filter_delivery_mode; - -typedef enum { - UUID_16_LEN=2, - UUID_32_LEN=4, - UUID_128_LEN =16, -} adapter_le_uuid_len; - -typedef struct { - adapter_le_scan_filter_action_type action; - uint8_t index; - adapter_le_scan_filter_feature_t feature; - adapter_le_scan_filter_logic_type list_logic_type; - adapter_le_scan_filter_logic_type filter_logic_type; - uint8_t rssi_high_threshold; - adapter_le_scan_filter_delivery_mode delivery_mode; - uint16_t onfound_timeout; - uint8_t onfound_timeout_cnt; - uint8_t rssi_low_threshold; - uint16_t onlost_timeout; -}adapter_le_scan_filter_param_t; - -typedef struct { - adapter_le_scan_filter_action_type action; - uint8_t filter_index; - bdaddr_t broadcaster_addr; - adapter_vsc_le_addr_type bdaddr_type; -} adapter_le_address_filter_params_t; - -typedef struct { - adapter_le_scan_filter_action_type action; - uint8_t filter_index; - uint8_t *uuid; - uint8_t *uuid_mask; - adapter_le_uuid_len uuid_len; -}adapter_le_uuid_params_t; - -typedef struct { - adapter_le_scan_filter_action_type action; - uint8_t filter_index; - const char *local_name; - uint8_t name_len; -}adapter_le_local_name_params_t; - -typedef struct { - adapter_le_scan_filter_action_type action; - uint8_t filter_index; - uint16_t company_id; - uint16_t company_id_mask; - uint8_t *man_data; - uint8_t *man_data_mask; - uint8_t man_data_len; -}adapter_le_manf_data_params_t; - -typedef struct { - adapter_le_scan_filter_action_type action; - uint8_t filter_index; - uint8_t *service_data; - uint8_t *service_data_mask; - uint8_t service_data_len; -}adapter_le_service_data_params_t; - -/***************************************************************************** -** Defentions for HCI Error Codes that are past in the events -*/ -#define HCI_SUCCESS 0x00 - - - -/***************************************************************************** -** Vendor Specific Commands -** -*/ - -#define OCF_BCM_LE_GET_VENDOR_CAP 0x0153 /* LE Get Vendor Capabilities */ - -#define OCF_BCM_LE_MULTI_ADV 0x0154 /* Multi adv OCF */ - -/* subcode for multi adv feature */ -#define SUB_CMD_LE_MULTI_ADV_SET_PARAM 0x01 -#define SUB_CMD_LE_MULTI_ADV_WRITE_ADV_DATA 0x02 -#define SUB_CMD_LE_MULTI_ADV_WRITE_SCAN_RSP_DATA 0x03 -#define SUB_CMD_LE_MULTI_ADV_SET_RANDOM_ADDR 0x04 -#define SUB_CMD_LE_MULTI_ADV_ENB 0x05 - -/* APCF : Advertising Packet Content Filter feature */ -#define OCF_BCM_LE_SCAN_FILTER 0x0157 /* Advertising filter OCF */ - -/* Sub codes for APCF */ -#define SUB_CMD_LE_META_PF_ENABLE 0x00 -#define SUB_CMD_LE_META_PF_FEAT_SEL 0x01 -#define SUB_CMD_LE_META_PF_ADDR 0x02 -#define SUB_CMD_LE_META_PF_UUID 0x03 -#define SUB_CMD_LE_META_PF_SOL_UUID 0x04 -#define SUB_CMD_LE_META_PF_LOCAL_NAME 0x05 -#define SUB_CMD_LE_META_PF_MANU_DATA 0x06 -#define SUB_CMD_LE_META_PF_SRVC_DATA 0x07 -#define SUB_CMD_LE_META_PF_ALL 0x08 - -/* Offloaded resolution of private address */ -#define OCF_BCM_LE_RPA_OFFLOAD 0x0155 /* RPA Offload OCF */ - -/* subcode for rpa offloading feature */ -#define SUB_CMD_LE_ENABLE_OFFLOADING 0x01 -#define SUB_CMD_LE_ADD_IRK_TO_LIST 0x02 -#define SUB_CMD_LE_REMOVE_IRK_TO_LIST 0x03 -#define SUB_CMD_LE_CLEAR_IRK_TO_LIST 0x04 -#define SUB_CMD_LE_READ_IRK_TO_LIST 0x05 - -/***************************************************************************** -** CP & RP for OCF_BCM_LE_GET_VENDOR_CAP -** -*/ - -/** -* -* RP -* -* (1 octet) status : Command complete status -* (1 octet) adv_inst_max : Num of advertisement instances supported -* (1 octet) rpa_offloading: BT chip capability of RPA -* (value 0 not capable, value 1 capable) -* If supported by chip, it needs enablement by host -* (2 octet) tot_scan_results_strg : Storage for scan results in bytes -* (1 octet) max_irk_list_sz : Num of IRK entries supported in f/w -* (1 octet) filter_support : Support Filtering in controller. -* 0 = Not supported / 1 = supported -* (1 octet) max_filter : Number of filters supported -* (1 octet) energy_support : Supports reporting of activity and energy info -* 0 = not capable, 1 = capable -* (1 octet) onlost_follow : Number of advertisers that can be analysed -* for onlost per filter -*/ -typedef struct { - uint8_t status; - uint8_t adv_inst_max; - uint8_t rpa_offloading; - uint16_t tot_scan_results_strg; - uint8_t max_irk_list_sz; - uint8_t filter_support; - uint8_t max_filter; - uint8_t energy_support; - uint8_t onlost_follow; -} __attribute__ ((packed)) apater_le_vsc_rp_get_vendor_cap; - - - -/***************************************************************************** -** CP & RP for OCF_BCM_LE_MULTI_ADV -** -*/ - -/** -* -* CP for OCF_BCM_LE_MULTI_ADV & SUB_CMD_LE_MULTI_ADV_SET_PARAM -* -* (1 octet) subcode : SUB_CMD_LE_MULTI_ADV_SET_PARAM -* (2 octet) adv_int_min : per spec -* (2 octet) adv_int_max : per spec -* (1 octet) adv_type : per spec -* (1 octet) bdaddr_type : per spec -* (6 octet) bdaddr : per spec -* (1 octet) direct_bdaddr_type : per spec -* (6 octet) direct_bdaddr : per spec -* (1 octet) channel_map : per spec -* (1 octet) adv_filter_policy : per spec -* (1 octet) inst_id : Specifies the applicability of the above parameters to an instance -* (1 octet) tx_power : Transmit_Power Unit - in dBm (signed integer) Range (70 to +20) -*/ -typedef struct { - uint8_t subcode; - uint16_t adv_int_min; - uint16_t adv_int_max; - uint8_t adv_type; - uint8_t bdaddr_type; - bdaddr_t bdaddr; - uint8_t direct_bdaddr_type; - bdaddr_t direct_bdaddr; - uint8_t channel_map; - uint8_t adv_filter_policy; - uint8_t inst_id; - uint8_t tx_power; -} __attribute__ ((packed)) adapter_le_vsc_cp_set_multi_adv_params; - -/** -* -* CP for SUB_CMD_LE_MULTI_ADV_WRITE_ADV_DATA -* CP for SUB_CMD_LE_MULTI_ADV_WRITE_SCAN_RSP_DATA -* -* ( 1 octet) subcode : SUB_CMD_LE_MULTI_ADV_WRITE_ADV_DATA -* or SUB_CMD_LE_MULTI_ADV_WRITE_SCAN_RSP_DATA -* ( 1 octet) data_len : per spec -* (31 octet) data : per spec -* ( 1 octet) inst_id : Specifies the applicability of the above parameters to an instance. -*/ -typedef struct { - uint8_t subcode; - uint8_t data_len; - uint8_t data[31]; - uint8_t inst_id; -} __attribute__ ((packed)) adapter_le_vsc_cp_set_multi_adv_data; - -/** -* -* CP for SUB_CMD_LE_MULTI_ADV_ENB -* -* (1 octet) subcode : SUB_CMD_LE_MULTI_ADV_ENB -* (1 octet) enable : When set to 1, it means enable, otherwise disable. -* (1 octet) inst_id : Specifies the applicability of the above parameters -* to an instance. Instance 0 has special meaning this -* refers to std HCI instance. -*/ -typedef struct { - uint8_t subcode; - uint8_t enable; - uint8_t inst_id; -} __attribute__ ((packed)) adapter_le_vsc_cp_enable_multi_adv; - -/** -* -* RP -* -* (1 octet) status : Command complete status -* (1 octet) subcode : subcode of OCF_BCM_LE_MULTI_ADV -*/ -typedef struct { - uint8_t status; - uint8_t subcode; -} __attribute__ ((packed)) apater_le_vsc_rp_multi_adv; - - - -/***************************************************************************** -** CP & RP for OCF_BCM_LE_SCAN_FILTER -** -*/ - - -/* CP for SUB_CMD_LE_META_PF_ENABLE */ -typedef struct { - uint8_t subcode; - uint8_t enable; -} __attribute__ ((packed)) adapter_le_vsc_cp_enable_scan_filter; - -/* RP for SUB_CMD_LE_META_PF_ENABLE */ -typedef struct { - uint8_t status; - uint8_t subcode; - uint8_t enable; -} __attribute__ ((packed)) apater_le_vsc_rp_enable_scan_filter; - -/* CP for SUB_CMD_LE_META_PF_FEAT_SEL */ -typedef struct { - uint8_t subcode; - uint8_t action; - uint8_t filter_index; - uint16_t feature; - uint16_t feature_list_logic; - uint8_t filter_logic; - int8_t rssi_high_threshold; - uint8_t delivery_mode; - uint16_t onfound_timeout; - uint8_t onfound_timeout_cnt; - uint8_t rssi_low_thresh; - uint16_t onlost_timeout; -} __attribute__ ((packed)) adapter_le_vsc_cp_apcf_set_filter_params; - -/* CP for SUB_CMD_LE_META_PF_ADDR */ -typedef struct { - uint8_t subcode; - uint8_t action; - uint8_t filter_index; - bdaddr_t bdaddr; - uint8_t bdaddr_type; -} __attribute__ ((packed))adapter_le_vsc_cp_address_scan_filter; - -/* CP for SUB_CMD_LE_META_PF_UUID & SUB_CMD_LE_META_PF_SOL_UUID */ -typedef struct { - uint8_t subcode; - uint8_t action; - uint8_t filter_index; - uint8_t data[40]; /* UUID + UUID_MASK */ -} __attribute__ ((packed))adapter_le_vsc_cp_service_uuid_scan_filter; -#define UUID_SCAN_FILTER_HEADER_SIZE 3 - -#define SCAN_FILTER_DATA_MAX_LEN 29 - -/* CP for SUB_CMD_LE_META_PF_LOCAL_NAME*/ -typedef struct { - uint8_t subcode; - uint8_t action; - uint8_t filter_index; - uint8_t name[SCAN_FILTER_DATA_MAX_LEN]; -} __attribute__ ((packed)) adapter_le_vsc_cp_local_name_scan_filter; -#define NAME_SCAN_FILTER_HEADER_SIZE 3 - -/* CP for SUB_CMD_LE_META_PF_MANU_DATA*/ -typedef struct { - uint8_t subcode; - uint8_t action; - uint8_t filter_index; - uint8_t data[SCAN_FILTER_DATA_MAX_LEN * 2]; /* data + mask filed */ -} __attribute__ ((packed)) adapter_le_vsc_cp_manf_data_scan_filter; -#define MANF_DATA_SCAN_FILTER_HEADER_SIZE 3 - -/* CP for SUB_CMD_LE_META_PF_SRVC_DATA*/ -typedef struct { - uint8_t subcode; - uint8_t action; - uint8_t filter_index; - uint8_t data[SCAN_FILTER_DATA_MAX_LEN * 2]; /* data + mask filed */ -} __attribute__ ((packed)) adapter_le_vsc_cp_service_data_scan_filter; -#define SERVICE_DATA_SCAN_FILTER_HEADER_SIZE 3 - -/* RP for SUB_CMD_LE_META_PF_ADDR & SUB_CMD_LE_META_PF_FEAT_SEL & - SUB_CMD_LE_META_PF_UUID & SUB_CMD_LE_META_PF_SOL_UUID & - SUB_CMD_LE_META_PF_LOCAL_NAME & SUB_CMD_LE_META_PF_MANU_DATA & - SUB_CMD_LE_META_PF_SRVC_DATA */ -typedef struct { - uint8_t status; - uint8_t subcode; - uint8_t action; - uint8_t available_space; -} __attribute__ ((packed)) adapter_le_vsc_rp_apcf_set_scan_filter; - - -/***************************************************************************** -** CP & RP for OCF_BCM_LE_RPA_OFFLOAD -** -*/ - -/** -* -* CP for SUB_CMD_ENABLE_RPA_OFFLOAD -* -* (1 octet) subcode : SUB_CMD_ENABLE_RPA_OFFLOAD (0x01) -* (2 octet) enable : When set to 1, it means enable, otherwise disable. -*/ -typedef struct { - uint8_t subcode; - uint8_t enable; -} __attribute__ ((packed)) adapter_le_vsc_cp_enable_rpa_offload; - -/* RP for SUB_CMD_ENABLE_RPA_OFFLOAD */ -typedef struct { - uint8_t status; - uint8_t subcode; -} __attribute__ ((packed)) adapter_le_vsc_rp_enable_rpa_offload; - -/** -* -* CP for SUB_CMD_ADD_IRK_TO_LIST -* -* (1 octet) subcode : SUB_CMD_ADD_IRK_TO_LIST (0x02) -* (16 octet) le_irk : LE IRK (1st byte LSB) -* (1 octet) bdaddr_type : per spec -* (6 octet) bdaddr : per spec -*/ -typedef struct { - uint8_t subcode; - uint8_t le_irk[16]; - uint8_t bdaddr_type; - bdaddr_t bdaddr; -} __attribute__ ((packed)) adapter_le_vsc_cp_add_irk_to_list; - -/** -* -* CP for SUB_CMD_REMOVE_IRK_TO_LIST -* -* (1 octet) subcode : SUB_CMD_REMOVE_IRK_TO_LIST (0x03) -* (16 octet) le_irk : LE IRK (1st byte LSB) -* (1 octet) bdaddr_type : per spec -* (6 octet) bdaddr : per spec -*/ -typedef struct { - uint8_t subcode; - uint8_t bdaddr_type; - bdaddr_t bdaddr; -} __attribute__ ((packed)) adapter_le_vsc_cp_remove_irk_to_list; - -/* RP for SUB_CMD_ADD_IRK_TO_LIST & SUB_CMD_REMOVE_IRK_TO_LIST */ -typedef struct { - uint8_t status; - uint8_t subcode; - uint8_t available_space; -} __attribute__ ((packed)) adapter_le_vsc_rp_irk_to_list; - - -/***************************************************************************** -** Functions -** -*/ - -/* Read supported BLE feature info from chipset */ -gboolean adapter_le_read_ble_feature_info(void); - -gboolean adapter_le_is_supported_multi_advertising(void); - -gboolean adapter_le_is_supported_offloading(void); - -int adapter_le_get_max_adv_instance(void); - -int adapter_le_get_scan_filter_size(void); - -gboolean adapter_le_set_multi_adv_params (adapter_le_adv_inst_info_t *p_inst, - adapter_le_adv_param_t *p_params); - -gboolean adapter_le_set_multi_adv_data(uint8_t inst_id, gboolean is_scan_rsp, - uint8_t data_len, uint8_t *p_data); - -gboolean adapter_le_enable_multi_adv (struct btd_adapter *adapter, - gboolean enable, uint8_t inst_id); - -gboolean adapter_le_enable_scan_filtering (gboolean enable); - -gboolean adapter_le_set_scan_filter_params(adapter_le_scan_filter_param_t *params); - -gboolean adapter_le_set_scan_filter_data(int client_if, int action, - int filt_type, int filter_index, - int company_id, - int company_id_mask, - int uuid_len, uint8_t *p_uuid, - int uuid_mask_len, uint8_t *p_uuid_mask, - gchar *string, int addr_type, - int data_len, uint8_t *p_data, - int mask_len, uint8_t *p_mask); -gboolean adapter_le_clear_scan_filter_data(int client_if, int filter_index); - -gboolean adapter_le_enable_offloading(gboolean enable); - -gboolean adapter_le_add_irk_to_list(const uint8_t *le_irk, const bdaddr_t *bdaddr, uint8_t bdaddr_type); - -gboolean adapter_le_remove_irk_to_list(const bdaddr_t *bdaddr, uint8_t bdaddr_type); - -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ diff --git a/src/advertising.c b/src/advertising.c old mode 100644 new mode 100755 index 59c8c3d..e5cd31c --- a/src/advertising.c +++ b/src/advertising.c @@ -288,7 +288,7 @@ static bool parse_advertising_manufacturer_data(GDBusProxy *proxy, while (dbus_message_iter_get_arg_type(&entries) == DBUS_TYPE_DICT_ENTRY) { - DBusMessageIter value, entry; + DBusMessageIter value, entry, array; uint16_t manuf_id; uint8_t *manuf_data; int len; @@ -297,15 +297,17 @@ static bool parse_advertising_manufacturer_data(GDBusProxy *proxy, dbus_message_iter_get_basic(&entry, &manuf_id); dbus_message_iter_next(&entry); - if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_ARRAY) + dbus_message_iter_recurse(&entry, &value); + + if (dbus_message_iter_get_arg_type(&value) != DBUS_TYPE_ARRAY) goto fail; - dbus_message_iter_recurse(&entry, &value); + dbus_message_iter_recurse(&value, &array); - if (dbus_message_iter_get_arg_type(&value) != DBUS_TYPE_BYTE) + if (dbus_message_iter_get_arg_type(&array) != DBUS_TYPE_BYTE) goto fail; - dbus_message_iter_get_fixed_array(&value, &manuf_data, &len); + dbus_message_iter_get_fixed_array(&array, &manuf_data, &len); DBG("Adding ManufacturerData for %04x", manuf_id); @@ -340,7 +342,7 @@ static bool parse_advertising_service_data(GDBusProxy *proxy, while (dbus_message_iter_get_arg_type(&entries) == DBUS_TYPE_DICT_ENTRY) { - DBusMessageIter value, entry; + DBusMessageIter value, entry, array; const char *uuid_str; bt_uuid_t uuid; uint8_t *service_data; @@ -353,15 +355,17 @@ static bool parse_advertising_service_data(GDBusProxy *proxy, goto fail; dbus_message_iter_next(&entry); - if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_ARRAY) + dbus_message_iter_recurse(&entry, &value); + + if (dbus_message_iter_get_arg_type(&value) != DBUS_TYPE_ARRAY) goto fail; - dbus_message_iter_recurse(&entry, &value); + dbus_message_iter_recurse(&value, &array); - if (dbus_message_iter_get_arg_type(&value) != DBUS_TYPE_BYTE) + if (dbus_message_iter_get_arg_type(&array) != DBUS_TYPE_BYTE) goto fail; - dbus_message_iter_get_fixed_array(&value, &service_data, &len); + dbus_message_iter_get_fixed_array(&array, &service_data, &len); DBG("Adding ServiceData for %s", uuid_str); @@ -500,7 +504,7 @@ static DBusMessage *refresh_advertisement(struct advertisement *ad) return btd_error_failed(ad->reg, "Failed"); } - cp->flags = flags; + cp->flags = htobl(flags); cp->instance = ad->instance; cp->adv_data_len = adv_data_len; memcpy(cp->data, adv_data, adv_data_len); diff --git a/src/advertising.h b/src/advertising.h old mode 100644 new mode 100755 diff --git a/src/agent.c b/src/agent.c old mode 100644 new mode 100755 diff --git a/src/agent.h b/src/agent.h old mode 100644 new mode 100755 diff --git a/src/attio.h b/src/attio.h deleted file mode 100644 index 16e2873..0000000 --- a/src/attio.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 Nokia Corporation - * Copyright (C) 2011 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -typedef void (*attio_connect_cb) (GAttrib *attrib, gpointer user_data); -typedef void (*attio_disconnect_cb) (gpointer user_data); - -guint btd_device_add_attio_callback(struct btd_device *device, - attio_connect_cb cfunc, - attio_disconnect_cb dcfunc, - gpointer user_data); - -gboolean btd_device_remove_attio_callback(struct btd_device *device, guint id); diff --git a/src/attrib-server.c b/src/attrib-server.c old mode 100644 new mode 100755 index 03b585a..4439c27 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -255,37 +255,6 @@ static int attribute_cmp(gconstpointer a1, gconstpointer a2) return attrib1->handle - attrib2->handle; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int attribute_uuid_cmp(gconstpointer a, gconstpointer b) -{ - const struct attribute *attrib1 = a; - const bt_uuid_t *uuid = b; - - return bt_uuid_cmp(&attrib1->uuid, uuid); -} - -struct attribute *attribute_find(struct btd_adapter *adapter, const bt_uuid_t *uuid) -{ - GSList *l; - GList *ldata; - struct gatt_server *server; - - /* Find the attrib server database for the given adapter */ - l = g_slist_find_custom(servers, adapter, adapter_cmp); - if (!l) - return NULL; - - server = l->data; - - ldata = g_list_find_custom(server->database, GUINT_TO_POINTER(uuid), - attribute_uuid_cmp); - if (!ldata) - return NULL; - - return ldata->data; -} -#endif - static struct attribute *find_svc_range(struct gatt_server *server, uint16_t start, uint16_t *end) { @@ -337,10 +306,6 @@ static uint32_t attrib_create_sdp_new(struct gatt_server *server, if (a->len == 2) sdp_uuid16_create(&svc, get_le16(a->data)); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (a->len == 4) - sdp_uuid32_create(&svc, get_le32(a->data)); -#endif else if (a->len == 16) { uint8_t be128[16]; @@ -355,20 +320,14 @@ static uint32_t attrib_create_sdp_new(struct gatt_server *server, return 0; if (name != NULL) -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - sdp_set_info_attr(record, name, "Samsung", NULL); -#else sdp_set_info_attr(record, name, "BlueZ", NULL); -#endif sdp_uuid16_create(&gap_uuid, GENERIC_ACCESS_PROFILE_ID); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (sdp_uuid_cmp(&svc, &gap_uuid) == 0) { sdp_set_url_attr(record, "http://www.bluez.org/", "http://www.bluez.org/", "http://www.bluez.org/"); } -#endif if (adapter_service_add(server->adapter, record) == 0) return record->handle; @@ -539,10 +498,6 @@ static uint16_t read_by_group(struct gatt_channel *channel, uint16_t start, if (dl == NULL) cur->end = a->handle; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (a->handle == end && end == 0xffff) - cur->end = a->handle; -#endif else cur->end = last_handle; @@ -981,35 +936,6 @@ static uint16_t write_value(struct gatt_channel *channel, uint16_t handle, g_file_set_contents(filename, data, length, NULL); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_free(filename); - filename = btd_device_get_storage_path(channel->device, "ccc_sc"); - if (!filename) { - warn("Unable to get ccc storage path for device"); - g_free(data); - return enc_error_resp(ATT_OP_WRITE_REQ, handle, - ATT_ECODE_WRITE_NOT_PERM, - pdu, len); - } - - g_key_file_free(key_file); - key_file = g_key_file_new(); - g_key_file_load_from_file(key_file, filename, 0, NULL); - - memset(&group, 0x00, 6); - memset(&value, 0x00, 5); - sprintf(group, "%hu", handle); - sprintf(value, "%hX", cccval); - g_key_file_set_string(key_file, group, "Value", value); - - g_free(data); - data = g_key_file_to_data(key_file, &length, NULL); - if (length > 0) { - create_file(filename, S_IRUSR | S_IWUSR); - g_file_set_contents(filename, data, length, NULL); - } -#endif - g_free(data); g_free(filename); g_key_file_free(key_file); @@ -1140,12 +1066,6 @@ static void channel_handler(const uint8_t *ipdu, uint16_t len, } length = find_info(channel, start, end, opdu, channel->mtu); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (length == 0 && start == end) { - status = ATT_ECODE_ATTR_NOT_FOUND; - goto done; - } -#endif break; case ATT_OP_WRITE_REQ: length = dec_write_req(ipdu, len, &start, value, &vlen); @@ -1287,6 +1207,7 @@ guint attrib_channel_attach(GAttrib *attrib) channel->cleanup_id = g_io_add_watch(io, G_IO_HUP, channel_watch_cb, channel); + channel->device = btd_device_ref(device); server->clients = g_slist_append(server->clients, channel); @@ -1368,9 +1289,6 @@ static gboolean register_core_services(struct gatt_server *server) uint8_t atval[256]; bt_uuid_t uuid; uint16_t appearance = 0x0000; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint16_t service_changed_handle; -#endif /* GAP service: primary service definition */ bt_uuid16_create(&uuid, GATT_PRIM_SVC_UUID); @@ -1419,29 +1337,6 @@ static gboolean register_core_services(struct gatt_server *server) attrib_db_add_new(server, 0x0010, &uuid, ATT_NONE, ATT_NOT_PERMITTED, atval, 2); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* GATT service: service changed characteristic */ - service_changed_handle = 0x0012; - bt_uuid16_create(&uuid, GATT_CHARAC_UUID); - - atval[0] = GATT_CHR_PROP_INDICATE; - put_le16(service_changed_handle, &atval[1]); - put_le16(GATT_CHARAC_SERVICE_CHANGED, &atval[3]); - - attrib_db_add_new(server, 0x0011, &uuid, ATT_NONE, ATT_NOT_PERMITTED, - atval, 5); - - /* GATT service: service changed attribute */ - bt_uuid16_create(&uuid, GATT_CHARAC_SERVICE_CHANGED); - attrib_db_add_new(server, service_changed_handle, &uuid, ATT_NOT_PERMITTED, - ATT_NOT_PERMITTED, NULL, 0); - - bt_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID); - atval[0] = GATT_CHR_PROP_READ | GATT_CHR_PROP_WRITE; - atval[1] = 0; - attrib_db_add_new(server, 0x0013, &uuid, ATT_NONE, ATT_NONE, atval, 2); -#endif - server->gatt_sdp_handle = attrib_create_sdp_new(server, 0x0010, "Generic Attribute Profile"); if (server->gatt_sdp_handle == 0) { @@ -1728,97 +1623,6 @@ int attrib_db_del(struct btd_adapter *adapter, uint16_t handle) return 0; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -uint16_t send_sc_indication(uint16_t start_handle, uint16_t end_handle, size_t vlen, - uint8_t *pdu, size_t len) -{ - const uint16_t min_len = sizeof(pdu[0]) + sizeof(uint16_t); - - if (pdu == NULL) - return 0; - - if (len < (vlen + min_len)) - return 0; - - pdu[0] = ATT_OP_HANDLE_IND; -/* API replaced by put_le16 in bluez 5.25 - att_put_u16(start_handle, &pdu[1]); - att_put_u16(end_handle, &pdu[3]);*/ - put_le16(start_handle, &pdu[1]); - put_le16(end_handle, &pdu[3]); - - return vlen + min_len; -} - -static uint8_t attrib_get_ccc_info(struct btd_device *device, uint16_t handle) -{ - uint16_t cccval = 0; - char *filename; - GKeyFile *key_file; - char group[6]; - char *value; - - filename = btd_device_get_storage_path(device, "ccc"); - if (!filename) { - warn("Unable to get ccc storage path for device"); - return 0; - } - - key_file = g_key_file_new(); - g_key_file_load_from_file(key_file, filename, 0, NULL); - sprintf(group, "%hu", handle); - - /* Get the CCC value */ - value = g_key_file_get_string(key_file, group, "Value", NULL); - if (!value) - return 0; - - sscanf(value, "%hX", &cccval); - - g_free(value); - g_free(filename); - g_key_file_free(key_file); - - return cccval; -} - -void attrib_send_sc_ind(struct btd_device *device, GAttrib *attrib, - uint16_t start_handle, uint16_t end_handle, - size_t vlen) -{ - size_t length = 0; - uint8_t *pdu; - size_t mtu; - - pdu = g_attrib_get_buffer(attrib, &mtu); - length = send_sc_indication(start_handle, end_handle, vlen, pdu, mtu); - g_attrib_send(attrib, 0, pdu, length, NULL, NULL, NULL); -} - -void attrib_send_noty_ind(struct btd_device *device, GAttrib *attrib, - uint16_t handle, uint16_t desc_handle, - uint8_t *value, size_t vlen) -{ - size_t length = 0; - uint16_t cccval; - uint8_t *pdu; - size_t mtu; - - cccval = attrib_get_ccc_info(device, desc_handle); - if (!cccval) - return; - - pdu = g_attrib_get_buffer(attrib, &mtu); - if (cccval == GATT_CLIENT_CHARAC_CFG_NOTIF_BIT) { - length = enc_notification(handle, value, vlen, pdu, mtu); - g_attrib_send(attrib, 0, pdu, length, NULL, NULL, NULL); - } else if (cccval == GATT_CLIENT_CHARAC_CFG_IND_BIT) { - length = enc_indication(handle, value, vlen, pdu, mtu); - g_attrib_send(attrib, 0, pdu, length, NULL, NULL, NULL); - } -} -#endif - int attrib_gap_set(struct btd_adapter *adapter, uint16_t uuid, const uint8_t *value, size_t len) { diff --git a/src/attrib-server.h b/src/attrib-server.h old mode 100644 new mode 100755 index 2a951e4..063cb66 --- a/src/attrib-server.h +++ b/src/attrib-server.h @@ -40,15 +40,3 @@ void attrib_free_sdp(struct btd_adapter *adapter, uint32_t sdp_handle); GAttrib *attrib_from_device(struct btd_device *device); guint attrib_channel_attach(GAttrib *attrib); gboolean attrib_channel_detach(GAttrib *attrib, guint id); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct attribute *attribute_find(struct btd_adapter *adapter, const bt_uuid_t *uuid); -void attrib_send_noty_ind(struct btd_device *device, GAttrib *attrib, - uint16_t handle, uint16_t desc_handle, - uint8_t *value, size_t vlen); -uint16_t send_sc_indication(uint16_t handle, uint16_t end_handle, size_t vlen, - uint8_t *pdu, size_t len); - -void attrib_send_sc_ind(struct btd_device *device, GAttrib *attrib, - uint16_t start_handle, uint16_t end_handle, - size_t vlen); -#endif diff --git a/src/backtrace.c b/src/backtrace.c old mode 100644 new mode 100755 diff --git a/src/backtrace.h b/src/backtrace.h old mode 100644 new mode 100755 diff --git a/src/bluetooth.conf b/src/bluetooth.conf old mode 100644 new mode 100755 index 2add5d7..10d2d36 --- a/src/bluetooth.conf +++ b/src/bluetooth.conf @@ -10,40 +10,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -56,91 +28,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/bluetooth.service.in b/src/bluetooth.service.in old mode 100644 new mode 100755 index e00095d..f799f65 --- a/src/bluetooth.service.in +++ b/src/bluetooth.service.in @@ -1,15 +1,20 @@ [Unit] Description=Bluetooth service Documentation=man:bluetoothd(8) +ConditionPathIsDirectory=/sys/class/bluetooth [Service] Type=dbus BusName=org.bluez -ExecStart=/usr/libexec/bluetooth/bluetoothd -d -C +ExecStart=@libexecdir@/bluetoothd NotifyAccess=main +#WatchdogSec=10 +#Restart=on-failure CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE LimitNPROC=1 +ProtectHome=true +ProtectSystem=full [Install] -WantedBy=multi-user.target +WantedBy=bluetooth.target Alias=dbus-org.bluez.service diff --git a/src/bluetooth.ver b/src/bluetooth.ver old mode 100644 new mode 100755 diff --git a/src/bluetoothd.8.in b/src/bluetoothd.8.in old mode 100644 new mode 100755 diff --git a/src/dbus-common.c b/src/dbus-common.c old mode 100644 new mode 100755 diff --git a/src/dbus-common.h b/src/dbus-common.h old mode 100644 new mode 100755 diff --git a/src/device.c b/src/device.c old mode 100644 new mode 100755 index 430f165..99454a7 --- a/src/device.c +++ b/src/device.c @@ -60,7 +60,6 @@ #include "adapter.h" #include "gatt-database.h" #include "attrib/gattrib.h" -#include "attio.h" #include "device.h" #include "gatt-client.h" #include "profile.h" @@ -75,19 +74,12 @@ #include "storage.h" #include "attrib-server.h" #include "eir.h" -#include "../profile.h" - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "sdp-xml.h" -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH -#include -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif #define IO_CAPABILITY_NOINPUTNOOUTPUT 0x03 #define DISCONNECT_TIMER 2 #define DISCOVERY_TIMER 1 +#define INVALID_FLAGS 0xff #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -100,10 +92,6 @@ #define GATT_INCLUDE_UUID_STR "2802" #define GATT_CHARAC_UUID_STR "2803" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define DEV_MAX_MANUFACTURER_DATA_LEN 248 -#endif - static DBusConnection *dbus_conn = NULL; static unsigned service_state_cb_id; @@ -139,6 +127,7 @@ struct authentication_req { auth_type_t type; struct agent *agent; struct btd_device *device; + uint8_t addr_type; uint32_t passkey; char *pincode; gboolean secure; @@ -162,13 +151,6 @@ struct included_search { GSList *current; }; -struct attio_data { - guint id; - attio_connect_cb cfunc; - attio_disconnect_cb dcfunc; - gpointer user_data; -}; - struct svc_callback { unsigned int id; guint idle_id; @@ -177,23 +159,6 @@ struct svc_callback { void *user_data; }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct le_adv_report_info { - uint8_t flags; - char manufacturer_data[DEV_MAX_MANUFACTURER_DATA_LEN]; - uint8_t manufacturer_data_len; -}; -#endif - -typedef void (*attio_error_cb) (const GError *gerr, gpointer user_data); -typedef void (*attio_success_cb) (gpointer user_data); - -struct att_callbacks { - attio_error_cb err; /* Callback for error */ - attio_success_cb success; /* Callback for success */ - gpointer user_data; -}; - /* Per-bearer (LE or BR/EDR) device state */ struct bearer_state { bool paired; @@ -207,33 +172,6 @@ struct csrk_info { uint32_t counter; }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef enum { - DEV_PAIRED_NONE = 0, - DEV_PAIRED_BREDR = 1, - DEV_PAIRED_LE, - DEV_PAIRED_BREDR_LE, -} dev_paired_state; - -typedef enum { - DEV_CONNECTED_NONE = 0, - DEV_CONNECTED_BREDR = 1, - DEV_CONNECTED_LE, - DEV_CONNECTED_BREDR_LE, -} dev_connected_state; - -struct trusted_profile_t { - uint32_t pbap:2; - uint32_t map:2; - uint32_t sap:2; -} __packed; - -struct restricted_profile_t { - uint32_t hfp_hs; - uint32_t a2dp; -}; -#endif - struct btd_device { int ref_count; @@ -247,6 +185,7 @@ struct btd_device { GSList *svc_callbacks; GSList *eir_uuids; struct bt_ad *ad; + uint8_t ad_flags[1]; char name[MAX_NAME_LENGTH + 1]; char *alias; uint32_t class; @@ -272,8 +211,6 @@ struct btd_device { DBusMessage *connect; /* connect message */ DBusMessage *disconnect; /* disconnect message */ GAttrib *attrib; - GSList *attios; - GSList *attios_offline; struct bt_att *att; /* The new ATT transport */ uint16_t att_mtu; /* The ATT MTU */ @@ -285,7 +222,6 @@ struct btd_device { * attribute cache support can be built. */ struct gatt_db *db; /* GATT db cache */ - bool gatt_cache_used; /* true if discovery skipped */ struct bt_gatt_client *client; /* GATT client instance */ struct bt_gatt_server *server; /* GATT server instance */ @@ -303,10 +239,6 @@ struct btd_device { time_t le_seen; gboolean trusted; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct trusted_profile_t trusted_profiles; - struct restricted_profile_t restricted_profiles; -#endif gboolean blocked; gboolean auto_connect; gboolean disable_auto_connect; @@ -318,30 +250,6 @@ struct btd_device { GIOChannel *att_io; guint store_id; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bool legacy_pairing; - char *manufacturer_data; - int manufacturer_data_len; - struct le_adv_report_info le_adv_data; - int remote_feature_flags; - guint attio_id; - gboolean gatt_connected; - uint16_t auth_payload_timeout; - uint8_t disc_reason; - uint8_t last_bdaddr_type; - uint8_t auth_bdaddr_type; - gboolean ipsp_connected; /* IPSP Connection state */ - char if_name[16 + 1]; /* BT interface UP after IPSP connection */ - uint8_t rpa_res_support; /* RPA Resolution capability of device */ - uint16_t max_tx_octets; - uint16_t max_tx_time; - uint16_t max_rx_octets; - uint16_t max_rx_time; - bdaddr_t *rpa; - DBusMessage *req_att_mtu; /* Attribute MTU request message */ - uint8_t irk_val[16]; - bool pending_conn_update; -#endif }; static const uint16_t uuid_list[] = { @@ -351,29 +259,6 @@ static const uint16_t uuid_list[] = { 0 }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef enum { - SHOW_AUTHORIZATION = 0x0, /* 0b00 */ - SUPPORTED_BLOCKED = 0x1, /* 0b01 */ - SUPPORTED_TRUSTED= 0x2, /* 0b10 */ -} bt_profile_trusted_states; - -#define PBAP_SHIFT_OFFSET 0 -#define MAP_SHIFT_OFFSET 2 -#define SAP_SHIFT_OFFSET 4 - -#define PROFILE_SUPPORTED 0x3 /* This corresponds to binary 0b11*/ - -typedef enum { - CONNECTION_PERMITTED = 0x0, /* 0b00 */ - CONNECTION_RESTRICTED = 0x1, /* 0b01 */ -} bt_profile_restricted_states; - -#define HFP_HS_SHIFT_OFFSET 0 -#define A2DP_SHIFT_OFFSET 2 - -#endif - static int device_browse_gatt(struct btd_device *device, DBusMessage *msg); static int device_browse_sdp(struct btd_device *device, DBusMessage *msg); @@ -468,42 +353,6 @@ static void store_csrk(struct csrk_info *csrk, GKeyFile *key_file, g_key_file_set_integer(key_file, group, "Counter", csrk->counter); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static char *manufacturer_data2str(char *data, int size) -{ - char str[DEV_MAX_MANUFACTURER_DATA_LEN * 3 + 1]; - char tmp[5]; - int i; - - str[0] = '\0'; - for(i = 0; i < size; i++) { - snprintf(tmp, sizeof(tmp), "%d ", data[i]); - g_strlcat(str, tmp, sizeof(str)); - } - - return g_strdup(str); -} - -static void load_manufacturer_data_2digit(char *data, int len, char *buf) -{ - int i; - char **split; - - split = g_strsplit(data, " ", 0); - - for (i = 0; i < len; i++) { - if (split[i] == NULL) - break; - - buf[i] = (char)g_ascii_strtoull(split[i], NULL, 10); - } - - g_strfreev(split); - - return; -} -#endif - static gboolean store_device_info_cb(gpointer user_data) { struct btd_device *device = user_data; @@ -515,19 +364,11 @@ static gboolean store_device_info_cb(gpointer user_data) char class[9]; char **uuids = NULL; gsize length = 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gboolean svc_change_regd = false; -#endif device->store_id = 0; ba2str(btd_adapter_get_address(device->adapter), adapter_addr); ba2str(&device->bdaddr, device_addr); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->rpa) - ba2str(device->rpa, device_addr); -#endif snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", adapter_addr, device_addr); @@ -556,36 +397,11 @@ static gboolean store_device_info_cb(gpointer user_data) g_key_file_remove_key(key_file, "General", "Appearance", NULL); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->rpa_res_support) { - g_key_file_set_integer(key_file, "General", "RPAResSupport", - device->rpa_res_support); - } else { - g_key_file_remove_key(key_file, "General", "RPAResSupport", NULL); - } -#endif - update_technologies(key_file, device); g_key_file_set_boolean(key_file, "General", "Trusted", device->trusted); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct trusted_profile_t trust_profile = device->trusted_profiles; - int trusted_profiles = (trust_profile.pbap << PBAP_SHIFT_OFFSET) | - (trust_profile.map << MAP_SHIFT_OFFSET) | - (trust_profile.sap << SAP_SHIFT_OFFSET); - DBG("Storing TrustedProfiles %d", trusted_profiles); - g_key_file_set_integer(key_file, "General", "TrustedProfiles", - trusted_profiles); - - struct restricted_profile_t restrict_profile = device->restricted_profiles; - int restricted_profiles = (restrict_profile.hfp_hs << HFP_HS_SHIFT_OFFSET) | - (restrict_profile.a2dp << A2DP_SHIFT_OFFSET); - DBG("Storing RestrictedProfiles %d", restricted_profiles); - g_key_file_set_integer(key_file, "General", "RestrictedProfiles", - restricted_profiles); -#endif g_key_file_set_boolean(key_file, "General", "Blocked", device->blocked); @@ -602,43 +418,6 @@ static gboolean store_device_info_cb(gpointer user_data) g_key_file_remove_key(key_file, "General", "Services", NULL); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->le_adv_data.flags) { - g_key_file_set_integer(key_file, "General", "Flags", - device->le_adv_data.flags); - } else { - g_key_file_remove_key(key_file, "General", "Flags", NULL); - } - - if (device->manufacturer_data) { - str = manufacturer_data2str(device->manufacturer_data, - device->manufacturer_data_len); - g_key_file_set_string(key_file, "General", - "ManufacturerData", - str); - g_free(str); - g_key_file_set_integer(key_file, "General", - "ManufacturerDataLen", - device->manufacturer_data_len); - } else { - g_key_file_remove_key(key_file, "General", - "ManufacturerData", NULL); - g_key_file_remove_key(key_file, "General", - "ManufacturerDataLen", NULL); - } - - if (device->rpa) { - char irk_addr[18]; - - ba2str(&device->bdaddr, irk_addr); - g_key_file_set_string(key_file, "General", "IdentityAddress", - irk_addr); - } else { - g_key_file_remove_key(key_file, "General", "IdentityAddress", - NULL); - } -#endif - if (device->vendor_src) { g_key_file_set_integer(key_file, "DeviceID", "Source", device->vendor_src); @@ -652,12 +431,6 @@ static gboolean store_device_info_cb(gpointer user_data) g_key_file_remove_group(key_file, "DeviceID", NULL); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - svc_change_regd = bt_att_get_svc_changed_indication_registered(device->att); - g_key_file_set_boolean(key_file, "Att", "SvcChangeRegd", - svc_change_regd); -#endif - if (device->local_csrk) store_csrk(device->local_csrk, key_file, "LocalSignatureKey"); @@ -720,12 +493,6 @@ void device_store_cached_name(struct btd_device *dev, const char *name) ba2str(btd_adapter_get_address(dev->adapter), s_addr); ba2str(&dev->bdaddr, d_addr); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dev->rpa) - ba2str(dev->rpa, d_addr); -#endif - snprintf(filename, PATH_MAX, STORAGEDIR "/%s/cache/%s", s_addr, d_addr); create_file(filename, S_IRUSR | S_IWUSR); @@ -742,9 +509,6 @@ void device_store_cached_name(struct btd_device *dev, const char *name) static void browse_request_free(struct browse_req *req) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG(""); -#endif if (req->listener_id) g_dbus_remove_watch(dbus_conn, req->listener_id); if (req->msg) @@ -765,7 +529,6 @@ static void gatt_client_cleanup(struct btd_device *device) bt_gatt_client_set_ready_handler(device->client, NULL, NULL, NULL); bt_gatt_client_unref(device->client); device->client = NULL; - } static void gatt_server_cleanup(struct btd_device *device) @@ -842,8 +605,6 @@ static void device_free(gpointer user_data) g_slist_free_full(device->uuids, g_free); g_slist_free_full(device->primaries, g_free); - g_slist_free_full(device->attios, g_free); - g_slist_free_full(device->attios_offline, g_free); g_slist_free_full(device->svc_callbacks, svc_dev_remove); /* Reset callbacks since the device is going to be freed */ @@ -883,9 +644,6 @@ static void device_free(gpointer user_data) if (device->eir_uuids) g_slist_free_full(device->eir_uuids, g_free); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_free(device->rpa); -#endif g_free(device->local_csrk); g_free(device->remote_csrk); g_free(device->path); @@ -894,18 +652,6 @@ static void device_free(gpointer user_data) g_free(device); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void device_set_remote_feature_flag(struct btd_device *device, int flags) -{ - device->remote_feature_flags = flags; -} - -gboolean device_is_bredrle(struct btd_device *device) -{ - return (device->remote_feature_flags & (EIR_CONTROLLER | EIR_SIM_HOST)); -} -#endif - bool device_is_paired(struct btd_device *device, uint8_t bdaddr_type) { struct bearer_state *state = get_state(device, bdaddr_type); @@ -925,53 +671,6 @@ gboolean device_is_trusted(struct btd_device *device) return device->trusted; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -gboolean device_is_profile_trusted(struct btd_device *device, - const char *uuid) -{ - if (g_strcmp0(uuid, OBEX_PSE_UUID) == 0) { - if (device->trusted_profiles.pbap == SUPPORTED_TRUSTED) - return TRUE; - } else if (g_strcmp0(uuid, OBEX_MAS_UUID) == 0) { - if (device->trusted_profiles.map == SUPPORTED_TRUSTED) - return TRUE; - } else if (g_strcmp0(uuid, SAP_UUID) == 0) { - if (device->trusted_profiles.sap == SUPPORTED_TRUSTED) - return TRUE; - } - return FALSE; -} - -gboolean device_is_profile_restricted(struct btd_device *device, - const char *uuid) -{ - if (g_strcmp0(uuid, HFP_HS_UUID) == 0) { - if (device->restricted_profiles.hfp_hs == CONNECTION_RESTRICTED) - return TRUE; - } else if (g_strcmp0(uuid, A2DP_SINK_UUID) == 0) { - if (device->restricted_profiles.a2dp == CONNECTION_RESTRICTED) - return TRUE; - } - return FALSE; -} - -gboolean device_is_profile_blocked(struct btd_device *device, - const char *uuid) -{ - if (g_strcmp0(uuid, OBEX_PSE_UUID) == 0) { - if (device->trusted_profiles.pbap == SUPPORTED_BLOCKED) - return TRUE; - } else if (g_strcmp0(uuid, OBEX_MAS_UUID) == 0) { - if (device->trusted_profiles.map == SUPPORTED_BLOCKED) - return TRUE; - } else if (g_strcmp0(uuid, SAP_UUID) == 0) { - if (device->trusted_profiles.sap == SUPPORTED_BLOCKED) - return TRUE; - } - return FALSE; -} -#endif - static gboolean dev_property_get_address(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -979,12 +678,7 @@ static gboolean dev_property_get_address(const GDBusPropertyTable *property, char dstaddr[18]; const char *ptr = dstaddr; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->rpa) - ba2str(device->rpa, dstaddr); - else -#endif - ba2str(&device->bdaddr, dstaddr); + ba2str(&device->bdaddr, dstaddr); dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &ptr); return TRUE; @@ -1023,9 +717,7 @@ static gboolean dev_property_get_alias(const GDBusPropertyTable *property, ptr = device->name; } else { ba2str(&device->bdaddr, dstaddr); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY g_strdelimit(dstaddr, ":", '-'); -#endif ptr = dstaddr; } @@ -1034,24 +726,6 @@ static gboolean dev_property_get_alias(const GDBusPropertyTable *property, return TRUE; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean dev_property_get_alias_set(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - dbus_bool_t val; - - if (device->alias != NULL) - val = TRUE; - else - val = FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val); - - return TRUE; -} -#endif - static void set_alias(GDBusPendingPropertySet id, const char *alias, void *data) { @@ -1256,38 +930,39 @@ static gboolean dev_property_exists_tx_power(const GDBusPropertyTable *property, return TRUE; } -static void append_service_path(const char *path, void *user_data) -{ - DBusMessageIter *array = user_data; - - dbus_message_iter_append_basic(array, DBUS_TYPE_OBJECT_PATH, &path); -} - -static gboolean dev_property_get_gatt_services( - const GDBusPropertyTable *property, +static gboolean +dev_property_get_svc_resolved(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { - struct btd_device *dev = data; - DBusMessageIter array; + struct btd_device *device = data; + gboolean val = device->svc_refreshed; - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "o", &array); + dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &val); - btd_gatt_client_foreach_service(dev->client_dbus, append_service_path, - &array); + return TRUE; +} - dbus_message_iter_close_container(iter, &array); +static gboolean dev_property_flags_exist(const GDBusPropertyTable *property, + void *data) +{ + struct btd_device *device = data; - return TRUE; + return device->ad_flags[0] != INVALID_FLAGS; } -static gboolean dev_property_exists_gatt_services( - const GDBusPropertyTable *property, - void *data) +static gboolean +dev_property_get_flags(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) { - struct btd_device *dev = data; + struct btd_device *device = data; + uint8_t *flags = device->ad_flags; + DBusMessageIter array; - if (!dev->client || !bt_gatt_client_is_ready(dev->client)) - return FALSE; + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, &array); + dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, + &flags, sizeof(device->ad_flags)); + dbus_message_iter_close_container(iter, &array); return TRUE; } @@ -1330,40 +1005,6 @@ static void dev_property_set_trusted(const GDBusPropertyTable *property, set_trust(id, b, data); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean dev_property_get_trusted_profiles(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - uint32_t pbap = device->trusted_profiles.pbap; - uint32_t map = device->trusted_profiles.map; - uint32_t sap = device->trusted_profiles.sap; - - unsigned int val = (pbap << PBAP_SHIFT_OFFSET) | - (map << MAP_SHIFT_OFFSET) | - (sap << SAP_SHIFT_OFFSET); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &val); - - return TRUE; -} - -static gboolean dev_property_get_restricted_profiles(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - uint32_t hfp_hs = device->restricted_profiles.hfp_hs; - uint32_t a2dp = device->restricted_profiles.a2dp; - - unsigned int val = (hfp_hs << HFP_HS_SHIFT_OFFSET) | - (a2dp << A2DP_SHIFT_OFFSET); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &val); - - return TRUE; -} -#endif - static gboolean dev_property_get_blocked(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -1419,112 +1060,10 @@ static void dev_property_set_blocked(const GDBusPropertyTable *property, set_blocked(id, b, data); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static uint8_t device_get_connected_state(struct btd_device *device) -{ - if (device->bredr_state.connected && device->le_state.connected) - return DEV_CONNECTED_BREDR_LE; - else if (device->bredr_state.connected) - return DEV_CONNECTED_BREDR; - else if (device->le_state.connected) - return DEV_CONNECTED_LE; - else - return DEV_CONNECTED_NONE; -} - -static gboolean dev_property_get_payload(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *dev = data; - dbus_uint16_t payload_timeout = dev->auth_payload_timeout; - - dbus_message_iter_append_basic(iter, - DBUS_TYPE_UINT16, &payload_timeout); - - return TRUE; -} - -static gboolean dev_property_get_last_addr_type(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *dev = data; - uint8_t last_addr_type = dev->last_bdaddr_type; - - dbus_message_iter_append_basic(iter, - DBUS_TYPE_BYTE, &last_addr_type); - - return TRUE; -} - -static gboolean dev_property_get_att_mtu(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - dbus_uint16_t mtu = bt_gatt_client_get_mtu(device->client); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &mtu); - - return TRUE; -} - -static gboolean dev_property_get_gatt_connected(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - dbus_bool_t gatt_connected; - - if (device->gatt_connected) - gatt_connected = TRUE; - else - gatt_connected = FALSE; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, - &gatt_connected); - - return TRUE; -} - -static gboolean dev_property_get_ipsp_conn_state(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *dev = data; - dbus_bool_t ipsp_connected; - - if (dev->ipsp_connected) - ipsp_connected = TRUE; - else - ipsp_connected = FALSE; - - dbus_message_iter_append_basic(iter, - DBUS_TYPE_BOOLEAN, &ipsp_connected); - - return TRUE; -} - -static gboolean dev_property_get_ipsp_conn_bt_iface_name(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *dev = data; - const char *ptr = g_strdup(dev->if_name); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &ptr); - - g_free(ptr); - - return TRUE; -} -#endif - static gboolean dev_property_get_connected(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { struct btd_device *dev = data; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint8_t connected = device_get_connected_state(dev); - - dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &connected); -#else dbus_bool_t connected; if (dev->bredr_state.connected || dev->le_state.connected) @@ -1533,12 +1072,10 @@ static gboolean dev_property_get_connected(const GDBusPropertyTable *property, connected = FALSE; dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &connected); -#endif return TRUE; } - static gboolean dev_property_get_uuids(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -1598,64 +1135,21 @@ static gboolean dev_property_get_adapter(const GDBusPropertyTable *property, return TRUE; } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean property_get_manufacturer_data_len(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *user_data) +static void append_manufacturer_data(void *data, void *user_data) { - struct btd_device *device = user_data; - dbus_uint16_t val = device->manufacturer_data_len; - - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &val); + struct bt_ad_manufacturer_data *md = data; + DBusMessageIter *dict = user_data; - return TRUE; + dict_append_basic_array(dict, DBUS_TYPE_UINT16, &md->manufacturer_id, + DBUS_TYPE_BYTE, &md->data, md->len); } -static gboolean property_get_manufacturer_data(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *user_data) +static gboolean +dev_property_get_manufacturer_data(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) { - struct btd_device *device = user_data; - char str[DEV_MAX_MANUFACTURER_DATA_LEN] = {0}; - DBusMessageIter array; - - memset(str, 0, DEV_MAX_MANUFACTURER_DATA_LEN); - if (device->manufacturer_data_len) - memcpy(str, device->manufacturer_data, - device->manufacturer_data_len); - - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, - DBUS_TYPE_BYTE_AS_STRING, &array); - - dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, - &device->manufacturer_data, - device->manufacturer_data_len); - - dbus_message_iter_close_container(iter, &array); - - return TRUE; -} - -gboolean device_get_gatt_connected(const struct btd_device *device) -{ - return device->gatt_connected; -} -#endif - -static void append_manufacturer_data(void *data, void *user_data) -{ - struct bt_ad_manufacturer_data *md = data; - DBusMessageIter *dict = user_data; - - dict_append_basic_array(dict, DBUS_TYPE_UINT16, &md->manufacturer_id, - DBUS_TYPE_BYTE, &md->data, md->len); -} - -static gboolean -dev_property_get_manufacturer_data(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct btd_device *device = data; - DBusMessageIter dict; + struct btd_device *device = data; + DBusMessageIter dict; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING @@ -1746,6 +1240,9 @@ int device_block(struct btd_device *device, gboolean update_only) if (device->blocked) return 0; + if (device->disconn_timer > 0) + g_source_remove(device->disconn_timer); + disconnect_all(device); while (device->services != NULL) { @@ -1986,10 +1483,8 @@ static void device_profile_connected(struct btd_device *dev, if (!err) btd_device_set_temporary(dev, false); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (dev->pending == NULL) goto done; -#endif if (!btd_device_is_connected(dev)) { switch (-err) { @@ -2000,10 +1495,6 @@ static void device_profile_connected(struct btd_device *dev, } } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dev->pending == NULL) - return; -#endif pending = dev->pending->data; l = find_service_with_profile(dev->pending, profile); @@ -2039,28 +1530,10 @@ done: g_dbus_send_message(dbus_conn, btd_error_failed(dev->connect, strerror(-err))); else { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* SDP is not required for Samsung TV Power on */ - if (g_strcmp0(profile->name, "hid-device") == 0) { - DBG("Skip SDP discovery."); - } else { -#endif /* Start passive SDP discovery to update known services */ if (dev->bredr && !dev->svc_refreshed) device_browse_sdp(dev, NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (err) - g_dbus_send_message(dbus_conn, - btd_error_failed(dev->connect, strerror(-err))); - else - g_dbus_send_reply(dbus_conn, dev->connect, DBUS_TYPE_INVALID); -#else g_dbus_send_reply(dbus_conn, dev->connect, DBUS_TYPE_INVALID); -#endif } dbus_message_unref(dev->connect); @@ -2131,9 +1604,7 @@ static struct btd_service *find_connectable_service(struct btd_device *dev, const char *uuid) { GSList *l; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct btd_service *s = NULL; -#endif + for (l = dev->services; l != NULL; l = g_slist_next(l)) { struct btd_service *service = l->data; struct btd_profile *p = btd_service_get_profile(service); @@ -2141,24 +1612,9 @@ static struct btd_service *find_connectable_service(struct btd_device *dev, if (!p->connect || !p->remote_uuid) continue; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (strcasecmp(uuid, p->remote_uuid) == 0) return service; -#else - if (strcasecmp(uuid, p->remote_uuid) == 0) { - s = service; - if (ext_profile_is_registered_as_client_role(p) == TRUE) { - return service; - } else { - continue; - } - } -#endif } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (s) - return s; -#endif return NULL; } @@ -2176,29 +1632,12 @@ static GSList *create_pending_list(struct btd_device *dev, const char *uuid) struct btd_service *service; struct btd_profile *p; GSList *l; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bool hs_hf_verify = FALSE; -#endif if (uuid) { service = find_connectable_service(dev, uuid); if (service) return g_slist_prepend(dev->pending, service); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if ((service == NULL) && - (g_strcmp0(uuid, HFP_HS_UUID) == 0)) { - DBG("HFP service not found check for HSP service"); - service = find_connectable_service(dev, HSP_HS_UUID); - if (service) - return g_slist_prepend(dev->pending, service); - } else if (g_strcmp0(uuid, HID_UUID) == 0) { - DBG("HID service not found, add HID service"); - btd_device_add_uuid(dev, uuid); - service = find_connectable_service(dev, HID_UUID); - if (service) - return g_slist_prepend(dev->pending, service); - } -#endif + return dev->pending; } @@ -2206,28 +1645,6 @@ static GSList *create_pending_list(struct btd_device *dev, const char *uuid) service = l->data; p = btd_service_get_profile(service); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("profile uuid %s", p->remote_uuid); - if (g_strcmp0(p->remote_uuid, HSP_HS_UUID) == 0) { - DBG("HSP service is found check for HFP service"); - struct btd_service *service; - struct btd_profile *p; - GSList *h; - - for (h = dev->services; h != NULL; h = g_slist_next(h)) { - service = h->data; - p = btd_service_get_profile(service); - - if (g_strcmp0(p->remote_uuid, HFP_HS_UUID) == 0) { - DBG("HFP found,ignore HSP "); - hs_hf_verify = TRUE; - break; - } - } - if (hs_hf_verify) - continue; - } -#endif if (!p->auto_connect) continue; @@ -2276,13 +1693,8 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type DBG("%s %s, client %s", dev->path, uuid ? uuid : "(all)", dbus_message_get_sender(msg)); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dev->pending || dev->connect) - return btd_error_in_progress(msg); -#else if (dev->pending || dev->connect || dev->browse) return btd_error_in_progress(msg); -#endif if (!btd_adapter_get_powered(dev->adapter)) return btd_error_not_ready(msg); @@ -2295,13 +1707,8 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type dev->pending = create_pending_list(dev, uuid); if (!dev->pending) { if (dev->svc_refreshed) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!uuid && find_service_with_state(dev->services, - BTD_SERVICE_STATE_CONNECTED)) -#else if (find_service_with_state(dev->services, BTD_SERVICE_STATE_CONNECTED)) -#endif return dbus_message_new_method_return(msg); else return btd_error_not_available(msg); @@ -2342,6 +1749,16 @@ static uint8_t select_conn_bearer(struct btd_device *dev) time_t bredr_last = NVAL_TIME, le_last = NVAL_TIME; time_t current = time(NULL); + /* Prefer bonded bearer in case only one is bonded */ + if (dev->bredr_state.bonded && !dev->le_state.bonded ) + return BDADDR_BREDR; + else if (!dev->bredr_state.bonded && dev->le_state.bonded) + return dev->bdaddr_type; + + /* If the address is random it can only be connected over LE */ + if (dev->bdaddr_type == BDADDR_LE_RANDOM) + return dev->bdaddr_type; + if (dev->bredr_seen) { bredr_last = current - dev->bredr_seen; if (bredr_last > SEEN_TRESHHOLD) @@ -2363,7 +1780,11 @@ static uint8_t select_conn_bearer(struct btd_device *dev) if (dev->le && (!dev->bredr || bredr_last == NVAL_TIME)) return dev->bdaddr_type; - if (bredr_last < le_last) + /* + * Prefer BR/EDR if time is the same since it might be from an + * advertisement with BR/EDR flag set. + */ + if (bredr_last <= le_last) return BDADDR_BREDR; return dev->bdaddr_type; @@ -2375,9 +1796,18 @@ static DBusMessage *dev_connect(DBusConnection *conn, DBusMessage *msg, struct btd_device *dev = user_data; uint8_t bdaddr_type; - if (dev->bredr_state.connected) - bdaddr_type = dev->bdaddr_type; - else if (dev->le_state.connected && dev->bredr) + if (dev->bredr_state.connected) { + /* + * Check if services have been resolved and there is at list + * one connected before switching to connect LE. + */ + if (dev->bredr_state.svc_resolved && + find_service_with_state(dev->services, + BTD_SERVICE_STATE_CONNECTED)) + bdaddr_type = dev->bdaddr_type; + else + bdaddr_type = BDADDR_BREDR; + } else if (dev->le_state.connected && dev->bredr) bdaddr_type = BDADDR_BREDR; else bdaddr_type = select_conn_bearer(dev); @@ -2462,12 +1892,6 @@ static DBusMessage *disconnect_profile(DBusConnection *conn, DBusMessage *msg, return btd_error_invalid_args(msg); service = find_connectable_service(dev, uuid); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((service == NULL) && (g_strcmp0(uuid, HFP_HS_UUID) == 0)) { - DBG("HFP service is not found check for HSP service"); - service = find_connectable_service(dev, HSP_HS_UUID); - } -#endif free(uuid); if (!service) @@ -2482,9 +1906,6 @@ static DBusMessage *disconnect_profile(DBusConnection *conn, DBusMessage *msg, if (err == 0) return NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dev->disconnect) -#endif dbus_message_unref(dev->disconnect); dev->disconnect = NULL; @@ -2520,11 +1941,6 @@ static void store_services(struct btd_device *device) ba2str(btd_adapter_get_address(adapter), src_addr); ba2str(&device->bdaddr, dst_addr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->rpa) - ba2str(device->rpa, dst_addr); -#endif - snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/attributes", src_addr, dst_addr); key_file = g_key_file_new(); @@ -2574,6 +1990,7 @@ static void store_services(struct btd_device *device) struct gatt_saver { struct btd_device *device; + uint16_t ext_props; GKeyFile *key_file; }; @@ -2583,6 +2000,7 @@ static void store_desc(struct gatt_db_attribute *attr, void *user_data) GKeyFile *key_file = saver->key_file; char handle[6], value[100], uuid_str[MAX_LEN_UUID_STR]; const bt_uuid_t *uuid; + bt_uuid_t ext_uuid; uint16_t handle_num; handle_num = gatt_db_attribute_get_handle(attr); @@ -2590,7 +2008,13 @@ static void store_desc(struct gatt_db_attribute *attr, void *user_data) uuid = gatt_db_attribute_get_type(attr); bt_uuid_to_string(uuid, uuid_str, sizeof(uuid_str)); - sprintf(value, "%s", uuid_str); + + bt_uuid16_create(&ext_uuid, GATT_CHARAC_EXT_PROPER_UUID); + if (!bt_uuid_cmp(uuid, &ext_uuid) && saver->ext_props) + sprintf(value, "%04hx:%s", saver->ext_props, uuid_str); + else + sprintf(value, "%s", uuid_str); + g_key_file_set_string(key_file, "Attributes", handle, value); } @@ -2604,7 +2028,8 @@ static void store_chrc(struct gatt_db_attribute *attr, void *user_data) bt_uuid_t uuid; if (!gatt_db_attribute_get_char_data(attr, &handle_num, &value_handle, - &properties, &uuid)) { + &properties, &saver->ext_props, + &uuid)) { warn("Error storing characteristic - can't get data"); return; } @@ -2640,6 +2065,7 @@ static void store_incl(struct gatt_db_attribute *attr, void *user_data) sprintf(handle, "%04hx", handle_num); + gatt_db_attribute_get_service_uuid(service, &uuid); bt_uuid_to_string(&uuid, uuid_str, sizeof(uuid_str)); sprintf(value, GATT_INCLUDE_UUID_STR ":%04hx:%04hx:%s", start, end, uuid_str); @@ -2768,31 +2194,33 @@ done: browse_request_free(req); } +static void device_set_svc_refreshed(struct btd_device *device, bool value) +{ + if (device->svc_refreshed == value) + return; + + device->svc_refreshed = value; + + g_dbus_emit_property_changed(dbus_conn, device->path, + DEVICE_INTERFACE, "ServicesResolved"); +} + static void device_svc_resolved(struct btd_device *dev, uint8_t bdaddr_type, int err) { struct bearer_state *state = get_state(dev, bdaddr_type); struct browse_req *req = dev->browse; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG("%s bdaddr_type %d err %d", dev->path, bdaddr_type, err); -#else DBG("%s err %d", dev->path, err); -#endif -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY state->svc_resolved = true; -#else - if (err == 0) - state->svc_resolved = true; -#endif /* Disconnection notification can happen before this function * gets called, so don't set svc_refreshed for a disconnected * device. */ if (state->connected) - dev->svc_refreshed = true; + device_set_svc_refreshed(dev, true); g_slist_free_full(dev->eir_uuids, g_free); dev->eir_uuids = NULL; @@ -2825,14 +2253,6 @@ static void device_svc_resolved(struct btd_device *dev, uint8_t bdaddr_type, if (!req) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* If bdaddr_type is LE but req is for SDP, don't complete browse req. */ - if (bdaddr_type != BDADDR_BREDR && req->search_uuid) { - DBG("Discover comp. is for LE but browse req. is for SDP."); - return; - } -#endif - dev->browse = NULL; browse_request_complete(req, bdaddr_type, err); } @@ -2922,57 +2342,56 @@ static void create_bond_req_exit(DBusConnection *conn, void *user_data) } } +static void bonding_request_free(struct bonding_req *bonding) +{ + if (!bonding) + return; + + if (bonding->listener_id) + g_dbus_remove_watch(dbus_conn, bonding->listener_id); + + if (bonding->msg) + dbus_message_unref(bonding->msg); + + if (bonding->cb_iter) + g_free(bonding->cb_iter); + + if (bonding->agent) { + agent_cancel(bonding->agent); + agent_unref(bonding->agent); + bonding->agent = NULL; + } + + if (bonding->retry_timer) + g_source_remove(bonding->retry_timer); + + if (bonding->device) + bonding->device->bonding = NULL; + + g_free(bonding); +} + static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, void *data) { struct btd_device *device = data; struct btd_adapter *adapter = device->adapter; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY struct bearer_state *state; -#endif uint8_t bdaddr_type; const char *sender; struct agent *agent; struct bonding_req *bonding; uint8_t io_cap; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint8_t conn_type; - bool connect_le = FALSE; -#endif int err; btd_device_set_temporary(device, false); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dbus_message_get_args(msg, NULL, DBUS_TYPE_BYTE, &conn_type, - DBUS_TYPE_INVALID) == FALSE) -#else if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) -#endif return btd_error_invalid_args(msg); if (device->bonding) return btd_error_in_progress(msg); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (conn_type == DEV_CONN_DEFAULT) { - if (device_is_bonded(device, DEV_CONN_BREDR)) - return btd_error_already_exists(msg); - else if (device_is_bonded(device, DEV_CONN_LE)) - return btd_error_already_exists(msg); - - if (device->bredr) - conn_type = DEV_CONN_BREDR; - else if (device->le) - conn_type = DEV_CONN_LE; - else - conn_type = DEV_CONN_BREDR; - } else { - if (device_is_bonded(device, conn_type)) - return btd_error_already_exists(msg); - } - bdaddr_type = device->bdaddr_type; -#else if (device->bredr_state.bonded) bdaddr_type = device->bdaddr_type; else if (device->le_state.bonded) @@ -2984,15 +2403,6 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, if (state->bonded) return btd_error_already_exists(msg); -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (conn_type == DEV_CONN_LE && - (device_is_bredrle(device) || bdaddr_type != BDADDR_BREDR)) { - DBG("LE Connect request"); - connect_le = TRUE; - } -#endif sender = dbus_message_get_sender(msg); @@ -3002,15 +2412,7 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, else io_cap = IO_CAPABILITY_NOINPUTNOOUTPUT; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((conn_type == DEV_CONN_LE && bdaddr_type != BDADDR_BREDR) || - connect_le) - bonding = bonding_request_new(msg, device, bdaddr_type, agent); - else - bonding = bonding_request_new(msg, device, BDADDR_BREDR, agent); -#else bonding = bonding_request_new(msg, device, bdaddr_type, agent); -#endif if (agent) agent_unref(agent); @@ -3027,17 +2429,6 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, * channel first and only then start pairing (there's code for * this in the ATT connect callback) */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (((conn_type == DEV_CONN_LE && bdaddr_type != BDADDR_BREDR) || - (connect_le)) && !device->le_state.connected) - err = device_connect_le(device); - else if (connect_le) /* Send bonding request if LE is already connected*/ - err = adapter_create_bonding(adapter, &device->bdaddr, - bdaddr_type, io_cap); - else - err = adapter_create_bonding(adapter, &device->bdaddr, - BDADDR_BREDR, io_cap); -#else if (bdaddr_type != BDADDR_BREDR) { if (!state->connected && btd_le_connect_before_pairing()) err = device_connect_le(device); @@ -3049,10 +2440,11 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg, err = adapter_create_bonding(adapter, &device->bdaddr, BDADDR_BREDR, io_cap); } -#endif - if (err < 0) + if (err < 0) { + bonding_request_free(device->bonding); return btd_error_failed(msg, strerror(-err)); + } return NULL; } @@ -3078,9 +2470,7 @@ static DBusMessage *new_authentication_return(DBusMessage *msg, uint8_t status) "Authentication Rejected"); case MGMT_STATUS_CANCELLED: case MGMT_STATUS_NO_RESOURCES: -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY case MGMT_STATUS_DISCONNECTED: -#endif return dbus_message_new_error(msg, ERROR_INTERFACE ".AuthenticationCanceled", "Authentication Canceled"); @@ -3095,35 +2485,6 @@ static DBusMessage *new_authentication_return(DBusMessage *msg, uint8_t status) } } -static void bonding_request_free(struct bonding_req *bonding) -{ - if (!bonding) - return; - - if (bonding->listener_id) - g_dbus_remove_watch(dbus_conn, bonding->listener_id); - - if (bonding->msg) - dbus_message_unref(bonding->msg); - - if (bonding->cb_iter) - g_free(bonding->cb_iter); - - if (bonding->agent) { - agent_cancel(bonding->agent); - agent_unref(bonding->agent); - bonding->agent = NULL; - } - - if (bonding->retry_timer) - g_source_remove(bonding->retry_timer); - - if (bonding->device) - bonding->device->bonding = NULL; - - g_free(bonding); -} - static void device_cancel_bonding(struct btd_device *device, uint8_t status) { struct bonding_req *bonding = device->bonding; @@ -3162,857 +2523,107 @@ static DBusMessage *cancel_pairing(DBusConnection *conn, DBusMessage *msg, return dbus_message_new_method_return(msg); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *discover_services(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct btd_device *device = user_data; - const char *pattern; - int err; - - if (device->browse) - return btd_error_in_progress(msg); - - if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &pattern, - DBUS_TYPE_INVALID) == FALSE) - return btd_error_invalid_args(msg); +static const GDBusMethodTable device_methods[] = { + { GDBUS_ASYNC_METHOD("Disconnect", NULL, NULL, dev_disconnect) }, + { GDBUS_ASYNC_METHOD("Connect", NULL, NULL, dev_connect) }, + { GDBUS_ASYNC_METHOD("ConnectProfile", GDBUS_ARGS({ "UUID", "s" }), + NULL, connect_profile) }, + { GDBUS_ASYNC_METHOD("DisconnectProfile", GDBUS_ARGS({ "UUID", "s" }), + NULL, disconnect_profile) }, + { GDBUS_ASYNC_METHOD("Pair", NULL, NULL, pair_device) }, + { GDBUS_METHOD("CancelPairing", NULL, NULL, cancel_pairing) }, + { } +}; - err = device_browse_sdp(device, msg); - if (err < 0) - goto fail; +static const GDBusPropertyTable device_properties[] = { + { "Address", "s", dev_property_get_address }, + { "Name", "s", dev_property_get_name, NULL, dev_property_exists_name }, + { "Alias", "s", dev_property_get_alias, dev_property_set_alias }, + { "Class", "u", dev_property_get_class, NULL, + dev_property_exists_class }, + { "Appearance", "q", dev_property_get_appearance, NULL, + dev_property_exists_appearance }, + { "Icon", "s", dev_property_get_icon, NULL, + dev_property_exists_icon }, + { "Paired", "b", dev_property_get_paired }, + { "Trusted", "b", dev_property_get_trusted, dev_property_set_trusted }, + { "Blocked", "b", dev_property_get_blocked, dev_property_set_blocked }, + { "LegacyPairing", "b", dev_property_get_legacy }, + { "RSSI", "n", dev_property_get_rssi, NULL, dev_property_exists_rssi }, + { "Connected", "b", dev_property_get_connected }, + { "UUIDs", "as", dev_property_get_uuids }, + { "Modalias", "s", dev_property_get_modalias, NULL, + dev_property_exists_modalias }, + { "Adapter", "o", dev_property_get_adapter }, + { "ManufacturerData", "a{qv}", dev_property_get_manufacturer_data, + NULL, dev_property_manufacturer_data_exist }, + { "ServiceData", "a{sv}", dev_property_get_service_data, + NULL, dev_property_service_data_exist }, + { "TxPower", "n", dev_property_get_tx_power, NULL, + dev_property_exists_tx_power }, + { "ServicesResolved", "b", dev_property_get_svc_resolved, NULL, NULL }, + { "AdvertisingFlags", "ay", dev_property_get_flags, NULL, + dev_property_flags_exist, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL}, - return NULL; + { } +}; -fail: - return btd_error_failed(msg, - "Unable to search the SDP services"); +uint8_t btd_device_get_bdaddr_type(struct btd_device *dev) +{ + return dev->bdaddr_type; } -static const char *browse_request_get_requestor(struct browse_req *req) +bool btd_device_is_connected(struct btd_device *dev) { - if (!req->msg) - return NULL; - - return dbus_message_get_sender(req->msg); + return dev->bredr_state.connected || dev->le_state.connected; } -static void iter_append_record(DBusMessageIter *dict, uint32_t handle, - const char *record) +void device_add_connection(struct btd_device *dev, uint8_t bdaddr_type) { - DBusMessageIter entry; - - dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, - NULL, &entry); + struct bearer_state *state = get_state(dev, bdaddr_type); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_UINT32, &handle); + device_update_last_seen(dev, bdaddr_type); - dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &record); + if (state->connected) { + char addr[18]; + ba2str(&dev->bdaddr, addr); + error("Device %s is already connected", addr); + return; + } - dbus_message_iter_close_container(dict, &entry); -} + /* If this is the first connection over this bearer */ + if (bdaddr_type == BDADDR_BREDR) + device_set_bredr_support(dev); + else + device_set_le_support(dev, bdaddr_type); -static void discover_services_reply(struct browse_req *req, int err, - sdp_list_t *recs) -{ - DBusMessage *reply; - DBusMessageIter iter, dict; - sdp_list_t *seq; + state->connected = true; - if (!req->msg) - return; - - if (err) { - const char *err_if; - - if (err == -EHOSTDOWN) - err_if = ERROR_INTERFACE ".ConnectionAttemptFailed"; - else - err_if = ERROR_INTERFACE ".Failed"; - - reply = dbus_message_new_error(req->msg, err_if, - strerror(-err)); - g_dbus_send_message(dbus_conn, reply); - return; - } - - reply = dbus_message_new_method_return(req->msg); - if (!reply) - return; - - dbus_message_iter_init_append(reply, &iter); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_UINT32_AS_STRING DBUS_TYPE_STRING_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict); - - for (seq = recs; seq; seq = seq->next) { - sdp_record_t *rec = (sdp_record_t *) seq->data; - GString *result; - - if (!rec) - break; - - result = g_string_new(NULL); - - convert_sdp_record_to_xml(rec, result, - (void *) g_string_append); - - if (result->len) - iter_append_record(&dict, rec->handle, result->str); - - g_string_free(result, TRUE); - } - - dbus_message_iter_close_container(&iter, &dict); - - g_dbus_send_message(dbus_conn, reply); -} - -static DBusMessage *cancel_discover(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct btd_device *device = user_data; - const char *sender = dbus_message_get_sender(msg); - const char *requestor; - - if (!device->browse) - return btd_error_does_not_exist(msg); - - if (!dbus_message_is_method_call(device->browse->msg, DEVICE_INTERFACE, - "DiscoverServices")) - return btd_error_not_authorized(msg); - - requestor = browse_request_get_requestor(device->browse); - - /* only the discover requestor can cancel the inquiry process */ - if (!requestor || !g_str_equal(requestor, sender)) - return btd_error_not_authorized(msg); - - discover_services_reply(device->browse, -ECANCELED, NULL); - - if (device->browse) - browse_request_cancel(device->browse); - - return dbus_message_new_method_return(msg); -} - -void device_set_gatt_connected(struct btd_device *device, gboolean connected) -{ - if (device == NULL) { - error("device is NULL"); - return; - } - - if (device->gatt_connected == connected) { - error("same state change for gatt_connected : %d", connected); - return; - } - DBG("GattConnected %d", connected); - - device->gatt_connected = connected; - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "GattConnected"); -} - -static DBusMessage *connect_le(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *dev = user_data; - dbus_bool_t auto_connect = FALSE; - int err; - - if (!dev->le) { - /* - * If a LE connection is requested without device discovery, - * we try to get device object. Here, technology can be updated - * if there is matched device object. Or, a new device object - * will be created. - */ - dev = btd_adapter_get_device(dev->adapter, &dev->bdaddr, - BDADDR_LE_PUBLIC); - if (dev == NULL) { - error("Unable to get device object"); - return btd_error_not_supported(msg); - } - } - - if (dev->le_state.connected) - return dbus_message_new_method_return(msg); - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_BOOLEAN, &auto_connect, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - btd_device_set_temporary(dev, false); - - if (auto_connect) { - DBG("Start BLE auto connection"); - dev->disable_auto_connect = FALSE; - device_set_auto_connect(dev, TRUE); - - return dbus_message_new_method_return(msg); - } - - err = device_connect_le(dev); - if (err < 0) - return btd_error_failed(msg, strerror(-err)); - - dev->connect = dbus_message_ref(msg); - - return NULL; -} - -static DBusMessage *disconnect_le(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *dev = user_data; - - if (!dev->le) - return btd_error_not_supported(msg); - - /* - * Disable connections through passive sccanning - */ - if (dev->auto_connect) { - DBG("Stop BLE auto connection"); - dev->disable_auto_connect = FALSE; - device_set_auto_connect(dev, FALSE); - - if (!dev->le_state.connected) { - g_dbus_send_reply(dbus_conn, msg, DBUS_TYPE_INVALID); - return NULL; - } - } else if (!dev->le_state.connected) { - return btd_error_not_connected(msg); - } - - dev->disconnects = g_slist_append(dev->disconnects, - dbus_message_ref(msg)); - - btd_adapter_disconnect_device(dev->adapter, &dev->bdaddr, - dev->bdaddr_type); - - return NULL; -} - -static DBusMessage *connect_ipsp(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *device = user_data; - - DBG("bdaddr_type %d", device->bdaddr_type); - - if (device->bdaddr_type == BDADDR_BREDR) { - if(device->le) - device->bdaddr_type = BDADDR_LE_PUBLIC; - else { - device = btd_adapter_get_device(device->adapter, - &device->bdaddr, BDADDR_LE_PUBLIC); - if (device == NULL) - return btd_error_no_such_adapter(msg); - } - } - - if (device->ipsp_connected) - return btd_error_already_connected(msg); - - /* Initiate Connection for 6Lowan*/ - if (btd_adapter_connect_ipsp(device->adapter, &device->bdaddr, - device->bdaddr_type) != 0) - return btd_error_failed(msg, "ConnectFailed"); - - return dbus_message_new_method_return(msg);; -} - -static DBusMessage *disconnect_ipsp(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *device = user_data; - DBG("bdaddr_type %d", device->bdaddr_type); - - if (device->bdaddr_type == BDADDR_BREDR) - return btd_error_not_supported(msg); - - if (!device->ipsp_connected) - return btd_error_not_connected(msg); - - /* Disconnect the 6Lowpan connection */ - if (btd_adapter_disconnect_ipsp(device->adapter, &device->bdaddr, - device->bdaddr_type) != 0) - return btd_error_failed(msg, "DisconnectFailed"); - - /* TODO: Handle disconnection of GATT connection, If the connection - * is established as part of IPSP connection. */ - - return dbus_message_new_method_return(msg);; -} - -static DBusMessage *le_set_data_length( - DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - dbus_uint16_t max_tx_octets; - dbus_uint16_t max_tx_time; - struct btd_device *device = user_data; - int status; - char addr[18]; - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_UINT16, &max_tx_octets, - DBUS_TYPE_UINT16, &max_tx_time, - DBUS_TYPE_INVALID)) { - DBG("error in retrieving values"); - return btd_error_invalid_args(msg); - } - - if (device->bdaddr_type == BDADDR_BREDR) - return btd_error_not_supported(msg); - - ba2str(&device->bdaddr, addr); - - DBG("Remote device address: %s", addr); - DBG("Max tx octets: %u, Max tx time: %u", - max_tx_octets, max_tx_time); - - status = btd_adapter_le_set_data_length(device->adapter, - &device->bdaddr, max_tx_octets, - max_tx_time); - - if (status != 0) - return btd_error_failed(msg, "Unable to set le data length values"); - else - return dbus_message_new_method_return(msg); -} - -static DBusMessage *set_trusted_profile(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_device *dev = data; - dbus_bool_t profile_trusted; - const char *pattern; - char *uuid; - uint32_t pbap = dev->trusted_profiles.pbap; - uint32_t map = dev->trusted_profiles.map; - uint32_t sap = dev->trusted_profiles.sap; - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &pattern, - DBUS_TYPE_BOOLEAN, &profile_trusted, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - DBG("Pattern : %s", pattern); - uuid = bt_name2string(pattern); - DBG("UUID : %s", uuid); - DBG("profile Trusted : %d %d %d", dev->trusted_profiles.pbap, - dev->trusted_profiles.map, dev->trusted_profiles.sap); - if (g_strcmp0(uuid, OBEX_PBAP_UUID) == 0) { - if (profile_trusted) - pbap = SUPPORTED_TRUSTED; - else - pbap = SUPPORTED_BLOCKED; - } else if (g_strcmp0(uuid, OBEX_MAP_UUID) == 0) { - if (profile_trusted) - map = SUPPORTED_TRUSTED; - else - map = SUPPORTED_BLOCKED; - } else if (g_strcmp0(uuid, SAP_UUID) == 0) { - if (profile_trusted) - sap = SUPPORTED_TRUSTED; - else - sap = SUPPORTED_BLOCKED; - } else { - return btd_error_invalid_args(msg); - } - - btd_device_set_trusted_profiles(dev, pbap, map, sap); - return dbus_message_new_method_return(msg); -} - -static DBusMessage *set_restricted_profile(DBusConnection *conn, - DBusMessage *msg, void *data) -{ - struct btd_device *dev = data; - dbus_bool_t profile_restricted; - const char *pattern; - char *uuid; - uint32_t hfp_hs = dev->restricted_profiles.hfp_hs; - uint32_t a2dp = dev->restricted_profiles.a2dp; - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_STRING, &pattern, - DBUS_TYPE_BOOLEAN, &profile_restricted, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - DBG("Pattern : %s", pattern); - uuid = bt_name2string(pattern); - DBG("UUID : %s", uuid); - DBG("profile Restricted : %d %d", dev->restricted_profiles.hfp_hs, - dev->restricted_profiles.a2dp); - if (g_strcmp0(uuid, HFP_HS_UUID) == 0) { - if (profile_restricted) - hfp_hs = CONNECTION_RESTRICTED; - else - hfp_hs = CONNECTION_PERMITTED; - } else if (g_strcmp0(uuid, A2DP_SINK_UUID) == 0) { - if (profile_restricted) - a2dp = CONNECTION_RESTRICTED; - else - a2dp = CONNECTION_PERMITTED; - } else { - return btd_error_invalid_args(msg); - } - - btd_device_set_restricted_profiles(dev, hfp_hs, a2dp); - return dbus_message_new_method_return(msg); -} - -static DBusMessage *is_connected_profile(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *dev = user_data; - struct btd_service *service; - btd_service_state_t state; - const char *pattern; - char *uuid; - DBusMessage *reply; - dbus_bool_t val; - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &pattern, - DBUS_TYPE_INVALID)) - return btd_error_invalid_args(msg); - - reply = dbus_message_new_method_return(msg); - if (!reply) - return btd_error_invalid_args(reply); - - uuid = bt_name2string(pattern); - DBG("is_connected_profile_uuid : %s", uuid); - service = btd_device_get_service(dev, uuid); - - if ((service == NULL) && (g_strcmp0(uuid, HFP_HS_UUID) == 0)) { - DBG("HFP service is not found check for HSP service"); - service = btd_device_get_service(dev, HSP_HS_UUID); - } - if (uuid) - free(uuid); - - if (!service) - return btd_error_not_connected(msg); - - state = btd_service_get_state(service); - DBG("Connected State : %d", state); - - if (state == BTD_SERVICE_STATE_CONNECTED) - val = TRUE; - else - val = FALSE; - - dbus_message_append_args(reply, - DBUS_TYPE_BOOLEAN, &val, - DBUS_TYPE_INVALID); - - return reply; -} - -static DBusMessage *update_le_conn_parm(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *device = user_data; - GIOChannel *io; - int fd; - struct le_conn_param param = {0, 0, 0, 0}; - - DBG(""); - - if (device == NULL) { - error("device is NULL"); - return btd_error_invalid_args(msg); - } - - if (!device->le) { - error("le is not supported"); - return btd_error_not_supported(msg); - } - - if (!device->gatt_connected || !device->attrib) - return btd_error_not_connected(msg); - - io = g_attrib_get_channel(device->attrib); - if (!io) - return btd_error_not_connected(msg); - - fd = g_io_channel_unix_get_fd(io); - if (fd < 0) - return btd_error_not_connected(msg); - - if (device_get_conn_update_state(device)) - return btd_error_in_progress(msg); - else - device_set_conn_update_state(device, true); - - if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, ¶m.min, - DBUS_TYPE_UINT32, ¶m.max, - DBUS_TYPE_UINT32, ¶m.latency, - DBUS_TYPE_UINT32, ¶m.to_multiplier, - DBUS_TYPE_INVALID)) { - error("Invalid args"); - return btd_error_invalid_args(msg); - } - - if (setsockopt(fd, SOL_BLUETOOTH, BT_LE_CONN_PARAM, - ¶m, sizeof(param)) < 0) { - error("Can't Update LE conn param : %s (%d)", - strerror(errno), errno); - return btd_error_failed(msg, strerror(errno)); - } - - return dbus_message_new_method_return(msg); -} - -static void device_request_att_mtu_reponse_cb(bool success, uint8_t att_ecode, - void *user_data) -{ - struct btd_device *device = user_data; - DBusMessage *reply; - DBusMessageIter iter; - uint16_t mtu; - - if (!device->req_att_mtu) - return; - - mtu = bt_gatt_client_get_mtu(device->client); - - if (!success) { - const char *err_if; - err_if = ERROR_INTERFACE ".Failed"; - - reply = dbus_message_new_error(device->req_att_mtu, err_if, - "Request Att MTU failed"); - g_dbus_send_message(dbus_conn, reply); - return; - } - - DBG("MTU exchange complete, with MTU: %u", mtu); - - reply = dbus_message_new_method_return(device->req_att_mtu); - if (!reply) - return; - - dbus_message_iter_init_append(reply, &iter); - - dbus_message_iter_append_basic(&iter, DBUS_TYPE_UINT16, - &mtu); - dbus_message_iter_append_basic(&iter, DBUS_TYPE_BYTE, - &att_ecode); - g_dbus_send_message(dbus_conn, reply); - - dbus_message_unref(device->req_att_mtu); - device->req_att_mtu = NULL; -} - -static DBusMessage *request_att_mtu(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *device = user_data; - uint16_t mtu; - - DBG(""); - - if (device == NULL) { - error("device is NULL"); - return btd_error_invalid_args(msg); - } - - if (!device->le) { - error("le is not supported"); - return btd_error_not_supported(msg); - } - - if (!device->gatt_connected || !device->attrib) - return btd_error_not_connected(msg); - - if (!dbus_message_get_args(msg, NULL, - DBUS_TYPE_UINT16, &mtu, - DBUS_TYPE_INVALID)) { - error("Invalid args"); - return btd_error_invalid_args(msg); - } - - DBG("MTU %d", mtu); - - if (!bt_gatt_request_att_mtu(device->client, mtu, - device_request_att_mtu_reponse_cb, device)) - return btd_error_failed(msg, "Unable to Request MTU"); - - device->req_att_mtu = dbus_message_ref(msg); - return NULL; -} - -static DBusMessage *device_get_ida(DBusConnection *conn, DBusMessage *msg, - void *user_data) -{ - struct btd_device *device = user_data; - char device_idaddr[18] = { 0 }; - DBusMessage *reply; - const gchar *id_address = device_idaddr; - - DBG(""); - - if (device == NULL) - return btd_error_invalid_args(msg); - - if (!device->le) - return btd_error_not_supported(msg); - - if (device->rpa) { - if (device->bredr) - ba2str(device->rpa, device_idaddr); - else - ba2str(&device->bdaddr, device_idaddr); - } else - return btd_error_does_not_exist(msg); - - reply = dbus_message_new_method_return(msg); - if (!reply) - return NULL; - - dbus_message_append_args(reply, DBUS_TYPE_STRING, &id_address, - DBUS_TYPE_INVALID); - - return reply; -} - -void device_set_conn_update_state(struct btd_device *device, bool state) -{ - if (!device) - return; - - device->pending_conn_update = state; -} - -bool device_get_conn_update_state(struct btd_device *device) -{ - return device->pending_conn_update; -} -#endif - -static const GDBusMethodTable device_methods[] = { - { GDBUS_ASYNC_METHOD("Disconnect", NULL, NULL, dev_disconnect) }, - { GDBUS_ASYNC_METHOD("Connect", NULL, NULL, dev_connect) }, - { GDBUS_ASYNC_METHOD("ConnectProfile", GDBUS_ARGS({ "UUID", "s" }), - NULL, connect_profile) }, - { GDBUS_ASYNC_METHOD("DisconnectProfile", GDBUS_ARGS({ "UUID", "s" }), - NULL, disconnect_profile) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_ASYNC_METHOD("Pair", GDBUS_ARGS({ "conn_type", "y" }), NULL, - pair_device) }, -#else - { GDBUS_ASYNC_METHOD("Pair", NULL, NULL, pair_device) }, -#endif - { GDBUS_METHOD("CancelPairing", NULL, NULL, cancel_pairing) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_ASYNC_METHOD("ConnectLE", GDBUS_ARGS({ "auto_connect", "b"}), - NULL, connect_le) }, - { GDBUS_ASYNC_METHOD("DisconnectLE", NULL, NULL, disconnect_le) }, - { GDBUS_METHOD("IsConnectedProfile", GDBUS_ARGS({ "UUID", "s" }), - GDBUS_ARGS({ "IsConnected", "b" }), - is_connected_profile)}, - { GDBUS_METHOD("LeConnUpdate", GDBUS_ARGS({ "interval_min", "u" }, - { "interval_max", "u" }, { "latency", "u" }, - { "time_out", "u" }), NULL, - update_le_conn_parm) }, - { GDBUS_ASYNC_METHOD("DiscoverServices", GDBUS_ARGS({ "pattern", "s" }), - NULL, discover_services) }, - { GDBUS_METHOD("CancelDiscovery", NULL, NULL, cancel_discover) }, - { GDBUS_ASYNC_METHOD("ConnectIpsp", NULL, NULL, connect_ipsp) }, - { GDBUS_ASYNC_METHOD("DisconnectIpsp", NULL, NULL, disconnect_ipsp) }, - { GDBUS_ASYNC_METHOD("LESetDataLength", - GDBUS_ARGS({"max_tx_octets", "q" }, - { "max_tx_time", "q" }), NULL, - le_set_data_length)}, - { GDBUS_ASYNC_METHOD("RequestAttMtu", GDBUS_ARGS({ "mtu", "q" }), - GDBUS_ARGS({ "mtu", "q" }, { "status", "y"}), - request_att_mtu) }, - { GDBUS_METHOD("GetIDAddress", NULL, GDBUS_ARGS({ "IDAdress", "s" }), - device_get_ida) }, - { GDBUS_METHOD("SetTrustedProfile", - GDBUS_ARGS({ "uuid", "s"}, { "trusted", "b"}), NULL, - set_trusted_profile) }, - { GDBUS_METHOD("SetRestrictedProfile", - GDBUS_ARGS({ "uuid", "s"}, { "restricted", "b"}), NULL, - set_restricted_profile) }, -#endif - { } -}; - -static const GDBusPropertyTable device_properties[] = { - { "Address", "s", dev_property_get_address }, - { "Name", "s", dev_property_get_name, NULL, dev_property_exists_name }, - { "Alias", "s", dev_property_get_alias, dev_property_set_alias }, - { "Class", "u", dev_property_get_class, NULL, - dev_property_exists_class }, - { "Appearance", "q", dev_property_get_appearance, NULL, - dev_property_exists_appearance }, - { "Icon", "s", dev_property_get_icon, NULL, - dev_property_exists_icon }, - { "Paired", "b", dev_property_get_paired }, - { "Trusted", "b", dev_property_get_trusted, dev_property_set_trusted }, - { "Blocked", "b", dev_property_get_blocked, dev_property_set_blocked }, - { "LegacyPairing", "b", dev_property_get_legacy }, - { "RSSI", "n", dev_property_get_rssi, NULL, dev_property_exists_rssi }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - {"IsAliasSet", "b", dev_property_get_alias_set }, - { "Connected", "y", dev_property_get_connected }, -#else - { "Connected", "b", dev_property_get_connected }, -#endif - { "UUIDs", "as", dev_property_get_uuids }, - { "Modalias", "s", dev_property_get_modalias, NULL, - dev_property_exists_modalias }, - { "Adapter", "o", dev_property_get_adapter }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* To handle Failed Legacy Pairing when initiated from Remote device*/ - { "LegacyPaired", "b", dev_property_get_paired }, - { "ManufacturerDataLen", "q", property_get_manufacturer_data_len }, - { "ManufacturerData", "ay", property_get_manufacturer_data }, - { "GattConnected", "b", dev_property_get_gatt_connected }, - { "PayloadTimeout", "q", dev_property_get_payload}, - { "LastAddrType", "y", dev_property_get_last_addr_type}, - { "IpspConnected", "b", dev_property_get_ipsp_conn_state }, - { "IpspBtInterfaceInfo", "s", dev_property_get_ipsp_conn_bt_iface_name }, - { "AttMtu", "q", dev_property_get_att_mtu }, - { "TrustedProfiles", "u", dev_property_get_trusted_profiles}, - { "RestrictedProfiles", "u", dev_property_get_restricted_profiles}, -#endif - { "ManufacturerData", "a{qv}", dev_property_get_manufacturer_data, - NULL, dev_property_manufacturer_data_exist, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "ServiceData", "a{sv}", dev_property_get_service_data, - NULL, dev_property_service_data_exist, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "TxPower", "n", dev_property_get_tx_power, NULL, - dev_property_exists_tx_power, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "GattServices", "ao", dev_property_get_gatt_services, NULL, - dev_property_exists_gatt_services, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - - { } -}; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static const GDBusSignalTable device_signals[] = { - { GDBUS_SIGNAL("Disconnected", - GDBUS_ARGS({ "bdaddr_type", "y" }, { "reason", "y" }, - { "name", "s" })) }, - { GDBUS_SIGNAL("DeviceConnected", GDBUS_ARGS({ "bdaddr_type", "y"})) }, - { GDBUS_SIGNAL("ProfileStateChanged", - GDBUS_ARGS({ "profile", "s"}, {"state", "i"})) }, - { GDBUS_SIGNAL("AdvReport", - GDBUS_ARGS({"Address","s"}, { "Address Type", "y" }, - { "Adv Type", "y"}, { "RSSI", "i"}, - { "AdvDataLen", "i"}, { "AdvData", "ay"})) }, - { GDBUS_SIGNAL("LEDataLengthChanged", - GDBUS_ARGS({"max_tx_octets","q"}, - { "max_tx_time", "q" }, - { "max_rx_octets", "q"}, - { "max_rx_time", "q"})) }, - { GDBUS_SIGNAL("IpspStateChanged", - GDBUS_ARGS({"connected","b"},{"if_name","s"}))}, -}; -#endif - -uint8_t btd_device_get_bdaddr_type(struct btd_device *dev) -{ - return dev->bdaddr_type; -} - -bool btd_device_is_connected(struct btd_device *dev) -{ - return dev->bredr_state.connected || dev->le_state.connected; -} - -void device_add_connection(struct btd_device *dev, uint8_t bdaddr_type) -{ - struct bearer_state *state = get_state(dev, bdaddr_type); - - device_update_last_seen(dev, bdaddr_type); - - if (state->connected) { - char addr[18]; - ba2str(&dev->bdaddr, addr); - error("Device %s is already connected", addr); - return; - } - - /* If this is the first connection over this bearer */ - if (bdaddr_type == BDADDR_BREDR) - device_set_bredr_support(dev); - else - device_set_le_support(dev, bdaddr_type); - - state->connected = true; - -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - if (dev->le_state.connected && dev->bredr_state.connected) + if (dev->le_state.connected && dev->bredr_state.connected) return; g_dbus_emit_property_changed(dbus_conn, dev->path, DEVICE_INTERFACE, "Connected"); -#else -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH - if (bdaddr_type == BDADDR_BREDR && - get_charging_state(dev->adapter) == WIRELESS_CHARGING) { - int br_pkt_type = ACL_PTYPE_MASK | - HCI_2DH1 | HCI_2DH3 | HCI_2DH5 | - HCI_3DH1 | HCI_3DH3 | HCI_3DH5; - - DBG("During wireless charging... Change packet type"); - device_change_pkt_type(dev, (gpointer)br_pkt_type); - } -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ - - g_dbus_emit_signal(dbus_conn, dev->path, - DEVICE_INTERFACE, "DeviceConnected", - DBUS_TYPE_BYTE, &bdaddr_type, - DBUS_TYPE_INVALID); -#endif } void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type) { struct bearer_state *state = get_state(device, bdaddr_type); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *dev_name = device->name; -#endif if (!state->connected) return; state->connected = false; - device->svc_refreshed = false; device->general_connect = FALSE; + device_set_svc_refreshed(device, false); + if (device->disconn_timer > 0) { g_source_remove(device->disconn_timer); device->disconn_timer = 0; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->browse) { - struct browse_req *req = device->browse; - - if ((bdaddr_type == BDADDR_BREDR && req->search_uuid != 0) || - (bdaddr_type != BDADDR_BREDR && req->search_uuid == 0)) - device->browse = NULL; - else - DBG("device->browse is for other link"); - } -#endif - while (device->disconnects) { DBusMessage *msg = device->disconnects->data; @@ -4025,20 +2636,11 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type) btd_adapter_remove_bonding(device->adapter, &device->bdaddr, bdaddr_type); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (device->bredr_state.connected || device->le_state.connected) return; g_dbus_emit_property_changed(dbus_conn, device->path, DEVICE_INTERFACE, "Connected"); -#else - g_dbus_emit_signal(dbus_conn, device->path, - DEVICE_INTERFACE, "Disconnected", - DBUS_TYPE_BYTE, &bdaddr_type, - DBUS_TYPE_BYTE, &device->disc_reason, - DBUS_TYPE_STRING, &dev_name, - DBUS_TYPE_INVALID); -#endif } guint device_add_disconnect_watch(struct btd_device *device, @@ -4085,6 +2687,9 @@ static char *load_cached_name(struct btd_device *device, const char *local, char *str = NULL; int len; + if (device_address_is_private(device)) + return NULL; + snprintf(filename, PATH_MAX, STORAGEDIR "/%s/cache/%s", local, peer); key_file = g_key_file_new(); @@ -4139,6 +2744,61 @@ fail: return NULL; } +static void load_services(struct btd_device *device, char **uuids) +{ + char **uuid; + + for (uuid = uuids; *uuid; uuid++) { + if (g_slist_find_custom(device->uuids, *uuid, bt_uuid_strcmp)) + continue; + + device->uuids = g_slist_insert_sorted(device->uuids, + g_strdup(*uuid), + bt_uuid_strcmp); + } + + g_strfreev(uuids); +} + +static void convert_info(struct btd_device *device, GKeyFile *key_file) +{ + char filename[PATH_MAX]; + char adapter_addr[18]; + char device_addr[18]; + char **uuids; + char *str; + gsize length = 0; + + /* Load device profile list from legacy properties */ + uuids = g_key_file_get_string_list(key_file, "General", "SDPServices", + NULL, NULL); + if (uuids) + load_services(device, uuids); + + uuids = g_key_file_get_string_list(key_file, "General", "GATTServices", + NULL, NULL); + if (uuids) + load_services(device, uuids); + + if (!device->uuids) + return; + + /* Remove old entries so they are not loaded again */ + g_key_file_remove_key(key_file, "General", "SDPServices", NULL); + g_key_file_remove_key(key_file, "General", "GATTServices", NULL); + + ba2str(btd_adapter_get_address(device->adapter), adapter_addr); + ba2str(&device->bdaddr, device_addr); + snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", adapter_addr, + device_addr); + + str = g_key_file_to_data(key_file, &length, NULL); + g_file_set_contents(filename, str, length, NULL); + g_free(str); + + store_device_info(device); +} + static void load_info(struct btd_device *device, const char *local, const char *peer, GKeyFile *key_file) { @@ -4148,10 +2808,7 @@ static void load_info(struct btd_device *device, const char *local, char **uuids; int source, vendor, product, version; char **techno, **t; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gboolean svc_change_regd; - char buf[DEV_MAX_MANUFACTURER_DATA_LEN] = { 0, }; -#endif + /* Load device name from storage info file, if that fails fall back to * the cache. */ @@ -4188,37 +2845,6 @@ static void load_info(struct btd_device *device, const char *local, g_free(str); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Load RPA Resolution Support value */ - device->rpa_res_support = g_key_file_get_integer(key_file, - "General", "RPAResSupport", NULL); - - str = g_key_file_get_string(key_file, "General", "ManufacturerDataLen", NULL); - if (str) { - device->manufacturer_data_len = strtol(str, NULL, 10); - g_free(str); - - str = g_key_file_get_string(key_file, "General", "ManufacturerData", NULL); - if (str) { - load_manufacturer_data_2digit(str, - device->manufacturer_data_len, buf); - device->manufacturer_data = g_memdup(buf, - device->manufacturer_data_len); - g_free(str); - } - } - - str = g_key_file_get_string(key_file, "General", "IdentityAddress", - NULL); - - if (str) { - device->rpa = g_malloc0(sizeof(bdaddr_t)); - bacpy(device->rpa, &device->bdaddr); - str2ba(str, &device->bdaddr); - g_free(str); - } -#endif - /* Load device technology */ techno = g_key_file_get_string_list(key_file, "General", "SupportedTechnologies", NULL, NULL); @@ -4260,27 +2886,6 @@ next: device->trusted = g_key_file_get_boolean(key_file, "General", "Trusted", NULL); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Load Trusted Profiles*/ - int trusted_profiles = g_key_file_get_integer(key_file, "General", - "TrustedProfiles", NULL); - DBG("Loading TrustedProfiles %d", trusted_profiles); - device->trusted_profiles.pbap = ((trusted_profiles & - (PROFILE_SUPPORTED << PBAP_SHIFT_OFFSET)) >> PBAP_SHIFT_OFFSET); - device->trusted_profiles.map = ((trusted_profiles & - (PROFILE_SUPPORTED << MAP_SHIFT_OFFSET)) >> MAP_SHIFT_OFFSET); - device->trusted_profiles.sap = ((trusted_profiles & - (PROFILE_SUPPORTED << SAP_SHIFT_OFFSET)) >> SAP_SHIFT_OFFSET); - - /* Load Restricted Profiles*/ - int restricted_profiles = g_key_file_get_integer(key_file, "General", - "RestrictedProfiles", NULL); - DBG("Loading RestrictedProfiles %d", restricted_profiles); - device->restricted_profiles.hfp_hs = (restricted_profiles >> HFP_HS_SHIFT_OFFSET) & 0x01; - device->restricted_profiles.a2dp = (restricted_profiles >> A2DP_SHIFT_OFFSET) & 0x01; - -#endif - /* Load device blocked */ blocked = g_key_file_get_boolean(key_file, "General", "Blocked", NULL); if (blocked) @@ -4290,21 +2895,7 @@ next: uuids = g_key_file_get_string_list(key_file, "General", "Services", NULL, NULL); if (uuids) { - char **uuid; - - for (uuid = uuids; *uuid; uuid++) { - GSList *match; - - match = g_slist_find_custom(device->uuids, *uuid, - bt_uuid_strcmp); - if (match) - continue; - - device->uuids = g_slist_insert_sorted(device->uuids, - g_strdup(*uuid), - bt_uuid_strcmp); - } - g_strfreev(uuids); + load_services(device, uuids); /* Discovered services restored from storage */ device->bredr_state.svc_resolved = true; @@ -4325,15 +2916,6 @@ next: btd_device_set_pnpid(device, source, vendor, product, version); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Load Service changed Registered flag */ - svc_change_regd = g_key_file_get_boolean(key_file, "Att", - "SvcChangeRegd", NULL); - - bt_att_set_svc_changed_indication_registered(device->att, - svc_change_regd); -#endif - if (store_needed) store_device_info(device); } @@ -4452,24 +3034,43 @@ static void add_primary(struct gatt_db_attribute *attr, void *user_data) *new_services = g_slist_append(*new_services, prim); } +static void load_desc_value(struct gatt_db_attribute *attrib, + int err, void *user_data) +{ + if (err) + warn("loading descriptor value to db failed"); +} + static int load_desc(char *handle, char *value, struct gatt_db_attribute *service) { char uuid_str[MAX_LEN_UUID_STR]; struct gatt_db_attribute *att; uint16_t handle_int; - bt_uuid_t uuid; + uint16_t val; + bt_uuid_t uuid, ext_uuid; if (sscanf(handle, "%04hx", &handle_int) != 1) return -EIO; - if (sscanf(value, "%s", uuid_str) != 1) - return -EIO; + /* Check if there is any value stored, otherwise it is just the UUID */ + if (sscanf(value, "%04hx:%s", &val, uuid_str) != 2) { + if (sscanf(value, "%s", uuid_str) != 1) + return -EIO; + val = 0; + } + + DBG("loading descriptor handle: 0x%04x, value: 0x%04x, uuid: %s", + handle_int, val, uuid_str); bt_string_to_uuid(&uuid, uuid_str); + bt_uuid16_create(&ext_uuid, GATT_CHARAC_EXT_PROPER_UUID); - DBG("loading descriptor handle: 0x%04x, uuid: %s", handle_int, - uuid_str); + /* If it is CEP then it must contain the value */ + if (!bt_uuid_cmp(&uuid, &ext_uuid) && !val) { + warn("cannot load CEP descriptor without value"); + return -EIO; + } att = gatt_db_service_insert_descriptor(service, handle_int, &uuid, 0, NULL, NULL, NULL); @@ -4478,6 +3079,13 @@ static int load_desc(char *handle, char *value, return -EIO; } + if (val) { + if (!gatt_db_attribute_write(att, 0, (uint8_t *)&val, + sizeof(val), 0, NULL, + load_desc_value, NULL)) + return -EIO; + } + return 0; } @@ -4734,13 +3342,8 @@ static bool device_match_profile(struct btd_device *device, return false; if (g_slist_find_custom(uuids, profile->remote_uuid, - bt_uuid_strcmp) == NULL) { -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (strcmp(profile->name, "hid-device") == 0) - return true; -#endif + bt_uuid_strcmp) == NULL) return false; - } return true; } @@ -4801,35 +3404,12 @@ static void device_add_gatt_services(struct btd_device *device) gatt_db_foreach_service(device->db, NULL, add_gatt_service, device); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void accept_gatt_service(struct gatt_db_attribute *attr, void *user_data) -{ - struct btd_device *device = user_data; - GSList *l; - bt_uuid_t uuid; - char uuid_str[MAX_LEN_UUID_STR]; - - gatt_db_attribute_get_service_uuid(attr, &uuid); - bt_uuid_to_string(&uuid, uuid_str, sizeof(uuid_str)); - - l = find_service_with_uuid(device->services, uuid_str); - if (!l) - return; - - service_accept(l->data); -} -#endif - static void device_accept_gatt_profiles(struct btd_device *device) { -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY GSList *l; for (l = device->services; l != NULL; l = g_slist_next(l)) service_accept(l->data); -#else - gatt_db_foreach_service(device->db, NULL, accept_gatt_service, device); -#endif } static void device_remove_gatt_service(struct btd_device *device, @@ -4859,9 +3439,6 @@ static gboolean gatt_services_changed(gpointer user_data) store_gatt_db(device); - g_dbus_emit_property_changed(dbus_conn, device->path, DEVICE_INTERFACE, - "GattServices"); - return FALSE; } @@ -5005,6 +3582,8 @@ static struct btd_device *device_new(struct btd_adapter *adapter, return NULL; } + memset(device->ad_flags, INVALID_FLAGS, sizeof(device->ad_flags)); + device->ad = bt_ad_new(); if (!device->ad) { device_free(device); @@ -5029,11 +3608,7 @@ static struct btd_device *device_new(struct btd_adapter *adapter, if (g_dbus_register_interface(dbus_conn, device->path, DEVICE_INTERFACE, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_methods, device_signals, -#else device_methods, NULL, -#endif device_properties, device, device_free) == FALSE) { error("Unable to register device interface for %s", address); @@ -5050,28 +3625,6 @@ static struct btd_device *device_new(struct btd_adapter *adapter, return btd_device_ref(device); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void device_print_addr(struct btd_device *dev) -{ - char ida[18]; - char rpa[18]; - - ba2str(&dev->bdaddr, ida); - - if (dev->rpa) { - ba2str(dev->rpa, rpa); - - DBG("IDA %s [%d] : RPA [%s], BREDR [%d], LE [%d]", - ida, dev->bdaddr_type, rpa, - dev->bredr ? 1 : 0, dev->le ? 1 : 0); - } else { - DBG("ADDR %s [%d] : BREDR [%d], LE [%d]", - ida, dev->bdaddr_type, - dev->bredr ? 1 : 0, dev->le ? 1 : 0); - } -} -#endif - struct btd_device *device_create_from_storage(struct btd_adapter *adapter, const char *address, GKeyFile *key_file) { @@ -5088,6 +3641,8 @@ struct btd_device *device_create_from_storage(struct btd_adapter *adapter, src = btd_adapter_get_address(adapter); ba2str(src, srcaddr); + convert_info(device, key_file); + load_info(device, srcaddr, address, key_file); load_att_info(device, srcaddr, address); @@ -5142,11 +3697,6 @@ char *btd_device_get_storage_path(struct btd_device *device, ba2str(btd_adapter_get_address(device->adapter), srcaddr); ba2str(&device->bdaddr, dstaddr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->rpa) - ba2str(device->rpa, dstaddr); -#endif - if (!filename) return g_strdup_printf(STORAGEDIR "/%s/%s", srcaddr, dstaddr); @@ -5228,23 +3778,6 @@ void device_update_addr(struct btd_device *device, const bdaddr_t *bdaddr, void device_set_bredr_support(struct btd_device *device) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char addr_str[18]; - - if (device->rpa) { - ba2str(device->rpa, addr_str); - error("Cannot set bredr support to RPA device [%s]", addr_str); - return; - } - - if (device->bdaddr_type == BDADDR_LE_RANDOM) { - ba2str(&device->bdaddr, addr_str); - error("Cannot set bredr support to LE random device [%s]", - addr_str); - return; - } -#endif - if (device->bredr) return; @@ -5252,22 +3785,6 @@ void device_set_bredr_support(struct btd_device *device) store_device_info(device); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void device_set_rpa(struct btd_device *device, const bdaddr_t *rpa) -{ - if (device->rpa == NULL) { - device->rpa = g_malloc0(sizeof(bdaddr_t)); - bacpy(device->rpa, rpa); - } else - error("RPA is already set"); -} - -void device_set_irk_value(struct btd_device *device, const uint8_t *val) -{ - memcpy(&device->irk_val, val, sizeof(device->irk_val)); -} -#endif - void device_set_le_support(struct btd_device *device, uint8_t bdaddr_type) { if (device->le) @@ -5408,11 +3925,6 @@ static void device_remove_stored(struct btd_device *device) ba2str(src, adapter_addr); ba2str(&device->bdaddr, device_addr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->rpa) - ba2str(device->rpa, device_addr); -#endif - snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s", adapter_addr, device_addr); delete_folder_tree(filename); @@ -5434,102 +3946,6 @@ static void device_remove_stored(struct btd_device *device) g_key_file_free(key_file); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void device_unpair(struct btd_device *device, gboolean remove_stored) -{ - DBG("+"); - DBG("Unpairing device %s", device->path); - - if (device->bonding) { - uint8_t status; - - if (device->bredr_state.connected) - status = MGMT_STATUS_DISCONNECTED; - else - status = MGMT_STATUS_CONNECT_FAILED; - - device_cancel_bonding(device, status); - } - - if (device->browse) - browse_request_cancel(device->browse); - - -// while (device->services != NULL) { -// struct btd_service *service = device->services->data; -// -// device->services = g_slist_remove(device->services, service); -// service_remove(service); -// } - - g_slist_free(device->pending); - device->pending = NULL; - - if (btd_device_is_connected(device)) - disconnect_all(device); - - if (device->store_id > 0) { - g_source_remove(device->store_id); - device->store_id = 0; - - if (!remove_stored) - store_device_info_cb(device); - } - - if (remove_stored) - device_remove_stored(device); - - gatt_db_clear(device->db); - - if (device->rpa) { - bacpy(&device->bdaddr, device->rpa); - device->bdaddr_type = BDADDR_LE_RANDOM; - - g_free(device->rpa); - device->rpa = NULL; - } - - device->bredr_state.paired = 0; - device->le_state.paired = 0; - device->bredr_state.svc_resolved = false; - device->trusted = false; - device->trusted_profiles.pbap = SHOW_AUTHORIZATION; - device->trusted_profiles.map = SHOW_AUTHORIZATION; - device->trusted_profiles.sap = SHOW_AUTHORIZATION; - if (device->alias != NULL) { - /* Remove alias name because - * In UG if we rename and then unpair device and - * initiates connection without scanning then paired - * list will have alias name as first preference is - * given to alias name. - */ - DBG("Freeing device alias name"); - g_free(device->alias); - device->alias = NULL; - } - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "Paired"); -// btd_device_unref(device); - DBG("-"); - } - -void device_remove_stored_folder(struct btd_device *device) -{ - const bdaddr_t *src = btd_adapter_get_address(device->adapter); - char adapter_addr[18]; - char device_addr[18]; - char filename[PATH_MAX]; - - ba2str(src, adapter_addr); - ba2str(&device->bdaddr, device_addr); - - snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s", adapter_addr, - device_addr); - - delete_folder_tree(filename); -} -#endif - void device_remove(struct btd_device *device, gboolean remove_stored) { DBG("Removing device %s", device->path); @@ -5558,8 +3974,10 @@ void device_remove(struct btd_device *device, gboolean remove_stored) g_slist_free(device->pending); device->pending = NULL; - if (btd_device_is_connected(device)) + if (btd_device_is_connected(device)) { + g_source_remove(device->disconn_timer); disconnect_all(device); + } if (device->store_id > 0) { g_source_remove(device->store_id); @@ -5575,30 +3993,6 @@ void device_remove(struct btd_device *device, gboolean remove_stored) btd_device_unref(device); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int device_rpa_cmp(gconstpointer a, gconstpointer b) -{ - const struct btd_device *device = a; - const char *address = b; - char addr[18]; - - if (!device->rpa) - return -1; - - ba2str(device->rpa, addr); - - return strcasecmp(addr, address); -} - -int device_addr_cmp(gconstpointer a, gconstpointer b) -{ - const struct btd_device *device = a; - const bdaddr_t *bdaddr = b; - - return bacmp(&device->bdaddr, bdaddr); -} -#endif - int device_address_cmp(gconstpointer a, gconstpointer b) { const struct btd_device *device = a; @@ -5617,43 +4011,13 @@ int device_bdaddr_cmp(gconstpointer a, gconstpointer b) return bacmp(&device->bdaddr, bdaddr); } -static bool addr_is_public(uint8_t addr_type) -{ - if (addr_type == BDADDR_BREDR || addr_type == BDADDR_LE_PUBLIC) - return true; - - return false; -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int device_addr_type_strict_cmp(gconstpointer a, gconstpointer b) -{ - const struct btd_device *dev = a; - const struct device_addr_type *addr = b; - int cmp; - - cmp = bacmp(&dev->bdaddr, &addr->bdaddr); - - if (addr->bdaddr_type == BDADDR_BREDR) { - if (!dev->bredr) - return -1; - - return cmp; - } - - if (!dev->le) - return -1; - - if (cmp && dev->rpa && addr->bdaddr_type == BDADDR_LE_RANDOM && - (addr->bdaddr.b[5] >> 6) == 0x01) - return bacmp(dev->rpa, &addr->bdaddr); - - if (addr->bdaddr_type != dev->bdaddr_type) - return -1; +static bool addr_is_public(uint8_t addr_type) +{ + if (addr_type == BDADDR_BREDR || addr_type == BDADDR_LE_PUBLIC) + return true; - return cmp; + return false; } -#endif int device_addr_type_cmp(gconstpointer a, gconstpointer b) { @@ -5670,20 +4034,7 @@ int device_addr_type_cmp(gconstpointer a, gconstpointer b) */ if (!cmp && addr_is_public(addr->bdaddr_type) && addr_is_public(dev->bdaddr_type)) -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { - if (dev->rpa && addr->bdaddr_type == BDADDR_BREDR) { - char addr_str[18]; - - ba2str(&dev->bdaddr, addr_str); - DBG("Don't match. LE Only device [%s]", addr_str); - return -1; - } return 0; - } -#else - return 0; -#endif if (addr->bdaddr_type == BDADDR_BREDR) { if (!dev->bredr) @@ -5701,68 +4052,6 @@ int device_addr_type_cmp(gconstpointer a, gconstpointer b) return cmp; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH -void device_change_pkt_type(gpointer data, gpointer user_data) -{ - int pkt_type = (int)user_data; - struct btd_device *device = data; - struct hci_conn_info_req *cr; - set_conn_ptype_cp cp; - char addr[18]; - int hdev = 0; - int err = 0; - - /* Change a packet type only for Phone device */ - if ((device->class & 0x00001F00) >> 8 != 0x02) - return; - - if (!device->bredr_state.connected) - return; - - hdev = hci_open_dev(0); - if (hdev < 0) { - error("Cannot open hdev"); - return; - } - - cr = g_malloc0(sizeof(*cr) + sizeof(struct hci_conn_info)); - if (cr == NULL) { - error("Out of memory"); - return; - } - cr->type = ACL_LINK; - bacpy(&cr->bdaddr, &device->bdaddr); - - err = ioctl(hdev, HCIGETCONNINFO, cr); - if (err < 0) { - error("Fail to get HCIGETCOINFO"); - g_free(cr); - hci_close_dev(hdev); - return; - } - - cp.handle = cr->conn_info->handle; - g_free(cr); - cp.pkt_type = cpu_to_le16((uint16_t)pkt_type); - - ba2str(&device->bdaddr, addr); - DBG("Handle %d, Addr %s", cp.handle, addr); - DBG("Send Change pkt type request : 0x%X", pkt_type); - - if (hci_send_cmd(hdev, OGF_LINK_CTL, OCF_SET_CONN_PTYPE, - SET_CONN_PTYPE_CP_SIZE, &cp) < 0) { - error("hci_send_cmd is failed"); - hci_close_dev(hdev); - return; - } - - hci_close_dev(hdev); - return; -} -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif - static gboolean record_has_uuid(const sdp_record_t *rec, const char *profile_uuid) { @@ -5816,14 +4105,11 @@ static struct btd_service *probe_service(struct btd_device *device, return NULL; } - /* - * Profile based auto connection is not used in Tizen. - * Instead, the applications request auto connection with address. + /* Only set auto connect if profile has set the flag and can really + * accept connections. */ -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - if (profile->auto_connect) + if (profile->auto_connect && profile->accept) device_set_auto_connect(device, TRUE); -#endif return service; } @@ -5833,13 +4119,6 @@ static void dev_probe(struct btd_profile *p, void *user_data) struct probe_data *d = user_data; struct btd_service *service; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (find_service_with_profile(d->dev->services, p)) { - DBG("%s is already probed.(UUID:%s)", p->name, p->remote_uuid); - return; - } -#endif - service = probe_service(d->dev, p, d->uuids); if (!service) return; @@ -5876,30 +4155,8 @@ void device_remove_profile(gpointer a, gpointer b) GSList *l; l = find_service_with_profile(device->services, profile); -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (l == NULL) { - if (g_strcmp0(profile->local_uuid , HID_DEVICE_UUID) == 0) { - l = find_service_with_uuid(device->services, - HID_DEVICE_UUID); - if (l == NULL) - return; - - service = l->data; - - if (btd_service_get_state(service) == - BTD_SERVICE_STATE_CONNECTED) { - int err; - err = btd_service_disconnect(service); - if (err) - error("error: %s", strerror(-err)); - } - } - return; - } -#else if (l == NULL) return; -#endif service = l->data; device->services = g_slist_delete_link(device->services, l); @@ -6256,19 +4513,6 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data) DEVICE_INTERFACE, "UUIDs"); send_reply: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!req->msg) - goto done; - - /* since no new services are found, UUID signal is not emitted, - ** so send a reply to the framework with the existing services */ - if (dbus_message_is_method_call(req->msg, DEVICE_INTERFACE, - "DiscoverServices")) - discover_services_reply(req, err, device->tmp_records); - -done: -#endif - device_svc_resolved(device, BDADDR_BREDR, err); } @@ -6313,25 +4557,16 @@ static bool device_get_auto_connect(struct btd_device *device) return device->auto_connect; } -static void attio_connected(gpointer data, gpointer user_data) -{ - struct attio_data *attio = data; - GAttrib *attrib = user_data; - - DBG(""); - - if (attio->cfunc) - attio->cfunc(attrib, attio->user_data); -} - -static void attio_disconnected(gpointer data, gpointer user_data) +static void disconnect_gatt_service(gpointer data, gpointer user_data) { - struct attio_data *attio = data; + struct btd_service *service = data; + struct btd_profile *profile = btd_service_get_profile(service); - DBG(""); + /* Ignore if profile cannot accept connections */ + if (!profile->accept) + return; - if (attio->dcfunc) - attio->dcfunc(attio->user_data); + btd_service_disconnect(service); } static void att_disconnected_cb(int err, void *user_data) @@ -6345,7 +4580,7 @@ static void att_disconnected_cb(int err, void *user_data) DBG("%s (%d)", strerror(err), err); - g_slist_foreach(device->attios, attio_disconnected, NULL); + g_slist_foreach(device->services, disconnect_gatt_service, NULL); btd_gatt_client_disconnected(device->client_dbus); @@ -6363,26 +4598,9 @@ static void att_disconnected_cb(int err, void *user_data) adapter_connect_list_add(device->adapter, device); done: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_set_gatt_connected(device, FALSE); -#endif attio_cleanup(device); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void att_mtu_changed(uint16_t mtu, void *user_data) -{ - struct btd_device *device = user_data; - - DBG("att mtu changed %d", mtu); - - g_dbus_emit_signal(dbus_conn, device->path, - DEVICE_INTERFACE, "AttMtuChanged", - DBUS_TYPE_UINT16, &mtu, - DBUS_TYPE_INVALID); -} -#endif - static void register_gatt_services(struct btd_device *device) { struct browse_req *req = device->browse; @@ -6399,32 +4617,15 @@ static void register_gatt_services(struct btd_device *device) btd_device_set_temporary(device, false); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (req) { - if (req->search_uuid) - DBG("browse req. is for SDP. Ignore it."); - else - update_gatt_uuids(req, device->primaries, services); - } -#else if (req) update_gatt_uuids(req, device->primaries, services); -#endif -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - /* do not delete existing primary list, - * just append the new primary uuids, - * the list will be modifed when service changed - * indication is received during connection */ g_slist_free_full(device->primaries, g_free); device->primaries = NULL; -#endif device_register_primaries(device, services, -1); device_add_gatt_services(device); - - device_svc_resolved(device, device->bdaddr_type, 0); } static void gatt_client_init(struct btd_device *device); @@ -6441,40 +4642,13 @@ static void gatt_client_ready_cb(bool success, uint8_t att_ecode, return; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - /* Register the services after setting the client is ready - * and exporting all the services and characteristics paths. - */ register_gatt_services(device); -#endif btd_gatt_client_ready(device->client_dbus); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - register_gatt_services(device); -#endif - - /* - * Update the GattServices property. Do this asynchronously since this - * should happen after the "Characteristics" and "Descriptors" - * properties of all services have been asynchronously updated by - * btd_gatt_client. - * - * Service discovery will be skipped and exported objects won't change - * if the attribute cache was populated when bt_gatt_client gets - * initialized, so no need to to send this signal if that's the case. - */ - if (!device->gatt_cache_used) - g_idle_add(gatt_services_changed, device); + device_svc_resolved(device, device->bdaddr_type, 0); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->name[0] == '\0') { - char *name = NULL; - name = bt_gatt_client_get_gap_device_name(device->client); - if (name) - strncpy(device->name, name, MAX_NAME_LENGTH); - } -#endif + store_gatt_db(device); } static void gatt_client_service_changed(uint16_t start_handle, @@ -6502,9 +4676,6 @@ static void gatt_client_init(struct btd_device *device) bt_gatt_client_set_debug(device->client, gatt_debug, NULL, NULL); - /* Notify attio so it can react to notifications */ - g_slist_foreach(device->attios, attio_connected, device->attrib); - /* * Notify notify existing service about the new connection so they can * react to notifications while discovering services @@ -6527,8 +4698,6 @@ static void gatt_client_init(struct btd_device *device) return; } - device->gatt_cache_used = !gatt_db_isempty(device->db); - btd_gatt_client_connected(device->client_dbus); } @@ -6546,15 +4715,6 @@ static void gatt_server_init(struct btd_device *device, struct gatt_db *db) error("Failed to initialize bt_gatt_server"); bt_gatt_server_set_debug(device->server, gatt_debug, NULL, NULL); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!bt_gatt_server_set_mtu_changed(device->server, - att_mtu_changed, - device, NULL)) { - DBG("Failed to set mtu changed handler"); - return; - } -#endif } static bool local_counter(uint32_t *sign_cnt, void *user_data) @@ -6585,33 +4745,6 @@ static bool remote_counter(uint32_t *sign_cnt, void *user_data) return true; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static bool load_svc_change_indication_status(struct btd_device *device, const char *local, - const char *peer) -{ - char filename[PATH_MAX]; - GKeyFile *key_file; - gboolean svc_change_regd = false; - snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", local, peer); - - key_file = g_key_file_new(); - if (!g_key_file_load_from_file(key_file, filename, 0, NULL)) - goto failed; - - /* Load Service changed Registered flag */ - svc_change_regd = g_key_file_get_boolean(key_file, "Att", - "SvcChangeRegd", NULL); - bt_att_set_svc_changed_indication_registered(device->att, - svc_change_regd); - - -failed: - g_key_file_free(key_file); - - return svc_change_regd; -} -#endif - bool device_attach_att(struct btd_device *dev, GIOChannel *io) { GError *gerr = NULL; @@ -6622,16 +4755,10 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io) struct btd_gatt_database *database; const bdaddr_t *src, *dst; char srcaddr[18], dstaddr[18]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint8_t dst_type = BDADDR_BREDR; -#endif bt_io_get(io, &gerr, BT_IO_OPT_SEC_LEVEL, &sec_level, BT_IO_OPT_IMTU, &mtu, BT_IO_OPT_CID, &cid, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - BT_IO_OPT_DEST_TYPE, &dst_type, -#endif BT_IO_OPT_INVALID); if (gerr) { @@ -6640,7 +4767,6 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io) return false; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (sec_level == BT_IO_SEC_LOW && dev->le_state.paired) { DBG("Elevating security level since LTK is available"); @@ -6653,10 +4779,9 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io) return false; } } -#endif dev->att_mtu = MIN(mtu, BT_ATT_MAX_LE_MTU); - attrib = g_attrib_new(io, dev->att_mtu, false); + attrib = g_attrib_new(io, BT_ATT_DEFAULT_LE_MTU, false); if (!attrib) { error("Unable to create new GAttrib instance"); return false; @@ -6679,16 +4804,6 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io) bt_att_set_remote_key(dev->att, dev->remote_csrk->key, remote_counter, dev); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (dst_type != BDADDR_BREDR && device_get_rpa_exist(dev) == true) { - bt_att_set_remote_addr(dev->att, - device_get_rpa(dev), BDADDR_LE_RANDOM); - } else { - bt_att_set_remote_addr(dev->att, - &dev->bdaddr, dev->bdaddr_type); - } -#endif - database = btd_adapter_get_database(dev->adapter); src = btd_adapter_get_address(dev->adapter); @@ -6697,12 +4812,12 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io) dst = device_get_address(dev); ba2str(dst, dstaddr); - gatt_client_init(dev); - gatt_server_init(dev, btd_gatt_database_get_db(database)); - if (gatt_db_isempty(dev->db)) load_gatt_db(dev, srcaddr, dstaddr); + gatt_client_init(dev); + gatt_server_init(dev, btd_gatt_database_get_db(database)); + /* * Remove the device from the connect_list and give the passive * scanning another chance to be restarted in case there are @@ -6710,18 +4825,12 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io) */ adapter_connect_list_remove(dev->adapter, dev); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* load the service changed indication status on connection */ - load_svc_change_indication_status(dev, srcaddr, dstaddr); -#endif - return true; } static void att_connect_cb(GIOChannel *io, GError *gerr, gpointer user_data) { - struct att_callbacks *attcb = user_data; - struct btd_device *device = attcb->user_data; + struct btd_device *device = user_data; DBusMessage *reply; uint8_t io_cap; int err = 0; @@ -6732,8 +4841,20 @@ static void att_connect_cb(GIOChannel *io, GError *gerr, gpointer user_data) if (gerr) { DBG("%s", gerr->message); - if (attcb->err) - attcb->err(gerr, user_data); + if (g_error_matches(gerr, BT_IO_ERROR, ECONNABORTED)) + goto done; + + if (device_get_auto_connect(device)) { + DBG("Enabling automatic connections"); + adapter_connect_list_add(device->adapter, device); + } + + if (device->browse) { + browse_request_complete(device->browse, + device->bdaddr_type, + -ECONNABORTED); + device->browse = NULL; + } err = -ECONNABORTED; goto done; @@ -6742,9 +4863,6 @@ static void att_connect_cb(GIOChannel *io, GError *gerr, gpointer user_data) if (!device_attach_att(device, io)) goto done; - if (attcb->success) - attcb->success(user_data); - if (!device->bonding) goto done; @@ -6763,10 +4881,10 @@ done: bonding_request_free(device->bonding); } - if (device->connect) { - if (!device->le_state.svc_resolved && !err) - device_browse_gatt(device, NULL); + if (!err) + device_browse_gatt(device, NULL); + if (device->connect) { if (err < 0) reply = btd_error_failed(device->connect, strerror(-err)); @@ -6777,28 +4895,11 @@ done: dbus_message_unref(device->connect); device->connect = NULL; } - - g_free(attcb); -} - -static void att_error_cb(const GError *gerr, gpointer user_data) -{ - struct att_callbacks *attcb = user_data; - struct btd_device *device = attcb->user_data; - - if (g_error_matches(gerr, BT_IO_ERROR, ECONNABORTED)) - return; - - if (device_get_auto_connect(device)) { - DBG("Enabling automatic connections"); - adapter_connect_list_add(device->adapter, device); - } } int device_connect_le(struct btd_device *dev) { struct btd_adapter *adapter = dev->adapter; - struct att_callbacks *attcb; BtIOSecLevel sec_level; GIOChannel *io; GError *gerr = NULL; @@ -6812,10 +4913,6 @@ int device_connect_le(struct btd_device *dev) DBG("Connection attempt to: %s", addr); - attcb = g_new0(struct att_callbacks, 1); - attcb->err = att_error_cb; - attcb->user_data = dev; - if (dev->le_state.paired) sec_level = BT_IO_SEC_MEDIUM; else @@ -6825,7 +4922,7 @@ int device_connect_le(struct btd_device *dev) * This connection will help us catch any PDUs that comes before * pairing finishes */ - io = bt_io_connect(att_connect_cb, attcb, NULL, &gerr, + io = bt_io_connect(att_connect_cb, dev, NULL, &gerr, BT_IO_OPT_SOURCE_BDADDR, btd_adapter_get_address(adapter), BT_IO_OPT_SOURCE_TYPE, BDADDR_LE_PUBLIC, @@ -6847,7 +4944,6 @@ int device_connect_le(struct btd_device *dev) error("ATT bt_io_connect(%s): %s", addr, gerr->message); g_error_free(gerr); - g_free(attcb); return -EIO; } @@ -6857,21 +4953,6 @@ int device_connect_le(struct btd_device *dev) return 0; } -static void att_browse_error_cb(const GError *gerr, gpointer user_data) -{ - struct att_callbacks *attcb = user_data; - struct btd_device *device = attcb->user_data; - struct browse_req *req = device->browse; - - device->browse = NULL; - browse_request_complete(req, device->bdaddr_type, -ECONNABORTED); -} - -static void att_browse_cb(gpointer user_data) -{ - DBG("ATT connection successful"); -} - static struct browse_req *browse_request_new(struct btd_device *device, DBusMessage *msg) { @@ -6905,22 +4986,18 @@ static struct browse_req *browse_request_new(struct btd_device *device, static int device_browse_gatt(struct btd_device *device, DBusMessage *msg) { struct btd_adapter *adapter = device->adapter; - struct att_callbacks *attcb; struct browse_req *req; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG(""); -#endif req = browse_request_new(device, msg); if (!req) return -EBUSY; - if (device->attrib) { + if (device->client) { /* * If discovery has not yet completed, then wait for gatt-client * to become ready. */ - if (!device->le_state.svc_resolved) + if (!bt_gatt_client_is_ready(device->client)) return 0; /* @@ -6931,13 +5008,8 @@ static int device_browse_gatt(struct btd_device *device, DBusMessage *msg) return 0; } - attcb = g_new0(struct att_callbacks, 1); - attcb->err = att_browse_error_cb; - attcb->success = att_browse_cb; - attcb->user_data = device; - device->att_io = bt_io_connect(att_connect_cb, - attcb, NULL, NULL, + device, NULL, NULL, BT_IO_OPT_SOURCE_BDADDR, btd_adapter_get_address(adapter), BT_IO_OPT_SOURCE_TYPE, BDADDR_LE_PUBLIC, @@ -6949,187 +5021,63 @@ static int device_browse_gatt(struct btd_device *device, DBusMessage *msg) if (device->att_io == NULL) { device->browse = NULL; - browse_request_free(req); - g_free(attcb); - return -EIO; - } - - return 0; -} - -static uint16_t get_sdp_flags(struct btd_device *device) -{ - uint16_t vid, pid; - - vid = btd_device_get_vendor(device); - pid = btd_device_get_product(device); - - /* Sony DualShock 4 is not respecting negotiated L2CAP MTU. This might - * results in SDP response being dropped by kernel. Workaround this by - * forcing SDP code to use bigger MTU while connecting. - */ - if (vid == 0x054c && pid == 0x05c4) - return SDP_LARGE_MTU; - - if (btd_adapter_ssp_enabled(device->adapter)) - return 0; - - /* if no EIR try matching Sony DualShock 4 with name and class */ - if (!strncmp(device->name, "Wireless Controller", MAX_NAME_LENGTH) && - device->class == 0x2508) - return SDP_LARGE_MTU; - - return 0; -} - -static int device_browse_sdp(struct btd_device *device, DBusMessage *msg) -{ - struct btd_adapter *adapter = device->adapter; - struct browse_req *req; - uuid_t uuid; - int err; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - DBG(""); -#endif - req = browse_request_new(device, msg); - if (!req) - return -EBUSY; - - sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]); - - req->sdp_flags = get_sdp_flags(device); - - err = bt_search_service(btd_adapter_get_address(adapter), - &device->bdaddr, &uuid, browse_cb, req, NULL, - req->sdp_flags); - if (err < 0) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device->browse = NULL; -#endif - browse_request_free(req); - return err; - } - - return err; -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void device_set_last_addr_type(struct btd_device *device, uint8_t type) -{ - if (!device) - return; - - //DBG("Last addr type %d", type); - - device->last_bdaddr_type = type; -} - -gboolean device_is_ipsp_connected(struct btd_device * device) -{ - return device->ipsp_connected; -} - -void device_set_ipsp_connected(struct btd_device *device, gboolean connected, - const unsigned char *ifname) -{ - char *iface_name = NULL; - - if (device == NULL) { - error("device is NULL"); - return; - } - - if (device->ipsp_connected == connected) - return; - - device->ipsp_connected = connected; - - memset(device->if_name, 0, sizeof(device->if_name)); - memcpy(device->if_name, ifname, 16); - iface_name = device->if_name; - - DBG("ipsp_connected %d", connected); - DBG("ipsp_iface: %s is Up !", iface_name); - - g_dbus_emit_signal(dbus_conn, device->path, - DEVICE_INTERFACE, "IpspStateChanged", - DBUS_TYPE_BOOLEAN, &connected, - DBUS_TYPE_STRING, &iface_name, - DBUS_TYPE_INVALID); -} -void device_le_data_length_changed(struct btd_device *device, uint16_t max_tx_octets, - uint16_t max_tx_time, uint16_t max_rx_octets, uint16_t max_rx_time) -{ - if (device == NULL) { - error("device is NULL"); - return; + browse_request_free(req); + return -EIO; } - device->max_tx_octets = max_tx_octets; - device->max_tx_time = max_tx_time; - device->max_rx_octets = max_rx_octets; - device->max_rx_time = max_rx_time; - - DBG("data length changed values :max_tx_octets: %d max_tx_time: %d max_rx_octets: %d max_rx_time: %d", - max_tx_octets, max_tx_time, max_rx_octets, max_rx_time); - - g_dbus_emit_signal(dbus_conn, device->path, - DEVICE_INTERFACE, "LEDataLengthChanged", - DBUS_TYPE_UINT16, &max_tx_octets, - DBUS_TYPE_UINT16, &max_tx_time, - DBUS_TYPE_UINT16, &max_rx_octets, - DBUS_TYPE_UINT16, &max_rx_time, - DBUS_TYPE_INVALID); + return 0; } -const bdaddr_t *device_get_rpa(struct btd_device *device) +static uint16_t get_sdp_flags(struct btd_device *device) { - return device->rpa; -} + uint16_t vid, pid; -const uint8_t *device_get_irk_value(struct btd_device *device) -{ - return device->irk_val; -} + vid = btd_device_get_vendor(device); + pid = btd_device_get_product(device); -bool device_get_rpa_exist(struct btd_device *device) -{ - return device->rpa ? true : false; -} + /* Sony DualShock 4 is not respecting negotiated L2CAP MTU. This might + * results in SDP response being dropped by kernel. Workaround this by + * forcing SDP code to use bigger MTU while connecting. + */ + if (vid == 0x054c && pid == 0x05c4) + return SDP_LARGE_MTU; -void device_set_auth_addr_type(struct btd_device *device, uint8_t type) -{ - if (!device) - return; + if (btd_adapter_ssp_enabled(device->adapter)) + return 0; - DBG("Auth addr type %d", type); + /* if no EIR try matching Sony DualShock 4 with name and class */ + if (!strncmp(device->name, "Wireless Controller", MAX_NAME_LENGTH) && + device->class == 0x2508) + return SDP_LARGE_MTU; - device->auth_bdaddr_type = type; + return 0; } -void device_get_tizen_addr(struct btd_device *device, uint8_t type, - struct device_addr_type *addr) +static int device_browse_sdp(struct btd_device *device, DBusMessage *msg) { - if (!device || !addr) - return; + struct btd_adapter *adapter = device->adapter; + struct browse_req *req; + uuid_t uuid; + int err; - if (type == BDADDR_BREDR) { - bacpy(&addr->bdaddr, &device->bdaddr); - addr->bdaddr_type = BDADDR_BREDR; - return; - } + req = browse_request_new(device, msg); + if (!req) + return -EBUSY; - if (device->rpa) { - bacpy(&addr->bdaddr, device->rpa); - addr->bdaddr_type = BDADDR_LE_RANDOM; - return; + sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]); + + req->sdp_flags = get_sdp_flags(device); + + err = bt_search_service(btd_adapter_get_address(adapter), + &device->bdaddr, &uuid, browse_cb, req, NULL, + req->sdp_flags); + if (err < 0) { + browse_request_free(req); + return err; } - bacpy(&addr->bdaddr, &device->bdaddr); - addr->bdaddr_type = device->bdaddr_type; + return err; } -#endif int device_discover_services(struct btd_device *device) { @@ -7182,6 +5130,9 @@ void btd_device_set_temporary(struct btd_device *device, bool temporary) if (device->temporary == temporary) return; + if (device_address_is_private(device)) + return; + DBG("temporary %d", temporary); device->temporary = temporary; @@ -7217,50 +5168,6 @@ void btd_device_set_trusted(struct btd_device *device, gboolean trusted) DEVICE_INTERFACE, "Trusted"); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void btd_device_set_trusted_profiles(struct btd_device *device, - uint32_t pbap, uint32_t map, uint32_t sap) -{ - if (!device) - return; - DBG("TrustedProfiles Parameters: [PBAP %d] [MAP %d] [SAP %d]", pbap, map, sap); - - if (device->trusted_profiles.pbap == pbap && - device->trusted_profiles.map == map && - device->trusted_profiles.sap == sap) - return; - - device->trusted_profiles.pbap = pbap; - device->trusted_profiles.map = map; - device->trusted_profiles.sap = sap; - - store_device_info(device); - - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "TrustedProfiles"); -} - -void btd_device_set_restricted_profiles(struct btd_device *device, - uint32_t hfp_hs, uint32_t a2dp) -{ - if (!device) - return; - DBG("RestrictedProfiles Parameters: [HFP %d] [A2DP %d]", hfp_hs, a2dp); - - if (device->restricted_profiles.hfp_hs == hfp_hs && - device->restricted_profiles.a2dp == a2dp) - return; - - device->restricted_profiles.hfp_hs = hfp_hs; - device->restricted_profiles.a2dp = a2dp; - - store_device_info(device); - - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "RestrictedProfiles"); -} -#endif - void device_set_bonded(struct btd_device *device, uint8_t bdaddr_type) { if (!device) @@ -7298,15 +5205,6 @@ void device_set_rssi_with_delta(struct btd_device *device, int8_t rssi, if (!device) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (rssi == 0 || device->rssi == 0) { - if (device->rssi == rssi) - return; - } - - device->rssi = rssi; - DBG("rssi %d", rssi); -#else if (rssi == 0 || device->rssi == 0) { if (device->rssi == rssi) return; @@ -7330,7 +5228,6 @@ void device_set_rssi_with_delta(struct btd_device *device, int8_t rssi, device->rssi = rssi; } -#endif g_dbus_emit_property_changed(dbus_conn, device->path, DEVICE_INTERFACE, "RSSI"); @@ -7357,6 +5254,22 @@ void device_set_tx_power(struct btd_device *device, int8_t tx_power) DEVICE_INTERFACE, "TxPower"); } +void device_set_flags(struct btd_device *device, uint8_t flags) +{ + if (!device) + return; + + DBG("flags %d", flags); + + if (device->ad_flags[0] == flags) + return; + + device->ad_flags[0] = flags; + + g_dbus_emit_property_changed(dbus_conn, device->path, + DEVICE_INTERFACE, "AdvertisingFlags"); +} + static gboolean start_discovery(gpointer user_data) { struct btd_device *device = user_data; @@ -7465,36 +5378,14 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type, if (status) { device_cancel_authentication(device, TRUE); device_bonding_failed(device, status); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device->legacy_pairing = false; -#endif return; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device->legacy_pairing = false; -#endif + device_auth_req_free(device); /* If we're already paired nothing more is needed */ - if (state->paired) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (bdaddr_type == BDADDR_BREDR && state->svc_resolved) { - DBG("Link key has been changed. Report it"); - if (!device->rpa) - g_dbus_emit_property_changed(dbus_conn, - device->path, DEVICE_INTERFACE, - "Paired"); - else - DBG("Just overwrite Link key"); - } else if (bdaddr_type == BDADDR_LE_RANDOM || - bdaddr_type == BDADDR_LE_PUBLIC) { - DBG("Long Term Key has been changed. Report it"); - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "Paired"); - } -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ + if (state->paired) return; - } device_set_paired(device, bdaddr_type); @@ -7582,13 +5473,6 @@ unsigned int device_wait_for_svc_complete(struct btd_device *dev, g_source_remove(dev->discov_timer); dev->discov_timer = g_idle_add(start_discovery, dev); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (!dev->browse) { - DBG("Service is not going on. Start discovery"); - dev->discov_timer = g_idle_add(start_discovery, dev); - } else - DBG("Wait for service discovery"); -#endif return cb->id; } @@ -7694,19 +5578,8 @@ void device_bonding_failed(struct btd_device *device, uint8_t status) DBG("status %u", status); - if (!bonding) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->legacy_pairing) { - DBG("Emit LegacyPaired"); - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "LegacyPaired"); - } -#endif + if (!bonding) return; - } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - btd_device_set_temporary(device, TRUE); -#endif if (device->authr) device_cancel_authentication(device, FALSE); @@ -7751,16 +5624,9 @@ static void confirm_cb(struct agent *agent, DBusError *err, void *data) if (auth->agent == NULL) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY btd_adapter_confirm_reply(device->adapter, &device->bdaddr, - device->auth_bdaddr_type, - err ? FALSE : TRUE); - device_set_auth_addr_type(device, BDADDR_BREDR); -#else - btd_adapter_confirm_reply(device->adapter, &device->bdaddr, - device->bdaddr_type, + auth->addr_type, err ? FALSE : TRUE); -#endif agent_unref(device->authr->agent); device->authr->agent = NULL; @@ -7779,14 +5645,8 @@ static void passkey_cb(struct agent *agent, DBusError *err, if (err) passkey = INVALID_PASSKEY; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - btd_adapter_passkey_reply(device->adapter, &device->bdaddr, - device->auth_bdaddr_type, passkey); - device_set_auth_addr_type(device, BDADDR_BREDR); -#else btd_adapter_passkey_reply(device->adapter, &device->bdaddr, - device->bdaddr_type, passkey); -#endif + auth->addr_type, passkey); agent_unref(device->authr->agent); device->authr->agent = NULL; @@ -7804,7 +5664,9 @@ static void display_pincode_cb(struct agent *agent, DBusError *err, void *data) } static struct authentication_req *new_auth(struct btd_device *device, - auth_type_t type, gboolean secure) + uint8_t addr_type, + auth_type_t type, + gboolean secure) { struct authentication_req *auth; struct agent *agent; @@ -7832,6 +5694,7 @@ static struct authentication_req *new_auth(struct btd_device *device, auth->agent = agent; auth->device = device; auth->type = type; + auth->addr_type = addr_type; auth->secure = secure; device->authr = auth; @@ -7843,7 +5706,7 @@ int device_request_pincode(struct btd_device *device, gboolean secure) struct authentication_req *auth; int err; - auth = new_auth(device, AUTH_TYPE_PINCODE, secure); + auth = new_auth(device, BDADDR_BREDR, AUTH_TYPE_PINCODE, secure); if (!auth) return -EPERM; @@ -7857,12 +5720,12 @@ int device_request_pincode(struct btd_device *device, gboolean secure) return err; } -int device_request_passkey(struct btd_device *device) +int device_request_passkey(struct btd_device *device, uint8_t type) { struct authentication_req *auth; int err; - auth = new_auth(device, AUTH_TYPE_PASSKEY, FALSE); + auth = new_auth(device, type, AUTH_TYPE_PASSKEY, FALSE); if (!auth) return -EPERM; @@ -7876,20 +5739,19 @@ int device_request_passkey(struct btd_device *device) return err; } -int device_confirm_passkey(struct btd_device *device, uint32_t passkey, - uint8_t confirm_hint) - +int device_confirm_passkey(struct btd_device *device, uint8_t type, + int32_t passkey, uint8_t confirm_hint) { struct authentication_req *auth; int err; - auth = new_auth(device, AUTH_TYPE_CONFIRM, FALSE); + auth = new_auth(device, type, AUTH_TYPE_CONFIRM, FALSE); if (!auth) return -EPERM; auth->passkey = passkey; - if (!TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY && confirm_hint) + if (confirm_hint) err = agent_request_authorization(auth->agent, device, confirm_cb, auth, NULL); else @@ -7904,8 +5766,8 @@ int device_confirm_passkey(struct btd_device *device, uint32_t passkey, return err; } -int device_notify_passkey(struct btd_device *device, uint32_t passkey, - uint8_t entered) +int device_notify_passkey(struct btd_device *device, uint8_t type, + uint32_t passkey, uint8_t entered) { struct authentication_req *auth; int err; @@ -7915,7 +5777,7 @@ int device_notify_passkey(struct btd_device *device, uint32_t passkey, if (auth->type != AUTH_TYPE_NOTIFY_PASSKEY) return -EPERM; } else { - auth = new_auth(device, AUTH_TYPE_NOTIFY_PASSKEY, FALSE); + auth = new_auth(device, type, AUTH_TYPE_NOTIFY_PASSKEY, FALSE); if (!auth) return -EPERM; } @@ -7935,7 +5797,7 @@ int device_notify_pincode(struct btd_device *device, gboolean secure, struct authentication_req *auth; int err; - auth = new_auth(device, AUTH_TYPE_NOTIFY_PINCODE, secure); + auth = new_auth(device, BDADDR_BREDR, AUTH_TYPE_NOTIFY_PINCODE, secure); if (!auth) return -EPERM; @@ -8004,23 +5866,12 @@ void device_cancel_authentication(struct btd_device *device, gboolean aborted) cancel_authentication(auth); device_auth_req_free(device); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - device_set_auth_addr_type(device, BDADDR_BREDR); -#endif } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -gboolean device_is_authenticating(struct btd_device *dev, uint8_t bdaddr_type) -{ - return (dev->auth_bdaddr_type == bdaddr_type && dev->authr != NULL); -} -#else gboolean device_is_authenticating(struct btd_device *device) { return (device->authr != NULL); } -#endif struct gatt_primary *btd_device_get_primary(struct btd_device *device, const char *uuid) @@ -8055,6 +5906,14 @@ struct bt_gatt_client *btd_device_get_gatt_client(struct btd_device *device) return device->client; } +void *btd_device_get_attrib(struct btd_device *device) +{ + if (!device) + return NULL; + + return device->attrib; +} + struct bt_gatt_server *btd_device_get_gatt_server(struct btd_device *device) { if (!device) @@ -8107,11 +5966,6 @@ static sdp_list_t *read_device_records(struct btd_device *device) ba2str(btd_adapter_get_address(device->adapter), local); ba2str(&device->bdaddr, peer); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (device->rpa) - ba2str(device->rpa, peer); -#endif - snprintf(filename, PATH_MAX, STORAGEDIR "/%s/cache/%s", local, peer); key_file = g_key_file_new(); @@ -8199,213 +6053,6 @@ void device_set_appearance(struct btd_device *device, uint16_t value) store_device_info(device); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int device_get_rpa_res_char_value(struct btd_device *device) -{ - return device->rpa_res_support; -} - -/* Store the RPA Resolution Characteristic Value of remote device. - * This value would be checked before start directed advertising using RPA. - */ -void device_set_rpa_res_char_value(struct btd_device *device, uint8_t value) -{ - if (device->rpa_res_support == value) - return; - - device->rpa_res_support = value; - store_device_info(device); -} - -void device_set_manufacturer_info(struct btd_device *device, struct eir_data *eir) -{ - if (!device) - return; - - if (eir->manufacturer_data_len == 0) - return; - - device->manufacturer_data = g_memdup(eir->manufacturer_data, - eir->manufacturer_data_len); - device->manufacturer_data_len = eir->manufacturer_data_len; - - store_device_info(device); - - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "ManufacturerDataLen"); - - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "ManufacturerData"); -} - - -void device_set_adv_report_info(struct btd_device *device, void *data, uint8_t data_len, - uint8_t adv_type, int8_t rssi) -{ - if (!device) - return; - - char peer_addr[18]; - const char *paddr = peer_addr; - dbus_int32_t rssi_val = rssi; - int adv_len = data_len; - uint8_t addr_type; - - ba2str(&device->bdaddr, peer_addr); - - /* Replace address type for paired RPA device since IDA passed from controller */ - if (device->rpa) - addr_type = BDADDR_LE_RANDOM; - else - addr_type = device->bdaddr_type; - - g_dbus_emit_signal(dbus_conn, device->path, - DEVICE_INTERFACE, "AdvReport", - DBUS_TYPE_STRING, &paddr, - DBUS_TYPE_BYTE, &addr_type, - DBUS_TYPE_BYTE, &adv_type, - DBUS_TYPE_INT32, &rssi_val, - DBUS_TYPE_INT32, &adv_len, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &data, data_len, - DBUS_TYPE_INVALID); -} - -void device_set_payload_timeout(struct btd_device *device, - uint16_t payload_timeout) -{ - if (!device) - return; - if (device->auth_payload_timeout == payload_timeout) - return; - - DBG("Payload timeout %d", payload_timeout); - - device->auth_payload_timeout = payload_timeout; - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "PayloadTimeout"); -} - -void device_set_disconnect_reason(struct btd_device *device, uint8_t reason) -{ - device->disc_reason = reason; -} - -void btd_device_disconnect(struct btd_device *device) -{ - char dst[18]; - struct btd_service *service; - btd_service_state_t state; - - ba2str(&device->bdaddr, dst); - - DBG(""); - if (device->bredr_state.connected == false) - return; - - service = btd_device_get_service(device, HFP_HS_UUID); - if (!service) - return; - - state = btd_service_get_state(service); - DBG("Connected State : %d", state); - - if (state == BTD_SERVICE_STATE_DISCONNECTED) { - btd_adapter_disconnect_device(device->adapter, &device->bdaddr, - BDADDR_BREDR); - } - - return; -} - -#endif - -static gboolean notify_attios(gpointer user_data) -{ - struct btd_device *device = user_data; - - DBG(""); - - if (device->attrib == NULL) - return FALSE; - - g_slist_foreach(device->attios_offline, attio_connected, device->attrib); - device->attios = g_slist_concat(device->attios, device->attios_offline); - device->attios_offline = NULL; - - return FALSE; -} - -guint btd_device_add_attio_callback(struct btd_device *device, - attio_connect_cb cfunc, - attio_disconnect_cb dcfunc, - gpointer user_data) -{ - struct attio_data *attio; - static guint attio_id = 0; - - DBG("%p registered ATT connection callback", device); - - attio = g_new0(struct attio_data, 1); - attio->id = ++attio_id; - attio->cfunc = cfunc; - attio->dcfunc = dcfunc; - attio->user_data = user_data; - -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - device_set_auto_connect(device, TRUE); -#endif - - /* Check if there is no GAttrib associated to the device created by a - * incoming connection */ - if (!device->attrib) - device->attrib = attrib_from_device(device); - - if (device->attrib && cfunc) { - device->attios_offline = g_slist_append(device->attios_offline, - attio); - g_idle_add(notify_attios, device); - return attio->id; - } - - device->attios = g_slist_append(device->attios, attio); - - return attio->id; -} - -static int attio_id_cmp(gconstpointer a, gconstpointer b) -{ - const struct attio_data *attio = a; - guint id = GPOINTER_TO_UINT(b); - - return attio->id - id; -} - -gboolean btd_device_remove_attio_callback(struct btd_device *device, guint id) -{ - struct attio_data *attio; - GSList *l; - - l = g_slist_find_custom(device->attios, GUINT_TO_POINTER(id), - attio_id_cmp); - if (l) { - attio = l->data; - device->attios = g_slist_remove(device->attios, attio); - } else { - l = g_slist_find_custom(device->attios_offline, - GUINT_TO_POINTER(id), attio_id_cmp); - if (!l) - return FALSE; - - attio = l->data; - device->attios_offline = g_slist_remove(device->attios_offline, - attio); - } - - g_free(attio); - - return TRUE; -} - void btd_device_set_pnpid(struct btd_device *device, uint16_t source, uint16_t vendor, uint16_t product, uint16_t version) { @@ -8436,26 +6083,8 @@ static void service_state_changed(struct btd_service *service, struct btd_device *device = btd_service_get_device(service); int err = btd_service_get_error(service); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!err) { - if (old_state == BTD_SERVICE_STATE_UNAVAILABLE || - new_state == BTD_SERVICE_STATE_UNAVAILABLE) - DBG("Skip status updating ([%d] -> [%d])", old_state, new_state); - else - g_dbus_emit_signal(dbus_conn, device->path, - DEVICE_INTERFACE, "ProfileStateChanged", - DBUS_TYPE_STRING, &profile->remote_uuid, - DBUS_TYPE_INT32, &new_state, - DBUS_TYPE_INVALID); - } - - if (new_state == BTD_SERVICE_STATE_CONNECTING || - new_state == BTD_SERVICE_STATE_DISCONNECTING || - new_state == BTD_SERVICE_STATE_UNAVAILABLE) -#else if (new_state == BTD_SERVICE_STATE_CONNECTING || new_state == BTD_SERVICE_STATE_DISCONNECTING) -#endif return; if (old_state == BTD_SERVICE_STATE_CONNECTING) @@ -8475,13 +6104,6 @@ struct btd_service *btd_device_get_service(struct btd_device *dev, if (g_str_equal(p->remote_uuid, remote_uuid)) return service; - -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (g_str_equal(HID_UUID, remote_uuid)) { - if (strcmp(p->name, "hid-device") == 0) - return service; - } -#endif } return NULL; @@ -8498,21 +6120,3 @@ void btd_device_cleanup(void) { btd_service_remove_state_cb(service_state_cb_id); } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void btd_device_set_legacy_pairing(struct btd_device *dev, bool legacy_pairing) -{ - dev->legacy_pairing = legacy_pairing; -} - -void btd_device_set_svc_changed_indication(struct btd_device *dev, bool value) -{ - bt_att_set_svc_changed_indication_registered(dev->att, value); - store_device_info(dev); -} - -bool btd_device_get_svc_changed_indication(struct btd_device *dev) -{ - return bt_att_get_svc_changed_indication_registered(dev->att); -} -#endif diff --git a/src/device.h b/src/device.h old mode 100644 new mode 100755 index d00a93c..3cab366 --- a/src/device.h +++ b/src/device.h @@ -26,13 +26,6 @@ struct btd_device; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -/* Device Physical channel connection Type */ -#define DEV_CONN_DEFAULT 0xFF /* Represents support for BREDR and LE */ -#define DEV_CONN_BREDR 0x00 /* Only BREDR */ -#define DEV_CONN_LE 0x01 /* Only LE*/ -#endif - struct btd_device *device_create(struct btd_adapter *adapter, const bdaddr_t *address, uint8_t bdaddr_type); struct btd_device *device_create_from_storage(struct btd_adapter *adapter, @@ -66,9 +59,6 @@ struct device_addr_type { uint8_t bdaddr_type; }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int device_addr_type_strict_cmp(gconstpointer a, gconstpointer b); -#endif int device_addr_type_cmp(gconstpointer a, gconstpointer b); GSList *btd_device_get_uuids(struct btd_device *device); void device_probe_profiles(struct btd_device *device, GSList *profiles); @@ -80,6 +70,7 @@ GSList *btd_device_get_primaries(struct btd_device *device); struct gatt_db *btd_device_get_gatt_db(struct btd_device *device); struct bt_gatt_client *btd_device_get_gatt_client(struct btd_device *device); struct bt_gatt_server *btd_device_get_gatt_server(struct btd_device *device); +void *btd_device_get_attrib(struct btd_device *device); void btd_device_gatt_set_service_changed(struct btd_device *device, uint16_t start, uint16_t end); bool device_attach_att(struct btd_device *dev, GIOChannel *io); @@ -92,26 +83,6 @@ void device_remove_profile(gpointer a, gpointer b); struct btd_adapter *device_get_adapter(struct btd_device *device); const bdaddr_t *device_get_address(struct btd_device *device); const char *device_get_path(const struct btd_device *device); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void device_set_remote_feature_flag(struct btd_device *device, int flags); -gboolean device_is_bredrle(struct btd_device *device); -void device_set_disconnect_reason(struct btd_device *device, uint8_t reason); -void device_set_gatt_connected(struct btd_device *device, gboolean connected); -void device_unpair(struct btd_device *device, gboolean remove_stored); -gboolean device_get_gatt_connected(const struct btd_device *device); -void device_set_rpa(struct btd_device *device, const bdaddr_t *rpa_addr); -const bdaddr_t *device_get_rpa(struct btd_device *device); -bool device_get_rpa_exist(struct btd_device *device); -int device_rpa_cmp(gconstpointer a, gconstpointer b); -int device_addr_cmp(gconstpointer a, gconstpointer b); -void device_remove_stored_folder(struct btd_device *device); -const uint8_t *device_get_irk_value(struct btd_device *device); -void device_set_irk_value(struct btd_device *device, const uint8_t *val); -void device_set_conn_update_state(struct btd_device *device, bool state); -bool device_get_conn_update_state(struct btd_device *device); -void btd_device_set_trusted_profiles(struct btd_device *device, - uint32_t pbap, uint32_t map, uint32_t sap); -#endif gboolean device_is_temporary(struct btd_device *device); bool device_is_paired(struct btd_device *device, uint8_t bdaddr_type); bool device_is_bonded(struct btd_device *device, uint8_t bdaddr_type); @@ -126,6 +97,7 @@ void device_set_rssi_with_delta(struct btd_device *device, int8_t rssi, int8_t delta_threshold); void device_set_rssi(struct btd_device *device, int8_t rssi); void device_set_tx_power(struct btd_device *device, int8_t tx_power); +void device_set_flags(struct btd_device *device, uint8_t flags); bool btd_device_is_connected(struct btd_device *dev); uint8_t btd_device_get_bdaddr_type(struct btd_device *dev); bool device_is_retrying(struct btd_device *device); @@ -139,19 +111,15 @@ int device_bonding_attempt_retry(struct btd_device *device); long device_bonding_last_duration(struct btd_device *device); void device_bonding_restart_timer(struct btd_device *device); int device_request_pincode(struct btd_device *device, gboolean secure); -int device_request_passkey(struct btd_device *device); -int device_confirm_passkey(struct btd_device *device, uint32_t passkey, - uint8_t confirm_hint); -int device_notify_passkey(struct btd_device *device, uint32_t passkey, - uint8_t entered); +int device_request_passkey(struct btd_device *device, uint8_t type); +int device_confirm_passkey(struct btd_device *device, uint8_t type, + int32_t passkey, uint8_t confirm_hint); +int device_notify_passkey(struct btd_device *device, uint8_t type, + uint32_t passkey, uint8_t entered); int device_notify_pincode(struct btd_device *device, gboolean secure, const char *pincode); void device_cancel_authentication(struct btd_device *device, gboolean aborted); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -gboolean device_is_authenticating(struct btd_device *dev, uint8_t bdaddr_type); -#else gboolean device_is_authenticating(struct btd_device *device); -#endif void device_add_connection(struct btd_device *dev, uint8_t bdaddr_type); void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type); void device_request_disconnect(struct btd_device *device, DBusMessage *msg); @@ -167,27 +135,6 @@ void device_remove_disconnect_watch(struct btd_device *device, guint id); int device_get_appearance(struct btd_device *device, uint16_t *value); void device_set_appearance(struct btd_device *device, uint16_t value); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct eir_data; -void device_set_manufacturer_info(struct btd_device *dev, struct eir_data *eir); -void device_set_adv_report_info(struct btd_device *device, void *data, - uint8_t data_len, uint8_t adv_info, int8_t rssi); -void device_set_payload_timeout(struct btd_device *device, - uint16_t payload_timeout); -void device_set_auth_addr_type(struct btd_device *device, uint8_t type); -void device_set_last_addr_type(struct btd_device *device, uint8_t type); -gboolean device_is_ipsp_connected(struct btd_device * device); -void device_set_ipsp_connected(struct btd_device *device, gboolean connected, - const unsigned char *ifname); -int device_get_rpa_res_char_value(struct btd_device *device); -void device_set_rpa_res_char_value(struct btd_device *device, uint8_t value); -void device_le_data_length_changed(struct btd_device *device, uint16_t max_tx_octets, - uint16_t max_tx_time, uint16_t max_rx_octets, - uint16_t max_rx_time); -void device_get_tizen_addr(struct btd_device *device, uint8_t type, - struct device_addr_type *addr); -#endif - struct btd_device *btd_device_ref(struct btd_device *device); void btd_device_unref(struct btd_device *device); @@ -211,23 +158,6 @@ bool device_remove_svc_complete_callback(struct btd_device *dev, struct btd_service *btd_device_get_service(struct btd_device *dev, const char *remote_uuid); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void device_print_addr(struct btd_device *dev); -gboolean device_is_profile_trusted(struct btd_device *device, - const char *uuid); -gboolean device_is_profile_blocked(struct btd_device *device, - const char *uuid); -gboolean device_is_profile_restricted(struct btd_device *device, - const char *uuid); -void btd_device_disconnect(struct btd_device *dev); -void btd_device_set_legacy_pairing(struct btd_device *dev, bool legacy_pairing); -void btd_device_set_svc_changed_indication(struct btd_device *dev, bool value); -bool btd_device_get_svc_changed_indication(struct btd_device *dev); -#ifdef TIZEN_FEATURE_BLUEZ_BATTERY_WATCH -void device_change_pkt_type(gpointer data, gpointer user_data); -#endif /* TIZEN_FEATURE_BLUEZ_BATTERY_WATCH */ -#endif - int device_discover_services(struct btd_device *device); int btd_device_connect_services(struct btd_device *dev, GSList *services); diff --git a/src/eir.c b/src/eir.c old mode 100644 new mode 100755 index ee5975a..c984fa5 --- a/src/eir.c +++ b/src/eir.c @@ -65,10 +65,6 @@ void eir_data_free(struct eir_data *eir) eir->msd_list = NULL; g_slist_free_full(eir->sd_list, sd_free); eir->sd_list = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - g_free(eir->manufacturer_data); - eir->manufacturer_data = NULL; -#endif } static void eir_parse_uuid16(struct eir_data *eir, const void *data, @@ -132,26 +128,6 @@ static void eir_parse_uuid128(struct eir_data *eir, const uint8_t *data, static char *name2utf8(const uint8_t *name, uint8_t len) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *utf8_name; - char *in_name; - char *ptr; - - in_name = g_malloc0(sizeof(char) * (len + 1)); - /* Fix : NULL_RETURNS */ - if (in_name == NULL) - return NULL; - memcpy(in_name, name, sizeof(char) * len); - in_name[len] = '\0'; - - if (!g_utf8_validate(in_name, -1, (const char **)&ptr)) - *ptr = '\0'; - - utf8_name = g_strdup(in_name); - g_free(in_name); - - return utf8_name; -#else char utf8_name[HCI_MAX_NAME_LENGTH + 2]; int i; @@ -171,7 +147,6 @@ static char *name2utf8(const uint8_t *name, uint8_t len) g_strstrip(utf8_name); return g_strdup(utf8_name); -#endif } static void eir_parse_msd(struct eir_data *eir, const uint8_t *data, @@ -368,14 +343,6 @@ void eir_parse(struct eir_data *eir, const uint8_t *eir_data, uint8_t eir_len) break; case EIR_MANUFACTURER_DATA: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (data_len < 1) - break; - - eir->manufacturer_data = g_memdup(data, - data_len); - eir->manufacturer_data_len = data_len; -#endif eir_parse_msd(eir, data, data_len); break; diff --git a/src/eir.h b/src/eir.h old mode 100644 new mode 100755 index 5e8bbd5..219ee79 --- a/src/eir.h +++ b/src/eir.h @@ -92,10 +92,6 @@ struct eir_data { uint16_t did_source; GSList *msd_list; GSList *sd_list; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *manufacturer_data; - uint8_t manufacturer_data_len; -#endif }; void eir_data_free(struct eir_data *eir); diff --git a/src/error.c b/src/error.c old mode 100644 new mode 100755 diff --git a/src/error.h b/src/error.h old mode 100644 new mode 100755 diff --git a/src/gatt-client.c b/src/gatt-client.c old mode 100644 new mode 100755 index 87e363c..114981c --- a/src/gatt-client.c +++ b/src/gatt-client.c @@ -23,6 +23,7 @@ #include #include +#include #include @@ -61,9 +62,6 @@ struct btd_gatt_client { struct queue *services; struct queue *all_notify_clients; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - guint wait_charcs_id; -#endif }; struct service { @@ -74,12 +72,17 @@ struct service { bt_uuid_t uuid; char *path; struct queue *chrcs; - bool chrcs_ready; - struct queue *pending_ext_props; - guint idle_id; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - guint idle_id2; -#endif +}; + +typedef bool (*async_dbus_op_complete_t)(void *data); + +struct async_dbus_op { + int ref_count; + unsigned int id; + struct queue *msgs; + void *data; + uint16_t offset; + async_dbus_op_complete_t complete; }; struct characteristic { @@ -93,8 +96,8 @@ struct characteristic { bt_uuid_t uuid; char *path; - unsigned int read_id; - unsigned int write_id; + struct async_dbus_op *read_op; + struct async_dbus_op *write_op; struct queue *descs; @@ -109,8 +112,8 @@ struct descriptor { bt_uuid_t uuid; char *path; - unsigned int read_id; - unsigned int write_id; + struct async_dbus_op *read_op; + struct async_dbus_op *write_op; }; static bool uuid_cmp(const bt_uuid_t *uuid, uint16_t u16) @@ -181,7 +184,7 @@ static void read_check_cb(struct gatt_db_attribute *attrib, int err, { gboolean *ret = user_data; - if (err || length == 0) { + if (err) { *ret = FALSE; return; } @@ -200,88 +203,24 @@ static gboolean descriptor_value_exists(const GDBusPropertyTable *property, return ret; } -static bool parse_value_arg(DBusMessage *msg, uint8_t **value, - size_t *value_len) +static int parse_value_arg(DBusMessageIter *iter, uint8_t **value, int *len) { - DBusMessageIter iter, array; - uint8_t *val; - int len; - - if (!dbus_message_iter_init(msg, &iter)) - return false; - - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) - return false; - - dbus_message_iter_recurse(&iter, &array); - dbus_message_iter_get_fixed_array(&array, &val, &len); - dbus_message_iter_next(&iter); - - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_INVALID) - return false; - - if (len < 0) - return false; - - *value = val; - *value_len = len; - - return true; -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static bool parse_type_value_arg(DBusMessage *msg, uint8_t *type, uint8_t **value, - size_t *value_len) -{ - DBusMessageIter iter; DBusMessageIter array; - uint8_t *val; - int len; - - if (!dbus_message_iter_init(msg, &iter)) - return false; - - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_BYTE) - return false; - dbus_message_iter_get_basic(&iter, type); - dbus_message_iter_next(&iter); - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) - return false; + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) + return -EINVAL; - dbus_message_iter_recurse(&iter, &array); - dbus_message_iter_get_fixed_array(&array, &val, &len); - dbus_message_iter_next(&iter); + dbus_message_iter_recurse(iter, &array); + dbus_message_iter_get_fixed_array(&array, value, len); - if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_INVALID) - return false; - - if (len < 0) - return false; - - *value = val; - *value_len = len; - - return true; + return 0; } -#endif - -typedef bool (*async_dbus_op_complete_t)(void *data); - -struct async_dbus_op { - int ref_count; - DBusMessage *msg; - void *data; - uint16_t offset; - async_dbus_op_complete_t complete; -}; static void async_dbus_op_free(void *data) { struct async_dbus_op *op = data; - if (op->msg) - dbus_message_unref(op->msg); + queue_destroy(op->msgs, (void *)dbus_message_unref); free(op); } @@ -357,27 +296,44 @@ static void write_descriptor_cb(struct gatt_db_attribute *attr, int err, GATT_DESCRIPTOR_IFACE, "Value"); } -static void read_op_cb(struct gatt_db_attribute *attrib, int err, - const uint8_t *value, size_t length, - void *user_data) +static void async_dbus_op_reply(struct async_dbus_op *op, int err, + const uint8_t *value, ssize_t length) { - struct async_dbus_op *op = user_data; + const struct queue_entry *entry; DBusMessage *reply; - if (err) { - error("Failed to read attribute"); - return; - } + op->id = 0; - reply = g_dbus_create_reply(op->msg, DBUS_TYPE_INVALID); - if (!reply) { - error("Failed to allocate D-Bus message reply"); - return; + for (entry = queue_get_entries(op->msgs); entry; entry = entry->next) { + DBusMessage *msg = entry->data; + + if (err) { + reply = err > 0 ? create_gatt_dbus_error(msg, err) : + btd_error_failed(msg, strerror(-err)); + goto send_reply; + } + + reply = g_dbus_create_reply(msg, DBUS_TYPE_INVALID); + if (!reply) { + error("Failed to allocate D-Bus message reply"); + return; + } + + if (length >= 0) + message_append_byte_array(reply, value, length); + +send_reply: + g_dbus_send_message(btd_get_dbus_connection(), reply); } +} - message_append_byte_array(reply, value, length); +static void read_op_cb(struct gatt_db_attribute *attrib, int err, + const uint8_t *value, size_t length, + void *user_data) +{ + struct async_dbus_op *op = user_data; - g_dbus_send_message(btd_get_dbus_connection(), reply); + async_dbus_op_reply(op, err, value, length); } static void desc_read_cb(bool success, uint8_t att_ecode, @@ -386,8 +342,6 @@ static void desc_read_cb(bool success, uint8_t att_ecode, { struct async_dbus_op *op = user_data; struct descriptor *desc = op->data; - struct service *service = desc->chrc->service; - DBusMessage *reply; if (!success) goto fail; @@ -398,42 +352,91 @@ static void desc_read_cb(bool success, uint8_t att_ecode, if (!gatt_db_attribute_write(desc->attr, op->offset, value, length, 0, NULL, write_descriptor_cb, desc)) { error("Failed to store attribute"); + att_ecode = BT_ATT_ERROR_UNLIKELY; goto fail; } - /* - * If the value length is exactly MTU-1, then we may not have read the - * entire value. Perform a long read to obtain the rest, otherwise, - * we're done. - */ - if (length == bt_gatt_client_get_mtu(service->client->gatt) - 1) { - op->offset += length; - desc->read_id = bt_gatt_client_read_long_value( - service->client->gatt, - desc->handle, - op->offset, - desc_read_cb, - async_dbus_op_ref(op), - async_dbus_op_unref); - if (desc->read_id) - return; - } - /* Read the stored data from db */ if (!gatt_db_attribute_read(desc->attr, 0, 0, NULL, read_op_cb, op)) { error("Failed to read database"); + att_ecode = BT_ATT_ERROR_UNLIKELY; goto fail; } - desc->read_id = 0; + desc->read_op = NULL; return; fail: - reply = create_gatt_dbus_error(op->msg, att_ecode); - desc->read_id = 0; - g_dbus_send_message(btd_get_dbus_connection(), reply); - return; + async_dbus_op_reply(op, att_ecode, NULL, 0); + desc->read_op = NULL; +} + +static int parse_options(DBusMessageIter *iter, uint16_t *offset) +{ + DBusMessageIter dict; + + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) + return -EINVAL; + + dbus_message_iter_recurse(iter, &dict); + + while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) { + const char *key; + DBusMessageIter value, entry; + int var; + + dbus_message_iter_recurse(&dict, &entry); + dbus_message_iter_get_basic(&entry, &key); + + dbus_message_iter_next(&entry); + dbus_message_iter_recurse(&entry, &value); + + var = dbus_message_iter_get_arg_type(&value); + if (strcasecmp(key, "offset") == 0) { + if (var != DBUS_TYPE_UINT16) + return -EINVAL; + dbus_message_iter_get_basic(&value, offset); + } + + dbus_message_iter_next(&dict); + } + + return 0; +} + +static struct async_dbus_op *async_dbus_op_new(DBusMessage *msg, void *data) +{ + struct async_dbus_op *op; + + op = new0(struct async_dbus_op, 1); + op->msgs = queue_new(); + queue_push_tail(op->msgs, dbus_message_ref(msg)); + op->data = data; + + return op; +} + +static struct async_dbus_op *read_value(struct bt_gatt_client *gatt, + DBusMessage *msg, uint16_t handle, + uint16_t offset, + bt_gatt_client_read_callback_t callback, + void *data) +{ + struct async_dbus_op *op; + + op = async_dbus_op_new(msg, data); + op->offset = offset; + + op->id = bt_gatt_client_read_long_value(gatt, handle, offset, callback, + async_dbus_op_ref(op), + async_dbus_op_unref); + if (op->id) + return op; + + async_dbus_op_free(op); + + return NULL; } static DBusMessage *descriptor_read_value(DBusConnection *conn, @@ -441,164 +444,113 @@ static DBusMessage *descriptor_read_value(DBusConnection *conn, { struct descriptor *desc = user_data; struct bt_gatt_client *gatt = desc->chrc->service->client->gatt; - struct async_dbus_op *op; + DBusMessageIter iter; + uint16_t offset = 0; if (!gatt) return btd_error_failed(msg, "Not connected"); - if (desc->read_id) - return btd_error_in_progress(msg); + dbus_message_iter_init(msg, &iter); - op = new0(struct async_dbus_op, 1); - op->msg = dbus_message_ref(msg); - op->data = desc; - - desc->read_id = bt_gatt_client_read_value(gatt, desc->handle, - desc_read_cb, - async_dbus_op_ref(op), - async_dbus_op_unref); - if (desc->read_id) + if (parse_options(&iter, &offset)) + return btd_error_invalid_args(msg); + + if (desc->read_op) { + if (desc->read_op->offset != offset) + return btd_error_in_progress(msg); + queue_push_tail(desc->read_op->msgs, dbus_message_ref(msg)); return NULL; + } - async_dbus_op_free(op); + desc->read_op = read_value(gatt, msg, desc->handle, offset, + desc_read_cb, desc); + if (!desc->read_op) + return btd_error_failed(msg, "Failed to send read request"); - return btd_error_failed(msg, "Failed to send read request"); + return NULL; } static void write_result_cb(bool success, bool reliable_error, uint8_t att_ecode, void *user_data) { struct async_dbus_op *op = user_data; - DBusMessage *reply; + int err = 0; if (op->complete && !op->complete(op->data)) { - reply = btd_error_failed(op->msg, "Operation failed"); + err = -EFAULT; goto done; } if (!success) { if (reliable_error) - reply = btd_error_failed(op->msg, - "Reliable write failed"); - else { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - reply = dbus_message_new_method_return(op->msg); - if (!reply) { - error("Failed to allocate D-Bus message reply"); - return; - } - dbus_message_append_args(reply, - DBUS_TYPE_BYTE, &att_ecode, - DBUS_TYPE_INVALID); -#else - reply = create_gatt_dbus_error(op->msg, att_ecode); -#endif - } - - goto done; - } - - reply = g_dbus_create_reply(op->msg, DBUS_TYPE_INVALID); - if (!reply) { - error("Failed to allocate D-Bus message reply"); - return; + err = -EFAULT; + else + err = att_ecode; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - dbus_message_append_args(reply, - DBUS_TYPE_BYTE, &att_ecode, - DBUS_TYPE_INVALID); -#endif done: - g_dbus_send_message(btd_get_dbus_connection(), reply); + async_dbus_op_reply(op, err, NULL, -1); } - static void write_cb(bool success, uint8_t att_ecode, void *user_data) { write_result_cb(success, false, att_ecode, user_data); } -static unsigned int start_long_write(DBusMessage *msg, uint16_t handle, +static struct async_dbus_op *start_long_write(DBusMessage *msg, uint16_t handle, struct bt_gatt_client *gatt, bool reliable, const uint8_t *value, - size_t value_len, void *data, + size_t value_len, uint16_t offset, + void *data, async_dbus_op_complete_t complete) { struct async_dbus_op *op; - unsigned int id; - op = new0(struct async_dbus_op, 1); - op->msg = dbus_message_ref(msg); - op->data = data; + op = async_dbus_op_new(msg, data); op->complete = complete; + op->offset = offset; - id = bt_gatt_client_write_long_value(gatt, reliable, handle, - 0, value, value_len, + op->id = bt_gatt_client_write_long_value(gatt, reliable, handle, offset, + value, value_len, write_result_cb, op, async_dbus_op_free); - if (!id) + if (!op->id) { async_dbus_op_free(op); + return NULL; + } - return id; + return op; } -static unsigned int start_write_request(DBusMessage *msg, uint16_t handle, +static struct async_dbus_op *start_write_request(DBusMessage *msg, + uint16_t handle, struct bt_gatt_client *gatt, const uint8_t *value, size_t value_len, void *data, async_dbus_op_complete_t complete) { struct async_dbus_op *op; - unsigned int id; - op = new0(struct async_dbus_op, 1); - op->msg = dbus_message_ref(msg); - op->data = data; + op = async_dbus_op_new(msg, data); op->complete = complete; - id = bt_gatt_client_write_value(gatt, handle, value, value_len, + op->id = bt_gatt_client_write_value(gatt, handle, value, value_len, write_cb, op, async_dbus_op_free); - if (!id) - async_dbus_op_free(op); - - return id; -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static unsigned int start_write_cmd(DBusMessage *msg, uint16_t handle, - struct bt_gatt_client *gatt, bool signed_write, - const uint8_t *value, size_t value_len, - void *data, async_dbus_op_complete_t complete) -{ - struct async_dbus_op *op; - unsigned int id; - - op = new0(struct async_dbus_op, 1); - if (!op) - return 0; - - op->msg = dbus_message_ref(msg); - op->data = data; - op->complete = complete; - - id = bt_gatt_client_write_without_response_async(gatt, handle, - signed_write, value, value_len, - write_cb, op, async_dbus_op_free); - if (!id) + if (!op->id) { async_dbus_op_free(op); + return NULL; + } - return id; + return op; } -#endif static bool desc_write_complete(void *data) { struct descriptor *desc = data; - desc->write_id = 0; + desc->write_op = NULL; /* * The descriptor might have been unregistered during the read. Return @@ -612,16 +564,23 @@ static DBusMessage *descriptor_write_value(DBusConnection *conn, { struct descriptor *desc = user_data; struct bt_gatt_client *gatt = desc->chrc->service->client->gatt; + DBusMessageIter iter; uint8_t *value = NULL; - size_t value_len = 0; + int value_len = 0; + uint16_t offset = 0; if (!gatt) return btd_error_failed(msg, "Not connected"); - if (desc->write_id) + if (desc->write_op) return btd_error_in_progress(msg); - if (!parse_value_arg(msg, &value, &value_len)) + dbus_message_iter_init(msg, &iter); + + if (parse_value_arg(&iter, &value, &value_len)) + return btd_error_invalid_args(msg); + + if (parse_options(&iter, &offset)) return btd_error_invalid_args(msg); /* @@ -636,60 +595,39 @@ static DBusMessage *descriptor_write_value(DBusConnection *conn, * Based on the value length and the MTU, either use a write or a long * write. */ - if (value_len <= (unsigned) bt_gatt_client_get_mtu(gatt) - 3) - desc->write_id = start_write_request(msg, desc->handle, + if (value_len <= bt_gatt_client_get_mtu(gatt) - 3 && !offset) + desc->write_op = start_write_request(msg, desc->handle, gatt, value, value_len, desc, desc_write_complete); else - desc->write_id = start_long_write(msg, desc->handle, - gatt, false, value, - value_len, desc, + desc->write_op = start_long_write(msg, desc->handle, gatt, + false, value, + value_len, offset, desc, desc_write_complete); - if (!desc->write_id) + if (!desc->write_op) return btd_error_failed(msg, "Failed to initiate write"); return NULL; } static const GDBusPropertyTable descriptor_properties[] = { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY { "UUID", "s", descriptor_get_uuid }, - { "Characteristic", "o", descriptor_get_characteristic }, - { "Value", "ay", descriptor_get_value, NULL, - descriptor_value_exists }, - { } -#else - { "UUID", "s", descriptor_get_uuid, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Characteristic", "o", descriptor_get_characteristic, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Value", "ay", descriptor_get_value, NULL, descriptor_value_exists, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Characteristic", "o", descriptor_get_characteristic, }, + { "Value", "ay", descriptor_get_value, NULL, descriptor_value_exists }, { } -#endif }; static const GDBusMethodTable descriptor_methods[] = { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_ASYNC_METHOD("ReadValue", NULL, GDBUS_ARGS({ "value", "ay" }), - descriptor_read_value) }, - { GDBUS_ASYNC_METHOD("WriteValue", - GDBUS_ARGS({ "value", "ay" }), - GDBUS_ARGS({ "result", "y" }), - descriptor_write_value) }, + { GDBUS_ASYNC_METHOD("ReadValue", GDBUS_ARGS({ "options", "a{sv}" }), + GDBUS_ARGS({ "value", "ay" }), + descriptor_read_value) }, + { GDBUS_ASYNC_METHOD("WriteValue", GDBUS_ARGS({ "value", "ay" }, + { "options", "a{sv}" }), + NULL, + descriptor_write_value) }, { } -#else - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("ReadValue", NULL, - GDBUS_ARGS({ "value", "ay" }), - descriptor_read_value) }, - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("WriteValue", - GDBUS_ARGS({ "value", "ay" }), - NULL, - descriptor_write_value) }, - { } -#endif }; static void descriptor_free(void *data) @@ -741,11 +679,11 @@ static void unregister_descriptor(void *data) DBG("Removing GATT descriptor: %s", desc->path); - if (desc->read_id) - bt_gatt_client_cancel(gatt, desc->read_id); + if (desc->read_op) + bt_gatt_client_cancel(gatt, desc->read_op->id); - if (desc->write_id) - bt_gatt_client_cancel(gatt, desc->write_id); + if (desc->write_op) + bt_gatt_client_cancel(gatt, desc->write_op->id); desc->chrc = NULL; @@ -814,6 +752,15 @@ static gboolean characteristic_get_notifying(const GDBusPropertyTable *property, return TRUE; } +static gboolean +characteristic_notifying_exists(const GDBusPropertyTable *property, void *data) +{ + struct characteristic *chrc = data; + + return (chrc->props & BT_GATT_CHRC_PROP_NOTIFY || + chrc->props & BT_GATT_CHRC_PROP_INDICATE); +} + struct chrc_prop_data { uint8_t prop; char *str; @@ -877,24 +824,11 @@ static void write_characteristic_cb(struct gatt_db_attribute *attr, int err, } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void notify_characteristic_cb(struct gatt_db_attribute *attr, int err, - void *user_data) -{ - if (err) { - error("Failed to notify_characteristic_cb : %d", err); - return; - } -} -#endif - static void chrc_read_cb(bool success, uint8_t att_ecode, const uint8_t *value, uint16_t length, void *user_data) { struct async_dbus_op *op = user_data; struct characteristic *chrc = op->data; - struct service *service = chrc->service; - DBusMessage *reply; if (!success) goto fail; @@ -905,41 +839,24 @@ static void chrc_read_cb(bool success, uint8_t att_ecode, const uint8_t *value, if (!gatt_db_attribute_write(chrc->attr, op->offset, value, length, 0, NULL, write_characteristic_cb, chrc)) { error("Failed to store attribute"); + att_ecode = BT_ATT_ERROR_UNLIKELY; goto fail; } - /* - * If the value length is exactly MTU-1, then we may not have read the - * entire value. Perform a long read to obtain the rest, otherwise, - * we're done. - */ - if (length == bt_gatt_client_get_mtu(service->client->gatt) - 1) { - op->offset += length; - chrc->read_id = bt_gatt_client_read_long_value( - service->client->gatt, - chrc->value_handle, - op->offset, - chrc_read_cb, - async_dbus_op_ref(op), - async_dbus_op_unref); - if (chrc->read_id) - return; - } - - chrc->read_id = 0; - /* Read the stored data from db */ if (!gatt_db_attribute_read(chrc->attr, 0, 0, NULL, read_op_cb, op)) { error("Failed to read database"); + att_ecode = BT_ATT_ERROR_UNLIKELY; goto fail; } + chrc->read_op = NULL; + return; fail: - reply = create_gatt_dbus_error(op->msg, att_ecode); - chrc->read_id = 0; - g_dbus_send_message(btd_get_dbus_connection(), reply); + async_dbus_op_reply(op, att_ecode, NULL, 0); + chrc->read_op = NULL; } static DBusMessage *characteristic_read_value(DBusConnection *conn, @@ -947,35 +864,37 @@ static DBusMessage *characteristic_read_value(DBusConnection *conn, { struct characteristic *chrc = user_data; struct bt_gatt_client *gatt = chrc->service->client->gatt; - struct async_dbus_op *op; + DBusMessageIter iter; + uint16_t offset = 0; if (!gatt) return btd_error_failed(msg, "Not connected"); - if (chrc->read_id) - return btd_error_in_progress(msg); + dbus_message_iter_init(msg, &iter); - op = new0(struct async_dbus_op, 1); - op->msg = dbus_message_ref(msg); - op->data = chrc; - - chrc->read_id = bt_gatt_client_read_value(gatt, chrc->value_handle, - chrc_read_cb, - async_dbus_op_ref(op), - async_dbus_op_unref); - if (chrc->read_id) + if (parse_options(&iter, &offset)) + return btd_error_invalid_args(msg); + + if (chrc->read_op) { + if (chrc->read_op->offset != offset) + return btd_error_in_progress(msg); + queue_push_tail(chrc->read_op->msgs, dbus_message_ref(msg)); return NULL; + } - async_dbus_op_free(op); + chrc->read_op = read_value(gatt, msg, chrc->value_handle, offset, + chrc_read_cb, chrc); + if (!chrc->read_op) + return btd_error_failed(msg, "Failed to send read request"); - return btd_error_failed(msg, "Failed to send read request"); + return NULL; } static bool chrc_write_complete(void *data) { struct characteristic *chrc = data; - chrc->write_id = 0; + chrc->write_op = NULL; /* * The characteristic might have been unregistered during the read. @@ -989,17 +908,24 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn, { struct characteristic *chrc = user_data; struct bt_gatt_client *gatt = chrc->service->client->gatt; + DBusMessageIter iter; uint8_t *value = NULL; - size_t value_len = 0; + int value_len = 0; bool supported = false; + uint16_t offset = 0; if (!gatt) return btd_error_failed(msg, "Not connected"); - if (chrc->write_id) + if (chrc->write_op) return btd_error_in_progress(msg); - if (!parse_value_arg(msg, &value, &value_len)) + dbus_message_iter_init(msg, &iter); + + if (parse_value_arg(&iter, &value, &value_len)) + return btd_error_invalid_args(msg); + + if (parse_options(&iter, &offset)) return btd_error_invalid_args(msg); /* @@ -1013,16 +939,14 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn, * - If value is larger than MTU - 3: long-write * * "write-without-response" property set -> write command. */ -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if ((chrc->ext_props & BT_GATT_CHRC_EXT_PROP_RELIABLE_WRITE)) { supported = true; - chrc->write_id = start_long_write(msg, chrc->value_handle, gatt, - true, value, value_len, + chrc->write_op = start_long_write(msg, chrc->value_handle, gatt, + true, value, value_len, offset, chrc, chrc_write_complete); - if (chrc->write_id) + if (chrc->write_op) return NULL; } -#endif if (chrc->props & BT_GATT_CHRC_PROP_WRITE) { uint16_t mtu; @@ -1032,18 +956,18 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn, if (!mtu) return btd_error_failed(msg, "No ATT transport"); - if (value_len <= (unsigned) mtu - 3) - chrc->write_id = start_write_request(msg, + if (value_len <= mtu - 3 && !offset) + chrc->write_op = start_write_request(msg, chrc->value_handle, gatt, value, value_len, chrc, chrc_write_complete); else - chrc->write_id = start_long_write(msg, + chrc->write_op = start_long_write(msg, chrc->value_handle, gatt, - false, value, value_len, + false, value, value_len, offset, chrc, chrc_write_complete); - if (chrc->write_id) + if (chrc->write_op) return NULL; } @@ -1065,71 +989,6 @@ fail: return btd_error_not_supported(msg); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *characteristic_write_value_by_type(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct characteristic *chrc = user_data; - struct bt_gatt_client *gatt = chrc->service->client->gatt; - uint8_t *value = NULL; - size_t value_len = 0; - bool supported = false; - uint8_t write_type = 0; - - if (!gatt) - return btd_error_failed(msg, "Not connected"); - - if (chrc->write_id) - return btd_error_in_progress(msg); - - if (!parse_type_value_arg(msg, &write_type, &value, &value_len)) - return btd_error_invalid_args(msg); - - - if ((write_type & chrc->props) == BT_GATT_CHRC_PROP_WRITE) { - uint16_t mtu; - supported = true; - mtu = bt_gatt_client_get_mtu(gatt); - if (!mtu) - return btd_error_failed(msg, "No ATT transport"); - - if (value_len <= (unsigned) mtu - 3) - chrc->write_id = start_write_request(msg, - chrc->value_handle, - gatt, value, value_len, - chrc, chrc_write_complete); - else - chrc->write_id = start_long_write(msg, - chrc->value_handle, gatt, - false, value, value_len, - chrc, chrc_write_complete); - - if (chrc->write_id) - return NULL; - } else if ((write_type & chrc->props) == - BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP) { - supported = true; - chrc->write_id = start_write_cmd(msg, chrc->value_handle, gatt, - false, value, value_len, - chrc, chrc_write_complete); - if (chrc->write_id) - return NULL; - } else if ((write_type & chrc->props) == BT_GATT_CHRC_PROP_AUTH) { - supported = true; - chrc->write_id = start_write_cmd(msg, chrc->value_handle, gatt, - true, value, value_len, - chrc, chrc_write_complete); - if (chrc->write_id) - return NULL; - } - - if (supported) - return btd_error_failed(msg, "Failed to initiate write"); - - return btd_error_not_supported(msg); -} -#endif - struct notify_client { struct characteristic *chrc; int ref_count; @@ -1240,27 +1099,6 @@ static bool match_notify_sender(const void *a, const void *b) return strcmp(client->owner, sender) == 0; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void gatt_characteristic_value_changed(struct notify_client *client, const uint8_t *data, uint16_t data_len, void *user_data) -{ - struct characteristic *chrc = user_data; - char *chrc_path = strdup(chrc->path); - dbus_int32_t result = 0; - - g_dbus_emit_signal_to_dest(btd_get_dbus_connection(), - client->owner, chrc_path, - GATT_CHARACTERISTIC_IFACE, "GattValueChanged", - DBUS_TYPE_INT32, &result, - DBUS_TYPE_STRING, &chrc_path, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &data, data_len, - DBUS_TYPE_INVALID); - - if (chrc_path) - free(chrc_path); - -} -#endif - static void notify_cb(uint16_t value_handle, const uint8_t *value, uint16_t length, void *user_data) { @@ -1274,37 +1112,21 @@ static void notify_cb(uint16_t value_handle, const uint8_t *value, * applications. */ gatt_db_attribute_reset(chrc->attr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gatt_db_attribute_write(chrc->attr, 0, value, length, 0, NULL, - notify_characteristic_cb, chrc); - - gatt_characteristic_value_changed(client, value, length, chrc); -#else gatt_db_attribute_write(chrc->attr, 0, value, length, 0, NULL, write_characteristic_cb, chrc); -#endif } -static DBusMessage *create_notify_reply(struct async_dbus_op *op, - bool success, uint8_t att_ecode) +static void create_notify_reply(struct async_dbus_op *op, bool success, + uint8_t att_ecode) { - DBusMessage *reply = NULL; - - if (!op->msg) - return NULL; + int err; if (success) - reply = g_dbus_create_reply(op->msg, DBUS_TYPE_INVALID); - else if (att_ecode) - reply = create_gatt_dbus_error(op->msg, att_ecode); + err = 0; else - reply = btd_error_failed(op->msg, - "Characteristic not available"); - - if (!reply) - error("Failed to construct D-Bus message reply"); + err = att_ecode ? att_ecode : -ENOENT; - return reply; + async_dbus_op_reply(op, err, NULL, -1); } static void register_notify_cb(uint16_t att_ecode, void *user_data) @@ -1312,16 +1134,15 @@ static void register_notify_cb(uint16_t att_ecode, void *user_data) struct async_dbus_op *op = user_data; struct notify_client *client = op->data; struct characteristic *chrc = client->chrc; - DBusMessage *reply; if (att_ecode) { queue_remove(chrc->notify_clients, client); queue_remove(chrc->service->client->all_notify_clients, client); notify_client_free(client); - reply = create_notify_reply(op, false, att_ecode); + create_notify_reply(op, false, att_ecode); - goto done; + return; } if (!chrc->notifying) { @@ -1331,11 +1152,7 @@ static void register_notify_cb(uint16_t att_ecode, void *user_data) "Notifying"); } - reply = create_notify_reply(op, true, 0); - -done: - if (reply) - g_dbus_send_message(btd_get_dbus_connection(), reply); + create_notify_reply(op, true, 0); } static DBusMessage *characteristic_start_notify(DBusConnection *conn, @@ -1385,9 +1202,7 @@ static DBusMessage *characteristic_start_notify(DBusConnection *conn, goto fail; } - op = new0(struct async_dbus_op, 1); - op->data = client; - op->msg = dbus_message_ref(msg); + op = async_dbus_op_new(msg, client); client->notify_id = bt_gatt_client_register_notify(gatt, chrc->value_handle, @@ -1430,105 +1245,32 @@ static DBusMessage *characteristic_stop_notify(DBusConnection *conn, return dbus_message_new_method_return(msg); } -static void append_desc_path(void *data, void *user_data) -{ - struct descriptor *desc = data; - DBusMessageIter *array = user_data; - - dbus_message_iter_append_basic(array, DBUS_TYPE_OBJECT_PATH, - &desc->path); -} - -static gboolean characteristic_get_descriptors( - const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct characteristic *chrc = data; - DBusMessageIter array; - - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "o", &array); - - queue_foreach(chrc->descs, append_desc_path, &array); - - dbus_message_iter_close_container(iter, &array); - - return TRUE; -} - static const GDBusPropertyTable characteristic_properties[] = { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "UUID", "s", characteristic_get_uuid }, - { "Service", "o", characteristic_get_service }, + { "UUID", "s", characteristic_get_uuid, NULL, NULL }, + { "Service", "o", characteristic_get_service, NULL, NULL }, { "Value", "ay", characteristic_get_value, NULL, characteristic_value_exists }, - { "ChangedValue", "ay", characteristic_get_value, NULL, - characteristic_value_exists }, - { "Notifying", "b", characteristic_get_notifying }, - { "Flags", "as", characteristic_get_flags }, - { "Descriptors", "ao", characteristic_get_descriptors }, - { } -#else - { "UUID", "s", characteristic_get_uuid, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Service", "o", characteristic_get_service, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Value", "ay", characteristic_get_value, NULL, - characteristic_value_exists, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Notifying", "b", characteristic_get_notifying, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Flags", "as", characteristic_get_flags, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Descriptors", "ao", characteristic_get_descriptors, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Notifying", "b", characteristic_get_notifying, NULL, + characteristic_notifying_exists }, + { "Flags", "as", characteristic_get_flags, NULL, NULL }, { } -#endif - }; static const GDBusMethodTable characteristic_methods[] = { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { GDBUS_ASYNC_METHOD("ReadValue", NULL, GDBUS_ARGS({ "value", "ay" }), - characteristic_read_value) }, - { GDBUS_ASYNC_METHOD("WriteValue", GDBUS_ARGS({ "value", "ay" }), - NULL, characteristic_write_value) }, - { GDBUS_ASYNC_METHOD("WriteValuebyType", - GDBUS_ARGS({ "type", "y" }, { "value", "ay" }), - GDBUS_ARGS({ "result", "y" }), - characteristic_write_value_by_type) }, + { GDBUS_ASYNC_METHOD("ReadValue", GDBUS_ARGS({ "options", "a{sv}" }), + GDBUS_ARGS({ "value", "ay" }), + characteristic_read_value) }, + { GDBUS_ASYNC_METHOD("WriteValue", GDBUS_ARGS({ "value", "ay" }, + { "options", "a{sv}" }), + NULL, + characteristic_write_value) }, { GDBUS_ASYNC_METHOD("StartNotify", NULL, NULL, - characteristic_start_notify) }, - { GDBUS_METHOD("StopNotify", NULL, NULL, characteristic_stop_notify) }, - { } -#else - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("ReadValue", NULL, - GDBUS_ARGS({ "value", "ay" }), - characteristic_read_value) }, - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("WriteValue", - GDBUS_ARGS({ "value", "ay" }), - NULL, - characteristic_write_value) }, - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("StartNotify", NULL, NULL, - characteristic_start_notify) }, - { GDBUS_EXPERIMENTAL_METHOD("StopNotify", NULL, NULL, - characteristic_stop_notify) }, + characteristic_start_notify) }, + { GDBUS_METHOD("StopNotify", NULL, NULL, + characteristic_stop_notify) }, { } -#endif }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static const GDBusSignalTable service_signals[] = { - { GDBUS_SIGNAL("GattServiceAdded", - GDBUS_ARGS({ "Service Path","s"})) }, -}; -static const GDBusSignalTable characteristic_signals[] = { - { GDBUS_SIGNAL("GattValueChanged", - GDBUS_ARGS({ "Result", "i"}, - { "Characteristic Path","s"}, - { "GattData", "ay"})) }, -}; -#endif - static void characteristic_free(void *data) { struct characteristic *chrc = data; @@ -1553,20 +1295,11 @@ static struct characteristic *characteristic_create( chrc->notify_clients = queue_new(); chrc->service = service; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY gatt_db_attribute_get_char_data(attr, &chrc->handle, &chrc->value_handle, - &chrc->props, &uuid); -#else - if (!gatt_db_attribute_get_char_data(attr, &chrc->handle, - &chrc->value_handle, - &chrc->props, &uuid)) { - queue_destroy(chrc->descs, NULL); - queue_destroy(chrc->notify_clients, NULL); - free(chrc); - return NULL; - } -#endif + &chrc->props, + &chrc->ext_props, + &uuid); chrc->attr = gatt_db_get_attribute(service->client->db, chrc->value_handle); @@ -1583,11 +1316,7 @@ static struct characteristic *characteristic_create( if (!g_dbus_register_interface(btd_get_dbus_connection(), chrc->path, GATT_CHARACTERISTIC_IFACE, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - characteristic_methods, characteristic_signals, -#else characteristic_methods, NULL, -#endif characteristic_properties, chrc, characteristic_free)) { error("Unable to register GATT characteristic with handle " @@ -1619,11 +1348,11 @@ static void unregister_characteristic(void *data) DBG("Removing GATT characteristic: %s", chrc->path); - if (chrc->read_id) - bt_gatt_client_cancel(gatt, chrc->read_id); + if (chrc->read_op) + bt_gatt_client_cancel(gatt, chrc->read_op->id); - if (chrc->write_id) - bt_gatt_client_cancel(gatt, chrc->write_id); + if (chrc->write_op) + bt_gatt_client_cancel(gatt, chrc->write_op->id); queue_remove_all(chrc->notify_clients, NULL, NULL, remove_client); queue_remove_all(chrc->descs, NULL, NULL, unregister_descriptor); @@ -1669,49 +1398,11 @@ static gboolean service_get_primary(const GDBusPropertyTable *property, return TRUE; } -static void append_chrc_path(void *data, void *user_data) -{ - struct characteristic *chrc = data; - DBusMessageIter *array = user_data; - - dbus_message_iter_append_basic(array, DBUS_TYPE_OBJECT_PATH, - &chrc->path); -} - -static gboolean service_get_characteristics(const GDBusPropertyTable *property, - DBusMessageIter *iter, void *data) -{ - struct service *service = data; - DBusMessageIter array; - - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "o", &array); - - if (service->chrcs_ready) - queue_foreach(service->chrcs, append_chrc_path, &array); - - dbus_message_iter_close_container(iter, &array); - - return TRUE; -} - static const GDBusPropertyTable service_properties[] = { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY { "UUID", "s", service_get_uuid }, { "Device", "o", service_get_device }, { "Primary", "b", service_get_primary }, - { "Characteristics", "ao", service_get_characteristics }, { } -#else - { "UUID", "s", service_get_uuid, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Device", "o", service_get_device, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Primary", "b", service_get_primary, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { "Characteristics", "ao", service_get_characteristics, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, - { } -#endif }; static void service_free(void *data) @@ -1719,7 +1410,6 @@ static void service_free(void *data) struct service *service = data; queue_destroy(service->chrcs, NULL); /* List should be empty here */ - queue_destroy(service->pending_ext_props, NULL); g_free(service->path); free(service); } @@ -1733,7 +1423,6 @@ static struct service *service_create(struct gatt_db_attribute *attr, service = new0(struct service, 1); service->chrcs = queue_new(); - service->pending_ext_props = queue_new(); service->client = client; gatt_db_attribute_get_service_data(attr, &service->start_handle, @@ -1747,11 +1436,7 @@ static struct service *service_create(struct gatt_db_attribute *attr, if (!g_dbus_register_interface(btd_get_dbus_connection(), service->path, GATT_SERVICE_IFACE, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - NULL, service_signals, -#else NULL, NULL, -#endif service_properties, service, service_free)) { error("Unable to register GATT service with handle 0x%04x for " @@ -1780,34 +1465,12 @@ static void unregister_service(void *data) DBG("Removing GATT service: %s", service->path); - if (service->idle_id) - g_source_remove(service->idle_id); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (service->idle_id2) - g_source_remove(service->idle_id2); -#endif - queue_remove_all(service->chrcs, NULL, NULL, unregister_characteristic); g_dbus_unregister_interface(btd_get_dbus_connection(), service->path, GATT_SERVICE_IFACE); } -static void notify_chrcs(struct service *service) -{ - - if (service->chrcs_ready || - !queue_isempty(service->pending_ext_props)) - return; - - service->chrcs_ready = true; - - g_dbus_emit_property_changed(btd_get_dbus_connection(), service->path, - GATT_SERVICE_IFACE, - "Characteristics"); -} - struct export_data { void *root; bool failed; @@ -1831,57 +1494,6 @@ static void export_desc(struct gatt_db_attribute *attr, void *user_data) queue_push_tail(charac->descs, desc); } -static void read_ext_props_cb(bool success, uint8_t att_ecode, - const uint8_t *value, uint16_t length, - void *user_data) -{ - struct characteristic *chrc = user_data; - struct service *service = chrc->service; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - chrc->read_id = 0; -#endif - - if (!success) { - error("Failed to obtain extended properties - error: 0x%02x", - att_ecode); - return; - } - - if (!value || length != 2) { - error("Malformed extended properties value"); - return; - } - - chrc->ext_props = get_le16(value); - if (chrc->ext_props) - g_dbus_emit_property_changed(btd_get_dbus_connection(), - chrc->path, - GATT_CHARACTERISTIC_IFACE, - "Flags"); - - queue_remove(service->pending_ext_props, chrc); - - notify_chrcs(service); -} - -static void read_ext_props(void *data, void *user_data) -{ - struct characteristic *chrc = data; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - chrc->read_id = bt_gatt_client_read_value(chrc->service->client->gatt, - chrc->ext_props_handle, - read_ext_props_cb, - chrc, NULL); -#else - bt_gatt_client_read_value(chrc->service->client->gatt, - chrc->ext_props_handle, - read_ext_props_cb, - chrc, NULL); -#endif -} - static bool create_descriptors(struct gatt_db_attribute *attr, struct characteristic *charac) { @@ -1915,9 +1527,6 @@ static void export_char(struct gatt_db_attribute *attr, void *user_data) queue_push_tail(service->chrcs, charac); - if (charac->ext_props_handle) - queue_push_tail(service->pending_ext_props, charac); - return; fail: @@ -1934,46 +1543,8 @@ static bool create_characteristics(struct gatt_db_attribute *attr, gatt_db_service_foreach_char(attr, export_char, &data); - if (data.failed) - return false; - - /* Obtain extended properties */ - queue_foreach(service->pending_ext_props, read_ext_props, NULL); - - return true; -} - -static gboolean set_chrcs_ready(gpointer user_data) -{ - struct service *service = user_data; - - service->idle_id = 0; - notify_chrcs(service); - - return FALSE; -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static gboolean notify_service_added_complete(gpointer user_data) -{ - struct service *service = user_data; - char *svc_path; - - if (service == NULL || service->path == NULL) - return FALSE; - - svc_path = g_strdup(service->path); - - g_dbus_emit_signal(btd_get_dbus_connection(), service->path, - GATT_SERVICE_IFACE, "GattServiceAdded", - DBUS_TYPE_STRING, &svc_path, - DBUS_TYPE_INVALID); - - g_free(svc_path); - - return FALSE; + return !data.failed; } -#endif static void export_service(struct gatt_db_attribute *attr, void *user_data) { @@ -1994,19 +1565,6 @@ static void export_service(struct gatt_db_attribute *attr, void *user_data) } queue_push_tail(client->services, service); - - /* - * Asynchronously update the "Characteristics" property of the service. - * If there are any pending reads to obtain the value of the "Extended - * Properties" descriptor then wait until they are complete. - */ - if (!service->chrcs_ready && queue_isempty(service->pending_ext_props)) - service->idle_id = g_idle_add(set_chrcs_ready, service); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (service->primary == true) - service->idle_id2 = g_idle_add(notify_service_added_complete, service); -#endif } static void create_services(struct btd_gatt_client *client) @@ -2044,10 +1602,6 @@ void btd_gatt_client_destroy(struct btd_gatt_client *client) if (!client) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->wait_charcs_id) - g_source_remove(client->wait_charcs_id); -#endif queue_destroy(client->services, unregister_service); queue_destroy(client->all_notify_clients, NULL); bt_gatt_client_unref(client->gatt); @@ -2083,66 +1637,20 @@ static void register_notify(void *data, void *user_data) notify_client_free(notify_client); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void check_chrcs_ready(void *data, void *user_data) -{ - gboolean *chrcs_ready = user_data; - struct service *service = data; - - /* - * Return FALSE if charcteristics are not ready or if there is - * any pending request to read char. extended properties exist. - */ - if (!service->chrcs_ready || - !queue_isempty(service->pending_ext_props)) - *chrcs_ready = FALSE; -} - -static gboolean check_all_chrcs_ready(gpointer user_data) -{ - struct btd_gatt_client *client = user_data; - gboolean all_chrcs_ready = TRUE; - static int count = 0; - - queue_foreach(client->services, check_chrcs_ready, &all_chrcs_ready); - - /* - * By adding below condition, forcing to call check_chrcs_ready() - * function to check whether all char./extended properties are ready. - * Above function would be called max. for 50 times (Assuming more - * no of services). Emit signal only when all characteristics are ready. - */ - if (all_chrcs_ready == FALSE && count < 50) { - count++; - return TRUE; - } - - /* - * There are chances when all of the primary services are not found, - * instead service changed is received while reading REQs in progress, - * so emit signal after service changed operation is completed (if any). - */ - if (bt_gatt_client_svc_changed_received(client->gatt)) - return TRUE; - - device_set_gatt_connected(client->device, TRUE); - - client->wait_charcs_id = 0; - - count = 0; - - return FALSE; -} -#endif - void btd_gatt_client_ready(struct btd_gatt_client *client) { if (!client) return; if (!client->gatt) { - error("GATT client not initialized"); - return; + struct bt_gatt_client *gatt; + + gatt = btd_device_get_gatt_client(client->device); + client->gatt = bt_gatt_client_clone(gatt); + if (!client->gatt) { + error("GATT client not initialized"); + return; + } } client->ready = true; @@ -2150,20 +1658,6 @@ void btd_gatt_client_ready(struct btd_gatt_client *client) DBG("GATT client ready"); create_services(client); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* - * In case of more number of services and services having - * characteristics extended properties; GattConnected signal - * should be emitted only after all the characteristics are ready. - * This piece of code checks all the characteristics periodically and - * emit the signal if characteristics are ready. - */ - if (client->wait_charcs_id > 0) - g_source_remove(client->wait_charcs_id); - - client->wait_charcs_id = g_timeout_add(100, - check_all_chrcs_ready, client); -#endif } void btd_gatt_client_connected(struct btd_gatt_client *client) @@ -2179,7 +1673,7 @@ void btd_gatt_client_connected(struct btd_gatt_client *client) DBG("Device connected."); bt_gatt_client_unref(client->gatt); - client->gatt = bt_gatt_client_ref(gatt); + client->gatt = bt_gatt_client_clone(gatt); /* * Services have already been created before. Re-enable notifications @@ -2230,47 +1724,6 @@ static void clear_notify_id(void *data, void *user_data) client->notify_id = 0; } -static void cancel_desc_ops(void *data, void *user_data) -{ - struct descriptor *desc = data; - struct bt_gatt_client *gatt = user_data; - - if (desc->read_id) { - bt_gatt_client_cancel(gatt, desc->read_id); - desc->read_id = 0; - } - - if (desc->write_id) { - bt_gatt_client_cancel(gatt, desc->write_id); - desc->write_id = 0; - } -} - -static void cancel_chrc_ops(void *data, void *user_data) -{ - struct characteristic *chrc = data; - struct bt_gatt_client *gatt = user_data; - - if (chrc->read_id) { - bt_gatt_client_cancel(gatt, chrc->read_id); - chrc->read_id = 0; - } - - if (chrc->write_id) { - bt_gatt_client_cancel(gatt, chrc->write_id); - chrc->write_id = 0; - } - - queue_foreach(chrc->descs, cancel_desc_ops, user_data); -} - -static void cancel_ops(void *data, void *user_data) -{ - struct service *service = data; - - queue_foreach(service->chrcs, cancel_chrc_ops, user_data); -} - void btd_gatt_client_disconnected(struct btd_gatt_client *client) { if (!client || !client->gatt) @@ -2278,20 +1731,12 @@ void btd_gatt_client_disconnected(struct btd_gatt_client *client) DBG("Device disconnected. Cleaning up."); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->wait_charcs_id) { - g_source_remove(client->wait_charcs_id); - client->wait_charcs_id = 0; - } -#endif - /* * TODO: Once GATT over BR/EDR is properly supported, we should pass the * correct bdaddr_type based on the transport over which GATT is being * done. */ queue_foreach(client->all_notify_clients, clear_notify_id, NULL); - queue_foreach(client->services, cancel_ops, client->gatt); bt_gatt_client_unref(client->gatt); client->gatt = NULL; diff --git a/src/gatt-client.h b/src/gatt-client.h old mode 100644 new mode 100755 diff --git a/src/gatt-database.c b/src/gatt-database.c old mode 100644 new mode 100755 index adb4b15..0877b25 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -54,6 +54,7 @@ #endif #define GATT_MANAGER_IFACE "org.bluez.GattManager1" +#define GATT_PROFILE_IFACE "org.bluez.GattProfile1" #define GATT_SERVICE_IFACE "org.bluez.GattService1" #define GATT_CHRC_IFACE "org.bluez.GattCharacteristic1" #define GATT_DESC_IFACE "org.bluez.GattDescriptor1" @@ -88,6 +89,7 @@ struct gatt_app { DBusMessage *reg; GDBusClient *client; bool failed; + struct queue *profiles; struct queue *services; struct queue *proxies; }; @@ -103,10 +105,8 @@ struct external_service { }; struct external_profile { - struct btd_gatt_database *database; - char *owner; - char *path; /* Path to GattProfile1 */ - unsigned int id; + struct gatt_app *app; + GDBusProxy *proxy; struct queue *profiles; /* btd_profile list */ }; @@ -116,6 +116,7 @@ struct external_chrc { GDBusProxy *proxy; uint8_t props; uint8_t ext_props; + uint32_t perm; struct gatt_db_attribute *attrib; struct gatt_db_attribute *ccc; struct queue *pending_reads; @@ -135,14 +136,11 @@ struct external_desc { }; struct pending_op { + struct btd_device *device; unsigned int id; struct gatt_db_attribute *attrib; struct queue *owner_queue; struct iovec data; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bdaddr_t bdaddr; - uint8_t bdaddr_type; -#endif }; struct device_state { @@ -151,6 +149,10 @@ struct device_state { struct queue *ccc_states; }; +typedef uint8_t (*btd_gatt_database_ccc_write_t) (uint16_t value, + void *user_data); +typedef void (*btd_gatt_database_destroy_t) (void *data); + struct ccc_state { uint16_t handle; uint8_t value[2]; @@ -168,10 +170,6 @@ struct device_info { uint8_t bdaddr_type; }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void conf_cb(void *user_data); -#endif - static void ccc_cb_free(void *data) { struct ccc_cb_data *ccc_cb = data; @@ -225,56 +223,6 @@ find_device_state(struct btd_gatt_database *database, bdaddr_t *bdaddr, return queue_find(database->device_states, dev_state_match, &dev_info); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void send_service_changed_indication_on_reconnect( - struct btd_device *device, - struct bt_gatt_server *server) -{ - struct btd_gatt_database *database; - uint16_t start_handle = 0X0001, end_handle = 0xFFFF; - uint8_t value[4]; - uint16_t svc_chngd_handle; - DBG(""); - - database = btd_adapter_get_database(device_get_adapter(device)); - - if (!database) - return; - - svc_chngd_handle = gatt_db_attribute_get_handle(database->svc_chngd_ccc); - - put_le16(start_handle, value); - put_le16(end_handle, value + 2); - - bt_gatt_server_send_indication(server, svc_chngd_handle, - value, sizeof(value), conf_cb, - NULL, NULL); -} - -static bool dev_addr_match(const void *a, const void *b) -{ - const struct device_state *dev_state = a; - const struct device_info *dev_info = b; - - if (bacmp(&dev_state->bdaddr, &dev_info->bdaddr) == 0) - return TRUE; - - return FALSE; -} - -static struct device_state * -find_device_state_from_address(struct btd_gatt_database *database, const bdaddr_t *bdaddr) -{ - struct device_info dev_info; - - memset(&dev_info, 0, sizeof(dev_info)); - - bacpy(&dev_info.bdaddr, bdaddr); - - return queue_find(database->device_states, dev_addr_match, &dev_info); -} -#endif - static bool ccc_state_match(const void *a, const void *b) { const struct ccc_state *ccc = a; @@ -294,12 +242,6 @@ static struct device_state *device_state_create(bdaddr_t *bdaddr, uint8_t bdaddr_type) { struct device_state *dev_state; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char addr[18] = { 0 }; - - ba2str(bdaddr, addr); - DBG("create device_state for %s [%d]", addr, bdaddr_type); -#endif dev_state = new0(struct device_state, 1); dev_state->ccc_states = queue_new(); @@ -337,9 +279,6 @@ static struct ccc_state *get_ccc_state(struct btd_gatt_database *database, { struct device_state *dev_state; struct ccc_state *ccc; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char addr[18] = { 0 }; -#endif dev_state = get_device_state(database, bdaddr, bdaddr_type); @@ -347,12 +286,6 @@ static struct ccc_state *get_ccc_state(struct btd_gatt_database *database, if (ccc) return ccc; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - ba2str(bdaddr, addr); - DBG("create ccc_state of handle: 0x%04x for %s [%d]", - handle, addr, bdaddr_type); -#endif - ccc = new0(struct ccc_state, 1); ccc->handle = handle; queue_push_tail(dev_state->ccc_states, ccc); @@ -434,30 +367,6 @@ static void service_free(void *data) free(service); } -static void app_free(void *data) -{ - struct gatt_app *app = data; - - queue_destroy(app->services, service_free); - queue_destroy(app->proxies, NULL); - - if (app->client) { - g_dbus_client_set_disconnect_watch(app->client, NULL, NULL); - g_dbus_client_set_proxy_handlers(app->client, NULL, NULL, - NULL, NULL); - g_dbus_client_set_ready_watch(app->client, NULL, NULL); - g_dbus_client_unref(app->client); - } - - if (app->reg) - dbus_message_unref(app->reg); - - g_free(app->owner); - g_free(app->path); - - free(app); -} - static void profile_remove(void *data) { struct btd_profile *p = data; @@ -475,20 +384,10 @@ static void profile_remove(void *data) static void profile_release(struct external_profile *profile) { - DBusMessage *msg; - - if (!profile->id) - return; + DBG("Releasing \"%s\"", profile->app->owner); - DBG("Releasing \"%s\"", profile->owner); - - g_dbus_remove_watch(btd_get_dbus_connection(), profile->id); - - msg = dbus_message_new_method_call(profile->owner, profile->path, - "org.bluez.GattProfile1", - "Release"); - if (msg) - g_dbus_send_message(btd_get_dbus_connection(), msg); + g_dbus_proxy_method_call(profile->proxy, "Release", NULL, NULL, NULL, + NULL); } static void profile_free(void *data) @@ -499,12 +398,36 @@ static void profile_free(void *data) profile_release(profile); - g_free(profile->owner); - g_free(profile->path); + g_dbus_proxy_unref(profile->proxy); free(profile); } +static void app_free(void *data) +{ + struct gatt_app *app = data; + + queue_destroy(app->profiles, profile_free); + queue_destroy(app->services, service_free); + queue_destroy(app->proxies, NULL); + + if (app->client) { + g_dbus_client_set_disconnect_watch(app->client, NULL, NULL); + g_dbus_client_set_proxy_handlers(app->client, NULL, NULL, + NULL, NULL); + g_dbus_client_set_ready_watch(app->client, NULL, NULL); + g_dbus_client_unref(app->client); + } + + if (app->reg) + dbus_message_unref(app->reg); + + g_free(app->owner); + g_free(app->path); + + free(app); +} + static void gatt_database_free(void *data) { struct btd_gatt_database *database = data; @@ -549,8 +472,6 @@ static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data) uint8_t dst_type; bdaddr_t src, dst; - DBG("New incoming LE ATT connection"); - if (gerr) { error("%s", gerr->message); return; @@ -566,6 +487,9 @@ static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data) return; } + DBG("New incoming %s ATT connection", dst_type == BDADDR_BREDR ? + "BR/EDR" : "LE"); + adapter = adapter_find(&src); if (!adapter) return; @@ -575,22 +499,8 @@ static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data) return; device_attach_att(device, io); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (btd_device_get_svc_changed_indication(device)) { - send_service_changed_indication_on_reconnect(device, - btd_device_get_gatt_server(device)); - } -#endif } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define LE_BEARER_POSTFIX " LE" -#define LE_BEARER_POSTFIX_LEN 3 - -static bool get_dst_info(struct bt_att *att, bdaddr_t *dst, uint8_t *dst_type); -#endif - static void gap_device_name_read_cb(struct gatt_db_attribute *attrib, unsigned int id, uint16_t offset, uint8_t opcode, struct bt_att *att, @@ -601,32 +511,10 @@ static void gap_device_name_read_cb(struct gatt_db_attribute *attrib, size_t len = 0; const uint8_t *value = NULL; const char *device_name; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bdaddr_t dst = { { 0 } }; - uint8_t dst_type = 0; - char le_name[MAX_NAME_LENGTH + 1]; -#endif DBG("GAP Device Name read request\n"); device_name = btd_adapter_get_name(database->adapter); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (get_dst_info(att, &dst, &dst_type) && dst_type != BDADDR_BREDR && - bacmp(btd_adapter_get_address(database->adapter), - btd_adapter_get_le_address(database->adapter))) { - char *ptr = NULL; - - g_strlcpy(le_name, device_name, - sizeof(le_name) - LE_BEARER_POSTFIX_LEN); - if (!g_utf8_validate(le_name, -1, (const char **)&ptr)) - *ptr = '\0'; - - g_strlcat(le_name, LE_BEARER_POSTFIX, sizeof(le_name)); - DBG("Append LE bearer postfix : %s", le_name); - - device_name = le_name; - } -#endif len = strlen(device_name); if (offset > len) { @@ -672,33 +560,6 @@ done: gatt_db_attribute_read_result(attrib, id, error, value, len); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void gap_rpa_res_support_read_cb(struct gatt_db_attribute *attrib, - unsigned int id, uint16_t offset, - uint8_t opcode, struct bt_att *att, - void *user_data) -{ - struct btd_gatt_database *database = user_data; - uint8_t error = 0; - size_t len = 1; - const uint8_t *value = NULL; - uint8_t rpa_res_support = 0x00; - - rpa_res_support = btd_adapter_get_rpa_res_support_value(database->adapter); - - if (offset > 1) { - error = BT_ATT_ERROR_INVALID_OFFSET; - goto done; - } - - len -= offset; - value = len ? &rpa_res_support : NULL; - -done: - gatt_db_attribute_read_result(attrib, id, error, value, len); -} -#endif - static sdp_record_t *record_new(uuid_t *uuid, uint16_t start, uint16_t end) { sdp_list_t *svclass_id, *apseq, *proto[2], *root, *aproto; @@ -771,20 +632,14 @@ static uint32_t database_add_record(struct btd_gatt_database *database, return 0; if (name != NULL) -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - sdp_set_info_attr(record, name, "Samsung", NULL); -#else sdp_set_info_attr(record, name, "BlueZ", NULL); -#endif sdp_uuid16_create(&gap_uuid, UUID_GAP); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (sdp_uuid_cmp(&svc, &gap_uuid) == 0) { sdp_set_url_attr(record, "http://www.bluez.org/", "http://www.bluez.org/", "http://www.bluez.org/"); } -#endif if (adapter_service_add(database->adapter, record) == 0) return record->handle; @@ -822,23 +677,11 @@ static void populate_gap_service(struct btd_gatt_database *database) gap_appearance_read_cb, NULL, database); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Central address resolution characteristic */ - bt_uuid16_create(&uuid, GATT_CHARAC_CENTRAL_RPA_RESOLUTION); - gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_READ, - BT_GATT_CHRC_PROP_READ, - gap_rpa_res_support_read_cb, - NULL, database); -#endif - gatt_db_service_set_active(service, true); } static bool get_dst_info(struct bt_att *att, bdaddr_t *dst, uint8_t *dst_type) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - return bt_att_get_remote_addr(att, dst, dst_type); -#else GIOChannel *io = NULL; GError *gerr = NULL; @@ -857,9 +700,7 @@ static bool get_dst_info(struct bt_att *att, bdaddr_t *dst, uint8_t *dst_type) } g_io_channel_unref(io); - return true; -#endif } static void gatt_ccc_read_cb(struct gatt_db_attribute *attrib, @@ -955,23 +796,6 @@ static void gatt_ccc_write_cb(struct gatt_db_attribute *attrib, done: gatt_db_attribute_write_result(attrib, id, ecode); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!ecode) { - uint16_t svc_chngd_handle = gatt_db_attribute_get_handle(database->svc_chngd_ccc); - if (handle == svc_chngd_handle) { - if (ccc->value[0] != 0) { - struct btd_device *device = NULL; - device = btd_adapter_get_device( - database->adapter, - &bdaddr, bdaddr_type); - - if (!device) - return; - btd_device_set_svc_changed_indication(device, true); - } - } - } -#endif } static struct gatt_db_attribute * @@ -1007,28 +831,6 @@ service_add_ccc(struct gatt_db_attribute *service, return ccc; } -struct gatt_db_attribute * -btd_gatt_database_add_ccc(struct btd_gatt_database *database, - uint16_t service_handle, - btd_gatt_database_ccc_write_t write_callback, - void *user_data, - btd_gatt_database_destroy_t destroy) -{ - struct gatt_db_attribute *service; - - if (!database || !service_handle) - return NULL; - - service = gatt_db_get_attribute(database->db, service_handle); - if (!service) { - error("No service exists with handle: 0x%04x", service_handle); - return NULL; - } - - return service_add_ccc(service, database, write_callback, user_data, - destroy); -} - static void populate_gatt_service(struct btd_gatt_database *database) { bt_uuid_t uuid; @@ -1066,182 +868,10 @@ struct notify { bool indicate; }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct notify_indicate { - struct btd_gatt_database *database; - GDBusProxy *proxy; - uint16_t handle, ccc_handle; - const uint8_t *value; - uint16_t len; - bool indicate; -}; - -struct notify_indicate_cb { - GDBusProxy *proxy; - struct btd_device *device; -}; - -static void indicate_confirm_free(void *data) -{ - struct notify_indicate_cb *indicate = data; - - if (indicate) - free(indicate); -} - -static void indicate_confirm_setup_cb(DBusMessageIter *iter, void *user_data) -{ - struct btd_device *device = user_data; - char dst_addr[18] = { 0 }; - char *addr_value = dst_addr; - gboolean complete = FALSE; - - if (device_get_rpa_exist(device) == true) { - ba2str(device_get_rpa(device), dst_addr); - } else { - ba2str(device_get_address(device), dst_addr); - } - - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &addr_value); - - complete = TRUE; - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &complete); -} - -static void indicate_confirm_reply_cb(DBusMessage *message, void *user_data) -{ - DBusError error; - - dbus_error_init(&error); - - if (dbus_set_error_from_message(&error, message) == TRUE) { - DBG("Failed to send indication/notification"); - dbus_error_free(&error); - return; - } -} -#endif - static void conf_cb(void *user_data) { DBG("GATT server received confirmation"); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - struct notify_indicate_cb *confirm = user_data; - - if (confirm) { - /* Send confirmation to application */ - if (g_dbus_proxy_method_call(confirm->proxy, "IndicateConfirm", - indicate_confirm_setup_cb, - indicate_confirm_reply_cb, confirm->device, - NULL) == TRUE) - return; - } -#endif -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void send_notification_indication_to_device(void *data, void *user_data) -{ - struct device_state *device_state = data; - struct notify_indicate *notify_indicate = user_data; - struct ccc_state *ccc; - struct btd_device *device; - struct notify_indicate_cb *confirm; - - ccc = find_ccc_state(device_state, notify_indicate->ccc_handle); - if (!ccc) - return; - - if (!ccc->value[0] || (notify_indicate->indicate && !(ccc->value[0] & 0x02))) - return; - - device = btd_adapter_get_device(notify_indicate->database->adapter, - &device_state->bdaddr, - device_state->bdaddr_type); - if (!device) - return; - - confirm = new0(struct notify_indicate_cb, 1); - confirm->proxy = notify_indicate->proxy; - confirm->device = device; - /* - * TODO: If the device is not connected but bonded, send the - * notification/indication when it becomes connected. - */ - if (!notify_indicate->indicate) { - DBG("GATT server sending notification"); - bt_gatt_server_send_notification( - btd_device_get_gatt_server(device), - notify_indicate->handle, notify_indicate->value, - notify_indicate->len); - /* In case of Notification, send response to application - * as remote device do not respond for notification */ - conf_cb(confirm); - indicate_confirm_free((void *)confirm); - return; - } - - DBG("GATT server sending indication"); - - bt_gatt_server_send_indication(btd_device_get_gatt_server(device), - notify_indicate->handle, - notify_indicate->value, - notify_indicate->len, conf_cb, - confirm, indicate_confirm_free); -} - -static void send_notification_indication_to_devices(GDBusProxy *proxy, - struct btd_gatt_database *database, - uint16_t handle, const uint8_t *value, - uint16_t len, uint16_t ccc_handle, - bool indicate) -{ - struct notify_indicate notify_indicate; - - DBG("notify for handle: 0x%04x", handle); - - memset(¬ify_indicate, 0, sizeof(notify_indicate)); - - notify_indicate.database = database; - notify_indicate.proxy = proxy; - notify_indicate.handle = handle; - notify_indicate.ccc_handle = ccc_handle; - notify_indicate.value = value; - notify_indicate.len = len; - notify_indicate.indicate = indicate; - - queue_foreach(database->device_states, send_notification_indication_to_device, - ¬ify_indicate); -} - -static void send_unicast_notification_indication_to_device(GDBusProxy *proxy, - struct btd_gatt_database *database, - uint16_t handle, const uint8_t *value, - uint16_t len, uint16_t ccc_handle, - bool indicate, const bdaddr_t *unicast_addr) -{ - struct device_state *dev_state; - struct notify_indicate notify_indicate; - - DBG("notify for handle: 0x%04x", handle); - - memset(¬ify_indicate, 0, sizeof(notify_indicate)); - - notify_indicate.database = database; - notify_indicate.proxy = proxy; - notify_indicate.handle = handle; - notify_indicate.ccc_handle = ccc_handle; - notify_indicate.value = value; - notify_indicate.len = len; - notify_indicate.indicate = indicate; - - /* Find and return a device state. */ - dev_state = find_device_state_from_address(database, unicast_addr); - - if (dev_state) - send_notification_indication_to_device(dev_state, ¬ify_indicate); } -#endif static void send_notification_to_device(void *data, void *user_data) { @@ -1249,6 +879,7 @@ static void send_notification_to_device(void *data, void *user_data) struct notify *notify = user_data; struct ccc_state *ccc; struct btd_device *device; + struct bt_gatt_server *server; ccc = find_ccc_state(device_state, notify->ccc_handle); if (!ccc) @@ -1261,7 +892,14 @@ static void send_notification_to_device(void *data, void *user_data) &device_state->bdaddr, device_state->bdaddr_type); if (!device) + goto remove; + + server = btd_device_get_gatt_server(device); + if (!server) { + if (!device_is_paired(device, device_state->bdaddr_type)) + goto remove; return; + } /* * TODO: If the device is not connected but bonded, send the @@ -1269,19 +907,23 @@ static void send_notification_to_device(void *data, void *user_data) */ if (!notify->indicate) { DBG("GATT server sending notification"); - bt_gatt_server_send_notification( - btd_device_get_gatt_server(device), + bt_gatt_server_send_notification(server, notify->handle, notify->value, notify->len); return; } DBG("GATT server sending indication"); - bt_gatt_server_send_indication(btd_device_get_gatt_server(device), - notify->handle, - notify->value, + bt_gatt_server_send_indication(server, notify->handle, notify->value, notify->len, conf_cb, NULL, NULL); + + return; + +remove: + /* Remove device state if device no longer exists or is not paired */ + if (queue_remove(notify->database->device_states, device_state)) + device_state_free(device_state); } static void send_notification_to_devices(struct btd_gatt_database *database, @@ -1467,7 +1109,7 @@ static bool incr_attr_count(struct external_service *service, uint16_t incr) } static bool parse_chrc_flags(DBusMessageIter *array, uint8_t *props, - uint8_t *ext_props) + uint8_t *ext_props, uint32_t *perm) { const char *flag; @@ -1481,34 +1123,51 @@ static bool parse_chrc_flags(DBusMessageIter *array, uint8_t *props, if (!strcmp("broadcast", flag)) *props |= BT_GATT_CHRC_PROP_BROADCAST; - else if (!strcmp("read", flag)) + else if (!strcmp("read", flag)) { *props |= BT_GATT_CHRC_PROP_READ; - else if (!strcmp("write-without-response", flag)) + *perm |= BT_ATT_PERM_READ; + } else if (!strcmp("write-without-response", flag)) { *props |= BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP; - else if (!strcmp("write", flag)) + *perm |= BT_ATT_PERM_WRITE; + } else if (!strcmp("write", flag)) { *props |= BT_GATT_CHRC_PROP_WRITE; - else if (!strcmp("notify", flag)) + *perm |= BT_ATT_PERM_WRITE; + } else if (!strcmp("notify", flag)) { *props |= BT_GATT_CHRC_PROP_NOTIFY; - else if (!strcmp("indicate", flag)) + } else if (!strcmp("indicate", flag)) { *props |= BT_GATT_CHRC_PROP_INDICATE; - else if (!strcmp("authenticated-signed-writes", flag)) + } else if (!strcmp("authenticated-signed-writes", flag)) { *props |= BT_GATT_CHRC_PROP_AUTH; - else if (!strcmp("reliable-write", flag)) + *perm |= BT_ATT_PERM_WRITE; + } else if (!strcmp("reliable-write", flag)) { *ext_props |= BT_GATT_CHRC_EXT_PROP_RELIABLE_WRITE; - else if (!strcmp("writable-auxiliaries", flag)) + *perm |= BT_ATT_PERM_WRITE; + } else if (!strcmp("writable-auxiliaries", flag)) { *ext_props |= BT_GATT_CHRC_EXT_PROP_WRITABLE_AUX; - else if (!strcmp("encrypt-read", flag)) { + } else if (!strcmp("encrypt-read", flag)) { *props |= BT_GATT_CHRC_PROP_READ; *ext_props |= BT_GATT_CHRC_EXT_PROP_ENC_READ; + *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_ENCRYPT; } else if (!strcmp("encrypt-write", flag)) { *props |= BT_GATT_CHRC_PROP_WRITE; *ext_props |= BT_GATT_CHRC_EXT_PROP_ENC_WRITE; + *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_ENCRYPT; } else if (!strcmp("encrypt-authenticated-read", flag)) { *props |= BT_GATT_CHRC_PROP_READ; *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_READ; + *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_AUTHEN; } else if (!strcmp("encrypt-authenticated-write", flag)) { *props |= BT_GATT_CHRC_PROP_WRITE; *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_WRITE; + *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_AUTHEN; + } else if (!strcmp("secure-read", flag)) { + *props |= BT_GATT_CHRC_PROP_READ; + *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_READ; + *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_SECURE; + } else if (!strcmp("secure-write", flag)) { + *props |= BT_GATT_CHRC_PROP_WRITE; + *ext_props |= BT_GATT_CHRC_EXT_PROP_AUTH_WRITE; + *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_SECURE; } else { error("Invalid characteristic flag: %s", flag); return false; @@ -1545,6 +1204,10 @@ static bool parse_desc_flags(DBusMessageIter *array, uint32_t *perm) *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_AUTHEN; else if (!strcmp("encrypt-authenticated-write", flag)) *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_AUTHEN; + else if (!strcmp("secure-read", flag)) + *perm |= BT_ATT_PERM_READ | BT_ATT_PERM_READ_SECURE; + else if (!strcmp("secure-write", flag)) + *perm |= BT_ATT_PERM_WRITE | BT_ATT_PERM_WRITE_SECURE; else { error("Invalid descriptor flag: %s", flag); return false; @@ -1558,6 +1221,7 @@ static bool parse_flags(GDBusProxy *proxy, uint8_t *props, uint8_t *ext_props, uint32_t *perm) { DBusMessageIter iter, array; + const char *iface; if (!g_dbus_proxy_get_property(proxy, "Flags", &iter)) return false; @@ -1567,10 +1231,11 @@ static bool parse_flags(GDBusProxy *proxy, uint8_t *props, uint8_t *ext_props, dbus_message_iter_recurse(&iter, &array); - if (perm) + iface = g_dbus_proxy_get_interface(proxy); + if (!strcmp(iface, GATT_DESC_IFACE)) return parse_desc_flags(&array, perm); - return parse_chrc_flags(&array, props, ext_props); + return parse_chrc_flags(&array, props, ext_props, perm); } static struct external_chrc *chrc_create(struct gatt_app *app, @@ -1618,7 +1283,7 @@ static struct external_chrc *chrc_create(struct gatt_app *app, * are used to determine if any special descriptors should be * created. */ - if (!parse_flags(proxy, &chrc->props, &chrc->ext_props, NULL)) { + if (!parse_flags(proxy, &chrc->props, &chrc->ext_props, &chrc->perm)) { error("Failed to parse characteristic properties"); goto fail; } @@ -1937,37 +1602,17 @@ static void pending_op_free(void *data) free(op); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static struct pending_op *pending_read_new(struct queue *owner_queue, - struct gatt_db_attribute *attrib, - struct bt_att *att, - unsigned int id) -#else -static struct pending_op *pending_read_new(struct queue *owner_queue, +static struct pending_op *pending_read_new(struct btd_device *device, + struct queue *owner_queue, struct gatt_db_attribute *attrib, unsigned int id) -#endif { struct pending_op *op; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bdaddr_t bdaddr; - uint8_t bdaddr_type; -#endif op = new0(struct pending_op, 1); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!get_dst_info(att, &bdaddr, &bdaddr_type)) { - return NULL; - } -#endif - op->owner_queue = owner_queue; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - memcpy(&op->bdaddr, &bdaddr, sizeof(bdaddr_t)); - op->bdaddr_type = bdaddr_type; -#endif - + op->device = device; op->attrib = attrib; op->id = id; queue_push_tail(owner_queue, op); @@ -1975,75 +1620,75 @@ static struct pending_op *pending_read_new(struct queue *owner_queue, return op; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY +static void append_options(DBusMessageIter *iter, void *user_data) +{ + struct pending_op *op = user_data; + const char *path = device_get_path(op->device); + + dict_append_entry(iter, "device", DBUS_TYPE_OBJECT_PATH, &path); +} + static void read_setup_cb(DBusMessageIter *iter, void *user_data) { struct pending_op *op = user_data; - char dst_addr[18] = { 0 }; - char *addr_value = dst_addr; - uint16_t offset = 0; + DBusMessageIter dict; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, + &dict); + + append_options(&dict, op); - ba2str(&op->bdaddr, dst_addr); - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &addr_value); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &op->id); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &offset); + dbus_message_iter_close_container(iter, &dict); } -#endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void send_read(struct gatt_db_attribute *attrib, struct bt_att *att, - GDBusProxy *proxy, struct queue *owner_queue, - unsigned int id) -#else -static void send_read(struct gatt_db_attribute *attrib, GDBusProxy *proxy, - struct queue *owner_queue, - unsigned int id) -#endif +static struct pending_op *send_read(struct btd_device *device, + struct gatt_db_attribute *attrib, + GDBusProxy *proxy, + struct queue *owner_queue, + unsigned int id) { struct pending_op *op; - uint8_t ecode = BT_ATT_ERROR_UNLIKELY; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - op = pending_read_new(owner_queue, attrib, att, id); -#else - op = pending_read_new(owner_queue, attrib, id); -#endif + op = pending_read_new(device, owner_queue, attrib, id); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (g_dbus_proxy_method_call(proxy, "ReadValue", read_setup_cb, read_reply_cb, - op, pending_op_free) == TRUE) -#else - if (g_dbus_proxy_method_call(proxy, "ReadValue", NULL, read_reply_cb, - op, pending_op_free) == TRUE) -#endif - return; + if (g_dbus_proxy_method_call(proxy, "ReadValue", read_setup_cb, + read_reply_cb, op, pending_op_free) == TRUE) + return op; pending_op_free(op); - gatt_db_attribute_read_result(attrib, id, ecode, NULL, 0); + return NULL; } static void write_setup_cb(DBusMessageIter *iter, void *user_data) { struct pending_op *op = user_data; - DBusMessageIter array; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char dst_addr[18] = { 0 }; - char *addr_value = dst_addr; - uint16_t offset = 0; - gboolean response_needed = TRUE; - - ba2str(&op->bdaddr, dst_addr); - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &addr_value); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &op->id); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &offset); - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &response_needed); -#endif + DBusMessageIter array, dict; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "y", &array); dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, &op->data.iov_base, op->data.iov_len); dbus_message_iter_close_container(iter, &array); + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, + &dict); + + append_options(&dict, op); + + dbus_message_iter_close_container(iter, &dict); + + if (!op->owner_queue) { + gatt_db_attribute_write_result(op->attrib, op->id, 0); + pending_op_free(op); + } } static void write_reply_cb(DBusMessage *message, void *user_data) @@ -2082,40 +1727,21 @@ done: gatt_db_attribute_write_result(op->attrib, op->id, ecode); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static struct pending_op *pending_write_new(struct queue *owner_queue, - struct gatt_db_attribute *attrib, struct bt_att *att, - unsigned int id, - const uint8_t *value, - size_t len) -#else -static struct pending_op *pending_write_new(struct queue *owner_queue, +static struct pending_op *pending_write_new(struct btd_device *device, + struct queue *owner_queue, struct gatt_db_attribute *attrib, unsigned int id, const uint8_t *value, size_t len) -#endif { struct pending_op *op; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bdaddr_t bdaddr; - uint8_t bdaddr_type; -#endif op = new0(struct pending_op, 1); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!get_dst_info(att, &bdaddr, &bdaddr_type)) { - return NULL; - } -#endif op->data.iov_base = (uint8_t *) value; op->data.iov_len = len; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - memcpy(&op->bdaddr, &bdaddr, sizeof(bdaddr_t)); - op->bdaddr_type = bdaddr_type; -#endif + op->device = device; op->owner_queue = owner_queue; op->attrib = attrib; op->id = id; @@ -2124,65 +1750,25 @@ static struct pending_op *pending_write_new(struct queue *owner_queue, return op; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void send_write(struct gatt_db_attribute *attrib, struct bt_att *att, - GDBusProxy *proxy, struct queue *owner_queue, - unsigned int id, const uint8_t *value, size_t len) -#else -static void send_write(struct gatt_db_attribute *attrib, GDBusProxy *proxy, +static struct pending_op *send_write(struct btd_device *device, + struct gatt_db_attribute *attrib, + GDBusProxy *proxy, struct queue *owner_queue, unsigned int id, const uint8_t *value, size_t len) -#endif { struct pending_op *op; - uint8_t ecode = BT_ATT_ERROR_UNLIKELY; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - op = pending_write_new(owner_queue, attrib, att, id, value, len); -#else - op = pending_write_new(owner_queue, attrib, id, value, len); -#endif + op = pending_write_new(device, owner_queue, attrib, id, value, len); if (g_dbus_proxy_method_call(proxy, "WriteValue", write_setup_cb, - write_reply_cb, op, - pending_op_free) == TRUE) - return; + owner_queue ? write_reply_cb : NULL, + op, pending_op_free) == TRUE) + return op; pending_op_free(op); - gatt_db_attribute_write_result(attrib, id, ecode); -} - -static uint32_t permissions_from_props(uint8_t props, uint8_t ext_props) -{ - uint32_t perm = 0; - - if (props & BT_GATT_CHRC_PROP_WRITE || - props & BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP || - ext_props & BT_GATT_CHRC_EXT_PROP_RELIABLE_WRITE || - ext_props & BT_GATT_CHRC_EXT_PROP_ENC_WRITE || - ext_props & BT_GATT_CHRC_EXT_PROP_AUTH_WRITE) - perm |= BT_ATT_PERM_WRITE; - - if (props & BT_GATT_CHRC_PROP_READ || - ext_props & BT_GATT_CHRC_EXT_PROP_ENC_READ || - ext_props & BT_GATT_CHRC_EXT_PROP_AUTH_READ) - perm |= BT_ATT_PERM_READ; - - if (ext_props & BT_GATT_CHRC_EXT_PROP_ENC_READ) - perm |= BT_ATT_PERM_READ_ENCRYPT; - - if (ext_props & BT_GATT_CHRC_EXT_PROP_ENC_WRITE) - perm |= BT_ATT_PERM_WRITE_ENCRYPT; - - if (ext_props & BT_GATT_CHRC_EXT_PROP_AUTH_READ) - perm |= BT_ATT_PERM_READ_AUTHEN; - - if (ext_props & BT_GATT_CHRC_EXT_PROP_AUTH_WRITE) - perm |= BT_ATT_PERM_WRITE_AUTHEN; - - return perm; + return NULL; } static uint8_t ccc_write_cb(uint16_t value, void *user_data) @@ -2240,87 +1826,7 @@ static void property_changed_cb(GDBusProxy *proxy, const char *name, DBusMessageIter array; uint8_t *value = NULL; int len = 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bool enable = FALSE; - const bdaddr_t *unicast_addr = NULL; -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (strcmp(name, "Value") == 0) { - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) { - DBG("Malformed \"Value\" property received"); - return; - } - - dbus_message_iter_recurse(iter, &array); - dbus_message_iter_get_fixed_array(&array, &value, &len); - - if (len < 0) { - DBG("Malformed \"Value\" property received"); - return; - } - - /* Truncate the value if it's too large */ - len = MIN(BT_ATT_MAX_VALUE_LEN, len); - value = len ? value : NULL; - } else if (strcmp(name, "Notifying") == 0) { - gboolean notify_indicate = FALSE; - - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN) { - DBG("Malformed \"Notifying\" property received"); - return; - } - - dbus_message_iter_get_basic(iter, ¬ify_indicate); - - DBG("Set Notification %d", notify_indicate); - /* Set notification/indication */ - set_ccc_notify_indicate(chrc->ccc, notify_indicate); - return; - } else if (strcmp(name, "Unicast") == 0) { - const char *address = NULL; - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_STRING) { - DBG("Malformed \"Value\" property received"); - return; - } - - dbus_message_iter_get_basic(iter, &address); - - if (address) { - /* Set the address for unicast notification/indication */ - set_ccc_unicast_address(chrc->ccc, address); - } - return; - } else - return; - - enable = get_ccc_notify_indicate(chrc->ccc); - - if (enable) { - unicast_addr = get_ccc_unicast_address(chrc->ccc); - - if (unicast_addr && bacmp(unicast_addr, BDADDR_ANY)) { - send_unicast_notification_indication_to_device(proxy, - chrc->service->app->database, - gatt_db_attribute_get_handle(chrc->attrib), - value, len, - gatt_db_attribute_get_handle(chrc->ccc), - chrc->props & BT_GATT_CHRC_PROP_INDICATE, - unicast_addr); - /* reset the unicast address */ - set_ccc_unicast_address(chrc->ccc, NULL); - } else { - send_notification_indication_to_devices(proxy, - chrc->service->app->database, - gatt_db_attribute_get_handle(chrc->attrib), - value, len, - gatt_db_attribute_get_handle(chrc->ccc), - chrc->props & BT_GATT_CHRC_PROP_INDICATE); - } - set_ccc_notify_indicate(chrc->ccc, FALSE); - } -#else if (strcmp(name, "Value")) return; @@ -2346,7 +1852,6 @@ static void property_changed_cb(GDBusProxy *proxy, const char *name, value, len, gatt_db_attribute_get_handle(chrc->ccc), chrc->props & BT_GATT_CHRC_PROP_INDICATE); -#endif } static bool database_add_ccc(struct external_service *service, @@ -2416,22 +1921,65 @@ static bool database_add_cep(struct external_service *service, return true; } +static struct btd_device *att_get_device(struct bt_att *att) +{ + GIOChannel *io = NULL; + GError *gerr = NULL; + bdaddr_t src, dst; + uint8_t dst_type; + struct btd_adapter *adapter; + + io = g_io_channel_unix_new(bt_att_get_fd(att)); + if (!io) + return NULL; + + bt_io_get(io, &gerr, BT_IO_OPT_SOURCE_BDADDR, &src, + BT_IO_OPT_DEST_BDADDR, &dst, + BT_IO_OPT_DEST_TYPE, &dst_type, + BT_IO_OPT_INVALID); + if (gerr) { + error("bt_io_get: %s", gerr->message); + g_error_free(gerr); + g_io_channel_unref(io); + return NULL; + } + + g_io_channel_unref(io); + + adapter = adapter_find(&src); + if (!adapter) { + error("Unable to find adapter object"); + return NULL; + } + + return btd_adapter_find_device(adapter, &dst, dst_type); +} + static void desc_read_cb(struct gatt_db_attribute *attrib, unsigned int id, uint16_t offset, uint8_t opcode, struct bt_att *att, void *user_data) { struct external_desc *desc = user_data; + struct btd_device *device; if (desc->attrib != attrib) { error("Read callback called with incorrect attribute"); - return; + goto fail; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - send_read(attrib, att, desc->proxy, desc->pending_reads, id); -#else - send_read(attrib, desc->proxy, desc->pending_reads, id); -#endif + + device = att_get_device(att); + if (!device) { + error("Unable to find device object"); + goto fail; + } + + if (send_read(device, attrib, desc->proxy, desc->pending_reads, id)) + return; + +fail: + gatt_db_attribute_read_result(attrib, id, BT_ATT_ERROR_UNLIKELY, + NULL, 0); } static void desc_write_cb(struct gatt_db_attribute *attrib, @@ -2441,17 +1989,26 @@ static void desc_write_cb(struct gatt_db_attribute *attrib, void *user_data) { struct external_desc *desc = user_data; + struct btd_device *device; if (desc->attrib != attrib) { error("Read callback called with incorrect attribute"); - return; + goto fail; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - send_write(attrib, att, desc->proxy, desc->pending_writes, id, value, len); -#else - send_write(attrib, desc->proxy, desc->pending_writes, id, value, len); -#endif + device = att_get_device(att); + if (!device) { + error("Unable to find device object"); + goto fail; + } + + if (send_write(device, attrib, desc->proxy, desc->pending_writes, id, + value, len)) + return; + +fail: + gatt_db_attribute_read_result(attrib, id, BT_ATT_ERROR_UNLIKELY, + NULL, 0); } static bool database_add_desc(struct external_service *service, @@ -2484,98 +2041,26 @@ static void chrc_read_cb(struct gatt_db_attribute *attrib, void *user_data) { struct external_chrc *chrc = user_data; + struct btd_device *device; if (chrc->attrib != attrib) { error("Read callback called with incorrect attribute"); - return; + goto fail; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - send_read(attrib, att, chrc->proxy, chrc->pending_reads, id); -#else - send_read(attrib, chrc->proxy, chrc->pending_reads, id); -#endif -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct write_without_response_data { - unsigned int id; - bdaddr_t dst_addr; - uint8_t dst_addr_type; - struct iovec *iov; -}; -#endif - -static void write_without_response_setup_cb(DBusMessageIter *iter, - void *user_data) -{ - DBusMessageIter array; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - struct iovec *iov = user_data; -#else - struct write_without_response_data *write_data = user_data; - struct iovec *iov = write_data->iov; - char dst_addr[18]; - char *addr_str = dst_addr; - uint16_t offset = 0; - gboolean response_needed = FALSE; - - ba2str(&write_data->dst_addr, dst_addr); - dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &addr_str); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &write_data->id); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &offset); - dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &response_needed); -#endif - - dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "y", &array); - dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, - &iov->iov_base, iov->iov_len); - dbus_message_iter_close_container(iter, &array); -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void send_write_without_response(struct gatt_db_attribute *attrib, - struct bt_att *att, - GDBusProxy *proxy, unsigned int id, - const uint8_t *value, size_t len) -{ - struct iovec iov; - uint8_t ecode = 0; - struct write_without_response_data write_data; - - iov.iov_base = (uint8_t *) value; - iov.iov_len = len; - - write_data.id = id; - write_data.iov = &iov; - get_dst_info(att, &write_data.dst_addr, &write_data.dst_addr_type); - - if (!g_dbus_proxy_method_call(proxy, "WriteValue", - write_without_response_setup_cb, - NULL, &write_data, NULL)) - ecode = BT_ATT_ERROR_UNLIKELY; - - gatt_db_attribute_write_result(attrib, id, ecode); -} -#else -static void send_write_without_response(struct gatt_db_attribute *attrib, - GDBusProxy *proxy, unsigned int id, - const uint8_t *value, size_t len) -{ - struct iovec iov; - uint8_t ecode = 0; - - iov.iov_base = (uint8_t *) value; - iov.iov_len = len; + device = att_get_device(att); + if (!device) { + error("Unable to find device object"); + goto fail; + } - if (!g_dbus_proxy_method_call(proxy, "WriteValue", - write_without_response_setup_cb, - NULL, &iov, NULL)) - ecode = BT_ATT_ERROR_UNLIKELY; + if (send_read(device, attrib, chrc->proxy, chrc->pending_reads, id)) + return; - gatt_db_attribute_write_result(attrib, id, ecode); +fail: + gatt_db_attribute_read_result(attrib, id, BT_ATT_ERROR_UNLIKELY, + NULL, 0); } -#endif static void chrc_write_cb(struct gatt_db_attribute *attrib, unsigned int id, uint16_t offset, @@ -2584,65 +2069,37 @@ static void chrc_write_cb(struct gatt_db_attribute *attrib, void *user_data) { struct external_chrc *chrc = user_data; + struct btd_device *device; + struct queue *queue; if (chrc->attrib != attrib) { error("Write callback called with incorrect attribute"); - return; + goto fail; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((!(chrc->props & BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP) && - opcode == BT_ATT_OP_WRITE_CMD) || - (!(chrc->props & BT_GATT_CHRC_PROP_WRITE) && - opcode == BT_ATT_OP_WRITE_REQ)) { - uint8_t ecode = BT_ATT_ERROR_UNLIKELY; - error("Property and opcode is not matched"); - gatt_db_attribute_write_result(attrib, id, ecode); - return; + device = att_get_device(att); + if (!device) { + error("Unable to find device object"); + goto fail; } - if (opcode == BT_ATT_OP_WRITE_CMD) { - send_write_without_response(attrib, att, chrc->proxy, - id, value, len); - return; - } + if (!(chrc->props & BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP)) + queue = chrc->pending_writes; + else + queue = NULL; - send_write(attrib, att, chrc->proxy, chrc->pending_writes, - id, value, len); -#else - if (chrc->props & BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP) { - send_write_without_response(attrib, chrc->proxy, id, value, - len); + if (send_write(device, attrib, chrc->proxy, queue, id, value, len)) return; - } - send_write(attrib, chrc->proxy, chrc->pending_writes, id, value, len); -#endif -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static bool database_check_ccc_desc(struct external_desc *desc) -{ - bt_uuid_t uuid, uuid_ccc; - - if (!parse_uuid(desc->proxy, &uuid)) { - error("Failed to read \"UUID\" property of descriptor"); - return false; - } - - bt_uuid16_create(&uuid_ccc, GATT_CLIENT_CHARAC_CFG_UUID); - if (bt_uuid_cmp(&uuid, &uuid_ccc) == 0) - return true; - else - return false; +fail: + gatt_db_attribute_read_result(attrib, id, BT_ATT_ERROR_UNLIKELY, + NULL, 0); } -#endif static bool database_add_chrc(struct external_service *service, struct external_chrc *chrc) { bt_uuid_t uuid; - uint32_t perm; const struct queue_entry *entry; if (!parse_uuid(chrc->proxy, &uuid)) { @@ -2655,14 +2112,8 @@ static bool database_add_chrc(struct external_service *service, return false; } - /* - * TODO: Once shared/gatt-server properly supports permission checks, - * set the permissions based on a D-Bus property of the external - * characteristic. - */ - perm = permissions_from_props(chrc->props, chrc->ext_props); chrc->attrib = gatt_db_service_add_characteristic(service->attrib, - &uuid, perm, + &uuid, chrc->perm, chrc->props, chrc_read_cb, chrc_write_cb, chrc); if (!chrc->attrib) { @@ -2670,13 +2121,8 @@ static bool database_add_chrc(struct external_service *service, return false; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - /* Existing implementation adds CCC descriptor by default - * if notification and indication properties are set. But as per the requirment - * CCCD shall be added by the application */ if (!database_add_ccc(service, chrc)) return false; -#endif if (!database_add_cep(service, chrc)) return false; @@ -2689,28 +2135,11 @@ static bool database_add_chrc(struct external_service *service, if (desc->handled || g_strcmp0(desc->chrc_path, chrc->path)) continue; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* Check if Application wants to add CCC and use existing - * implemenation to add CCC descriptors */ - if (database_check_ccc_desc(desc)) { - if (!database_add_ccc(service, chrc)) { - chrc->attrib = NULL; - return false; - } - desc->attrib = chrc->ccc; - desc->handled = true; - } else if (!database_add_desc(service, desc)) { - chrc->attrib = NULL; - error("Failed to create descriptor entry"); - return false; - } -#else if (!database_add_desc(service, desc)) { chrc->attrib = NULL; error("Failed to create descriptor entry"); return false; } -#endif } return true; @@ -2777,9 +2206,6 @@ static bool database_add_app(struct gatt_app *app) { const struct queue_entry *entry; - if (queue_isempty(app->services)) - return false; - entry = queue_get_entries(app->services); while (entry) { if (!database_add_service(entry->data)) { @@ -2793,6 +2219,131 @@ static bool database_add_app(struct gatt_app *app) return true; } +static int profile_device_probe(struct btd_service *service) +{ + struct btd_profile *p = btd_service_get_profile(service); + + DBG("%s probed", p->name); + + return 0; +} + +static void profile_device_remove(struct btd_service *service) +{ + struct btd_profile *p = btd_service_get_profile(service); + + DBG("%s removed", p->name); +} + +static int profile_add(struct external_profile *profile, const char *uuid) +{ + struct btd_profile *p; + + p = new0(struct btd_profile, 1); + + /* Assign directly to avoid having extra fields */ + p->name = (const void *) g_strdup_printf("%s%s/%s", profile->app->owner, + g_dbus_proxy_get_path(profile->proxy), uuid); + if (!p->name) { + free(p); + return -ENOMEM; + } + + p->remote_uuid = (const void *) g_strdup(uuid); + if (!p->remote_uuid) { + g_free((void *) p->name); + free(p); + return -ENOMEM; + } + + p->device_probe = profile_device_probe; + p->device_remove = profile_device_remove; + p->auto_connect = true; + p->external = true; + + queue_push_tail(profile->profiles, p); + + DBG("Added \"%s\"", p->name); + + return 0; +} + +static void add_profile(void *data, void *user_data) +{ + struct btd_adapter *adapter = user_data; + + btd_profile_register(data); + adapter_add_profile(adapter, data); +} + +static struct external_profile *create_profile(struct gatt_app *app, + GDBusProxy *proxy, + const char *path) +{ + struct external_profile *profile; + DBusMessageIter iter, array; + + if (!path || !g_str_has_prefix(path, "/")) + return NULL; + + profile = new0(struct external_profile, 1); + + profile->app = app; + profile->proxy = g_dbus_proxy_ref(proxy); + profile->profiles = queue_new(); + + if (!g_dbus_proxy_get_property(proxy, "UUIDs", &iter)) { + DBG("UUIDs property not found"); + goto fail; + } + + dbus_message_iter_recurse(&iter, &array); + + while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) { + const char *uuid; + + dbus_message_iter_get_basic(&array, &uuid); + + if (profile_add(profile, uuid) < 0) + goto fail; + + dbus_message_iter_next(&array); + } + + if (queue_isempty(profile->profiles)) + goto fail; + + queue_foreach(profile->profiles, add_profile, app->database->adapter); + queue_push_tail(app->profiles, profile); + + return profile; + +fail: + profile_free(profile); + return NULL; +} + +static void register_profile(void *data, void *user_data) +{ + struct gatt_app *app = user_data; + GDBusProxy *proxy = data; + const char *iface = g_dbus_proxy_get_interface(proxy); + const char *path = g_dbus_proxy_get_path(proxy); + + if (app->failed) + return; + + if (g_strcmp0(iface, GATT_PROFILE_IFACE) == 0) { + struct external_profile *profile; + + profile = create_profile(app, proxy, path); + if (!profile) { + app->failed = true; + return; + } + } +} + static void register_service(void *data, void *user_data) { struct gatt_app *app = user_data; @@ -2875,11 +2426,13 @@ static void client_ready_cb(GDBusClient *client, void *user_data) goto reply; } + queue_foreach(app->proxies, register_profile, app); queue_foreach(app->proxies, register_service, app); queue_foreach(app->proxies, register_characteristic, app); queue_foreach(app->proxies, register_descriptor, app); - if (!app->services || app->failed) { + if ((queue_isempty(app->services) && queue_isempty(app->profiles)) || + app->failed) { error("No valid external GATT objects found"); fail = true; reply = btd_error_failed(app->reg, @@ -2932,6 +2485,7 @@ static struct gatt_app *create_app(DBusConnection *conn, DBusMessage *msg, goto fail; app->services = queue_new(); + app->profiles = queue_new(); app->proxies = queue_new(); app->reg = dbus_message_ref(msg); @@ -3018,237 +2572,15 @@ static DBusMessage *manager_unregister_app(DBusConnection *conn, return dbus_message_new_method_return(msg); } -static void profile_exited(DBusConnection *conn, void *user_data) -{ - struct external_profile *profile = user_data; - - DBG("\"%s\" exited", profile->owner); - - profile->id = 0; - - queue_remove(profile->database->profiles, profile); - - profile_free(profile); -} - -static int profile_device_probe(struct btd_service *service) -{ - struct btd_profile *p = btd_service_get_profile(service); - - DBG("%s probed", p->name); - - return 0; -} - -static void profile_device_remove(struct btd_service *service) -{ - struct btd_profile *p = btd_service_get_profile(service); - - DBG("%s removed", p->name); -} - -static int profile_add(struct external_profile *profile, const char *uuid) -{ - struct btd_profile *p; - - p = new0(struct btd_profile, 1); - - /* Assign directly to avoid having extra fields */ - p->name = (const void *) g_strdup_printf("%s%s/%s", profile->owner, - profile->path, uuid); - if (!p->name) { - free(p); - return -ENOMEM; - } - - p->remote_uuid = (const void *) g_strdup(uuid); - if (!p->remote_uuid) { - g_free((void *) p->name); - free(p); - return -ENOMEM; - } - - p->device_probe = profile_device_probe; - p->device_remove = profile_device_remove; - p->auto_connect = true; - p->external = true; - - queue_push_tail(profile->profiles, p); - - DBG("Added \"%s\"", p->name); - - return 0; -} - -static void add_profile(void *data, void *user_data) -{ - struct btd_adapter *adapter = user_data; - - btd_profile_register(data); - adapter_add_profile(adapter, data); -} - -static int profile_create(DBusConnection *conn, - struct btd_gatt_database *database, - const char *sender, const char *path, - DBusMessageIter *iter) -{ - struct external_profile *profile; - DBusMessageIter uuids; - - if (!path || !g_str_has_prefix(path, "/")) - return -EINVAL; - - profile = new0(struct external_profile, 1); - - profile->owner = g_strdup(sender); - if (!profile->owner) - goto fail; - - profile->path = g_strdup(path); - if (!profile->path) - goto fail; - - profile->profiles = queue_new(); - profile->database = database; - profile->id = g_dbus_add_disconnect_watch(conn, sender, profile_exited, - profile, NULL); - - dbus_message_iter_recurse(iter, &uuids); - - while (dbus_message_iter_get_arg_type(&uuids) == DBUS_TYPE_STRING) { - const char *uuid; - - dbus_message_iter_get_basic(&uuids, &uuid); - - if (profile_add(profile, uuid) < 0) - goto fail; - - dbus_message_iter_next(&uuids); - } - - if (queue_isempty(profile->profiles)) - goto fail; - - queue_foreach(profile->profiles, add_profile, database->adapter); - queue_push_tail(database->profiles, profile); - - return 0; - -fail: - profile_free(profile); - return -EINVAL; -} - -static bool match_profile(const void *a, const void *b) -{ - const struct external_profile *profile = a; - const struct svc_match_data *data = b; - - return g_strcmp0(profile->path, data->path) == 0 && - g_strcmp0(profile->owner, data->sender) == 0; -} - -static DBusMessage *manager_register_profile(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct btd_gatt_database *database = user_data; - const char *sender = dbus_message_get_sender(msg); - DBusMessageIter args; - const char *path; - struct svc_match_data match_data; - - DBG("sender %s", sender); - - if (!dbus_message_iter_init(msg, &args)) - return btd_error_invalid_args(msg); - - if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_OBJECT_PATH) - return btd_error_invalid_args(msg); - - dbus_message_iter_get_basic(&args, &path); - - match_data.path = path; - match_data.sender = sender; - - if (queue_find(database->profiles, match_profile, &match_data)) - return btd_error_already_exists(msg); - - dbus_message_iter_next(&args); - if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_ARRAY) - return btd_error_invalid_args(msg); - - if (profile_create(conn, database, sender, path, &args) < 0) - return btd_error_failed(msg, "Failed to register profile"); - - return dbus_message_new_method_return(msg); -} - -static DBusMessage *manager_unregister_profile(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - struct btd_gatt_database *database = user_data; - const char *sender = dbus_message_get_sender(msg); - const char *path; - DBusMessageIter args; - struct external_profile *profile; - struct svc_match_data match_data; - - if (!dbus_message_iter_init(msg, &args)) - return btd_error_invalid_args(msg); - - if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_OBJECT_PATH) - return btd_error_invalid_args(msg); - - dbus_message_iter_get_basic(&args, &path); - - match_data.path = path; - match_data.sender = sender; - - profile = queue_remove_if(database->profiles, match_profile, - &match_data); - if (!profile) - return btd_error_does_not_exist(msg); - - profile_free(profile); - - return dbus_message_new_method_return(msg); -} - static const GDBusMethodTable manager_methods[] = { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY { GDBUS_ASYNC_METHOD("RegisterApplication", - GDBUS_ARGS({ "application", "o" }, - { "options", "a{sv}" }), NULL, - manager_register_app) }, + GDBUS_ARGS({ "application", "o" }, + { "options", "a{sv}" }), + NULL, manager_register_app) }, { GDBUS_ASYNC_METHOD("UnregisterApplication", GDBUS_ARGS({ "application", "o" }), NULL, manager_unregister_app) }, - { GDBUS_ASYNC_METHOD("RegisterProfile", - GDBUS_ARGS({ "profile", "o" }, { "UUIDs", "as" }, - { "options", "a{sv}" }), NULL, - manager_register_profile) }, - { GDBUS_ASYNC_METHOD("UnregisterProfile", - GDBUS_ARGS({ "profile", "o" }), - NULL, manager_unregister_profile) }, { } -#else - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("RegisterApplication", - GDBUS_ARGS({ "application", "o" }, - { "options", "a{sv}" }), NULL, - manager_register_app) }, - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("UnregisterApplication", - GDBUS_ARGS({ "application", "o" }), - NULL, manager_unregister_app) }, - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("RegisterProfile", - GDBUS_ARGS({ "profile", "o" }, { "UUIDs", "as" }, - { "options", "a{sv}" }), NULL, - manager_register_profile) }, - { GDBUS_EXPERIMENTAL_ASYNC_METHOD("UnregisterProfile", - GDBUS_ARGS({ "profile", "o" }), - NULL, manager_unregister_profile) }, - { } -#endif }; struct btd_gatt_database *btd_gatt_database_new(struct btd_adapter *adapter) diff --git a/src/gatt-database.h b/src/gatt-database.h old mode 100644 new mode 100755 index 163b601..0d9106b --- a/src/gatt-database.h +++ b/src/gatt-database.h @@ -23,14 +23,3 @@ struct btd_gatt_database *btd_gatt_database_new(struct btd_adapter *adapter); void btd_gatt_database_destroy(struct btd_gatt_database *database); struct gatt_db *btd_gatt_database_get_db(struct btd_gatt_database *database); - -typedef uint8_t (*btd_gatt_database_ccc_write_t) (uint16_t value, - void *user_data); -typedef void (*btd_gatt_database_destroy_t) (void *data); - -struct gatt_db_attribute * -btd_gatt_database_add_ccc(struct btd_gatt_database *database, - uint16_t service_handle, - btd_gatt_database_ccc_write_t write_callback, - void *user_data, - btd_gatt_database_destroy_t destroy); diff --git a/src/hcid.h b/src/hcid.h old mode 100644 new mode 100755 index e747590..0b785ee --- a/src/hcid.h +++ b/src/hcid.h @@ -35,15 +35,12 @@ struct main_opts { uint16_t autoto; uint32_t pairto; uint32_t discovto; + uint8_t privacy; + gboolean reverse_sdp; gboolean name_resolv; gboolean debug_keys; gboolean fast_conn; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - gboolean le_privacy; - gboolean auto_pairing; - char *pin_code; -#endif uint16_t did_source; uint16_t did_vendor; diff --git a/src/log.c b/src/log.c old mode 100644 new mode 100755 index 8a5057e..d2a20de --- a/src/log.c +++ b/src/log.c @@ -302,22 +302,6 @@ void __btd_toggle_debug(void) desc->flags |= BTD_DEBUG_FLAG_PRINT; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void __hci_attach_log_init(void) -{ - int option = LOG_NDELAY | LOG_PID; - - enabled = g_strsplit_set(g_strdup("*"), ":, ", 0); - - __btd_enable_debug(__start___debug, __stop___debug); - - openlog("hciattach", option, LOG_DAEMON); - - syslog(LOG_INFO, "hciattach daemon for debugging"); -} -#endif - - void __btd_log_init(const char *debug, int detach) { int option = LOG_NDELAY | LOG_PID; diff --git a/src/log.h b/src/log.h old mode 100644 new mode 100755 index 1299cdd..0d243ce --- a/src/log.h +++ b/src/log.h @@ -39,9 +39,6 @@ void btd_info(uint16_t index, const char *format, ...) void btd_debug(uint16_t index, const char *format, ...) __attribute__((format(printf, 2, 3))); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void __hci_attach_log_init(void ); -#endif void __btd_log_init(const char *debug, int detach); void __btd_log_cleanup(void); void __btd_toggle_debug(void); diff --git a/src/main.c b/src/main.c old mode 100644 new mode 100755 index 64bd72d..bcc1e6f --- a/src/main.c +++ b/src/main.c @@ -89,11 +89,7 @@ static const char * const supported_options[] = { "DebugKeys", "ControllerMode", "MultiProfile", -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - "EnableLEPrivacy", - "AutoParing", - "PinCode", -#endif + "Privacy", }; GKeyFile *btd_get_main_conf(void) @@ -260,6 +256,26 @@ static void parse_config(GKeyFile *config) main_opts.autoto = val; } + str = g_key_file_get_string(config, "General", "Privacy", &err); + if (err) { + DBG("%s", err->message); + g_clear_error(&err); + main_opts.privacy = 0x00; + } else { + DBG("privacy=%s", str); + + if (!strcmp(str, "device")) + main_opts.privacy = 0x01; + else if (!strcmp(str, "off")) + main_opts.privacy = 0x00; + else { + DBG("Invalid privacy option: %s", str); + main_opts.privacy = 0x00; + } + + g_free(str); + } + str = g_key_file_get_string(config, "General", "Name", &err); if (err) { DBG("%s", err->message); @@ -341,30 +357,6 @@ static void parse_config(GKeyFile *config) g_clear_error(&err); else main_opts.fast_conn = boolean; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - boolean = g_key_file_get_boolean(config, "General", - "EnableLEPrivacy", &err); - if (err) - g_clear_error(&err); - else - main_opts.le_privacy = boolean; - - boolean = g_key_file_get_boolean(config, "General", - "AutoPairing", &err); - if (err) - g_clear_error(&err); - else - main_opts.auto_pairing = boolean; - - str = g_key_file_get_string(config, "General", "PinCode", &err); - if (err) { - g_clear_error(&err); - } else { - DBG("PinCode=%s", str); - g_free(main_opts.pin_code); - main_opts.pin_code = str; - } -#endif } static void init_defaults(void) @@ -380,18 +372,14 @@ static void init_defaults(void) main_opts.reverse_sdp = TRUE; main_opts.name_resolv = TRUE; main_opts.debug_keys = FALSE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - main_opts.le_privacy = FALSE; -#endif if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2) return; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY + main_opts.did_source = 0x0002; /* USB */ main_opts.did_vendor = 0x1d6b; /* Linux Foundation */ main_opts.did_product = 0x0246; /* BlueZ */ main_opts.did_version = (major << 8 | minor); -#endif } static void log_handler(const gchar *log_domain, GLogLevelFlags log_level, diff --git a/src/main.conf b/src/main.conf old mode 100644 new mode 100755 index 372fd8c..d9cd9e0 --- a/src/main.conf +++ b/src/main.conf @@ -64,6 +64,13 @@ # 'false'. #FastConnectable = false +# Default privacy setting. +# Enables use of private address. +# Possible values: "off", "device", "network" +# "network" option not supported currently +# Defaults to "off" +# Privacy = off + #[Policy] # # The ReconnectUUIDs defines the set of remote services that should try @@ -71,7 +78,7 @@ # timeout). The policy plugin should contain a sane set of values by # default, but this list can be overridden here. By setting the list to # empty the reconnection feature gets disabled. -#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb, 0000111f-0000-1000-8000-00805f9b34fb, 0000110a-0000-1000-8000-00805f9b34fb +#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb,0000111f-0000-1000-8000-00805f9b34fb,0000110a-0000-1000-8000-00805f9b34fb # ReconnectAttempts define the number of attempts to reconnect after a link # lost. Setting the value to 0 disables reconnecting feature. @@ -81,7 +88,7 @@ # attempts. # If the number of attempts defined in ReconnectAttempts is bigger than the # set of intervals the last interval is repeated until the last attempt. -#ReconnectIntervals=1, 2, 4, 8, 16, 32, 64 +#ReconnectIntervals=1,2,4,8,16,32,64 # AutoEnable defines option to enable all controllers when they are found. # This includes adapters present on start as well as adapters that are plugged diff --git a/src/main_hive.conf b/src/main_hive.conf deleted file mode 100644 index f521092..0000000 --- a/src/main_hive.conf +++ /dev/null @@ -1,87 +0,0 @@ -[General] - -# Default adaper name -# %h - substituted for hostname -# %d - substituted for adapter id -# Defaults to 'BlueZ' -#Name = %h-%d - -# Default device class. Only the major and minor device class bits are -# considered. Defaults to '0x000000'. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -Class = 0x40414 # HIVE -#else -#Class = 0x000100 -#endif - -# How long to stay in discoverable mode before going back to non-discoverable -# The value is in seconds. Default is 180, i.e. 3 minutes. -# 0 = disable timer, i.e. stay discoverable forever -#DiscoverableTimeout = 0 - -# How long to stay in pairable mode before going back to non-discoverable -# The value is in seconds. Default is 0. -# 0 = disable timer, i.e. stay pairable forever -#PairableTimeout = 0 - -# Automatic connection for bonded devices driven by platform/user events. -# If a platform plugin uses this mechanism, automatic connections will be -# enabled during the interval defined below. Initially, this feature -# intends to be used to establish connections to ATT channels. Default is 60. -#AutoConnectTimeout = 60 - -# Use vendor id source (assigner), vendor, product and version information for -# DID profile support. The values are separated by ":" and assigner, VID, PID -# and version. -# Possible vendor id source values: bluetooth, usb (defaults to usb) -#DeviceID = bluetooth:1234:5678:abcd - -# Do reverse service discovery for previously unknown devices that connect to -# us. This option is really only needed for qualification since the BITE tester -# doesn't like us doing reverse SDP for some test cases (though there could in -# theory be other useful purposes for this too). Defaults to 'true'. -#ReverseServiceDiscovery = true - -# Enable name resolving after inquiry. Set it to 'false' if you don't need -# remote devices name and want shorter discovery cycle. Defaults to 'true'. -#NameResolving = true - -# Enable runtime persistency of debug link keys. Default is false which -# makes debug link keys valid only for the duration of the connection -# that they were created for. -#DebugKeys = false - -# Restricts all controllers to the specified transport. Default value -# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW). -# Possible values: "dual", "bredr", "le" -#ControllerMode = dual - -# Enables Multi Profile Specification support. This allows to specify if -# system supports only Multiple Profiles Single Device (MPSD) configuration -# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple -# Devices (MPMD) configurations. -# Possible values: "off", "single", "multiple" -#MultiProfile = off - -# Permanently enables the Fast Connectable setting for adapters that -# support it. When enabled other devices can connect faster to us, -# however the tradeoff is increased power consumptions. This feature -# will fully work only on kernel version 4.1 and newer. Defaults to -# 'false'. -#FastConnectable = false - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -# Enable the LE Privacy feature. If value is true, i.e. LE Privacy is enabled -# otherwise the feature is disabled by default for the local device. -EnableLEPrivacy = true -#endif - -#[Policy] -# -# The ReconnectUUIDs defines the set of remote services that should try -# to be reconnected to in case of a link loss (link supervision -# timeout). The policy plugin should contain a sane set of values by -# default, but this list can be overridden here. By setting the list to -# empty the reconnection feature gets disabled. -#ReconnectUUIDs= - diff --git a/src/main_ivi.conf b/src/main_ivi.conf deleted file mode 100644 index 4e7b1f2..0000000 --- a/src/main_ivi.conf +++ /dev/null @@ -1,87 +0,0 @@ -[General] - -# Default adaper name -# %h - substituted for hostname -# %d - substituted for adapter id -# Defaults to 'BlueZ' -#Name = %h-%d - -# Default device class. Only the major and minor device class bits are -# considered. Defaults to '0x000000'. -#ifdef __TIZEN_PATCH__ -Class = 0x200428 # IVI device -#else -#Class = 0x000100 -#endif - -# How long to stay in discoverable mode before going back to non-discoverable -# The value is in seconds. Default is 180, i.e. 3 minutes. -# 0 = disable timer, i.e. stay discoverable forever -#DiscoverableTimeout = 0 - -# How long to stay in pairable mode before going back to non-discoverable -# The value is in seconds. Default is 0. -# 0 = disable timer, i.e. stay pairable forever -#PairableTimeout = 0 - -# Automatic connection for bonded devices driven by platform/user events. -# If a platform plugin uses this mechanism, automatic connections will be -# enabled during the interval defined below. Initially, this feature -# intends to be used to establish connections to ATT channels. Default is 60. -#AutoConnectTimeout = 60 - -# Use vendor id source (assigner), vendor, product and version information for -# DID profile support. The values are separated by ":" and assigner, VID, PID -# and version. -# Possible vendor id source values: bluetooth, usb (defaults to usb) -#DeviceID = bluetooth:1234:5678:abcd - -# Do reverse service discovery for previously unknown devices that connect to -# us. This option is really only needed for qualification since the BITE tester -# doesn't like us doing reverse SDP for some test cases (though there could in -# theory be other useful purposes for this too). Defaults to 'true'. -#ReverseServiceDiscovery = true - -# Enable name resolving after inquiry. Set it to 'false' if you don't need -# remote devices name and want shorter discovery cycle. Defaults to 'true'. -#NameResolving = true - -# Enable runtime persistency of debug link keys. Default is false which -# makes debug link keys valid only for the duration of the connection -# that they were created for. -#DebugKeys = false - -# Restricts all controllers to the specified transport. Default value -# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW). -# Possible values: "dual", "bredr", "le" -#ControllerMode = dual - -# Enables Multi Profile Specification support. This allows to specify if -# system supports only Multiple Profiles Single Device (MPSD) configuration -# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple -# Devices (MPMD) configurations. -# Possible values: "off", "single", "multiple" -#MultiProfile = off - -# Permanently enables the Fast Connectable setting for adapters that -# support it. When enabled other devices can connect faster to us, -# however the tradeoff is increased power consumptions. This feature -# will fully work only on kernel version 4.1 and newer. Defaults to -# 'false'. -#FastConnectable = false - -#ifdef __TIZEN_PATCH__ -# Enable the LE Privacy feature. If value is true, i.e. LE Privacy is enabled -# otherwise the feature is disabled by default for the local device. -EnableLEPrivacy = true -#endif - -#[Policy] -# -# The ReconnectUUIDs defines the set of remote services that should try -# to be reconnected to in case of a link loss (link supervision -# timeout). The policy plugin should contain a sane set of values by -# default, but this list can be overridden here. By setting the list to -# empty the reconnection feature gets disabled. -#ReconnectUUIDs= - diff --git a/src/main_m.conf b/src/main_m.conf deleted file mode 100644 index eeeb7bd..0000000 --- a/src/main_m.conf +++ /dev/null @@ -1,95 +0,0 @@ -[General] - -# Default adaper name -# %h - substituted for hostname -# %d - substituted for adapter id -# Defaults to 'BlueZ' -#Name = %h-%d - -# Default device class. Only the major and minor device class bits are -# considered. Defaults to '0x000000'. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -Class = 0x00020C # Smart phone -#else -#Class = 0x000100 -#endif - -# How long to stay in discoverable mode before going back to non-discoverable -# The value is in seconds. Default is 180, i.e. 3 minutes. -# 0 = disable timer, i.e. stay discoverable forever -#DiscoverableTimeout = 0 - -# How long to stay in pairable mode before going back to non-discoverable -# The value is in seconds. Default is 0. -# 0 = disable timer, i.e. stay pairable forever -#PairableTimeout = 0 - -# Automatic connection for bonded devices driven by platform/user events. -# If a platform plugin uses this mechanism, automatic connections will be -# enabled during the interval defined below. Initially, this feature -# intends to be used to establish connections to ATT channels. Default is 60. -#AutoConnectTimeout = 60 - -# Use vendor id source (assigner), vendor, product and version information for -# DID profile support. The values are separated by ":" and assigner, VID, PID -# and version. -# Possible vendor id source values: bluetooth, usb (defaults to usb) -#DeviceID = bluetooth:1234:5678:abcd - -# Do reverse service discovery for previously unknown devices that connect to -# us. This option is really only needed for qualification since the BITE tester -# doesn't like us doing reverse SDP for some test cases (though there could in -# theory be other useful purposes for this too). Defaults to 'true'. -#ReverseServiceDiscovery = true - -# Enable name resolving after inquiry. Set it to 'false' if you don't need -# remote devices name and want shorter discovery cycle. Defaults to 'true'. -#NameResolving = true - -# Enable runtime persistency of debug link keys. Default is false which -# makes debug link keys valid only for the duration of the connection -# that they were created for. -#DebugKeys = false - -# Restricts all controllers to the specified transport. Default value -# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW). -# Possible values: "dual", "bredr", "le" -#ControllerMode = dual - -# Enables Multi Profile Specification support. This allows to specify if -# system supports only Multiple Profiles Single Device (MPSD) configuration -# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple -# Devices (MPMD) configurations. -# Possible values: "off", "single", "multiple" -#MultiProfile = off - -# Permanently enables the Fast Connectable setting for adapters that -# support it. When enabled other devices can connect faster to us, -# however the tradeoff is increased power consumptions. This feature -# will fully work only on kernel version 4.1 and newer. Defaults to -# 'false'. -#FastConnectable = false - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -# Enable the LE Privacy feature. If value is true, i.e. LE Privacy is enabled -# otherwise the feature is disabled by default for the local device. -EnableLEPrivacy = false - -# Enable the Auto Pairing feature. If value is true, Auto Paring is enabled -# otherwise the feature is disabled by defaut for the local device. -AutoPairing = false - -# Set the Pin Code for device paring. If AutoPairing is enabled, local device -# will use the specified pin code for device paring. Default value is "0000". -PinCode = 0000 -#endif - -#[Policy] -# -# The ReconnectUUIDs defines the set of remote services that should try -# to be reconnected to in case of a link loss (link supervision -# timeout). The policy plugin should contain a sane set of values by -# default, but this list can be overridden here. By setting the list to -# empty the reconnection feature gets disabled. -#ReconnectUUIDs= - diff --git a/src/main_w.conf b/src/main_w.conf deleted file mode 100644 index cd3e622..0000000 --- a/src/main_w.conf +++ /dev/null @@ -1,92 +0,0 @@ -[General] - -# Default adaper name -# %h - substituted for hostname -# %d - substituted for adapter id -# Defaults to 'BlueZ' -#Name = %h-%d - -# Default device class. Only the major and minor device class bits are -# considered. Defaults to '0x000000'. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -Class = 0x000704 # Wearable, Wrist Watch -#else -#Class = 0x000100 -#endif - -# How long to stay in discoverable mode before going back to non-discoverable -# The value is in seconds. Default is 180, i.e. 3 minutes. -# 0 = disable timer, i.e. stay discoverable forever -#DiscoverableTimeout = 0 - -# How long to stay in pairable mode before going back to non-discoverable -# The value is in seconds. Default is 0. -# 0 = disable timer, i.e. stay pairable forever -#PairableTimeout = 0 - -# Automatic connection for bonded devices driven by platform/user events. -# If a platform plugin uses this mechanism, automatic connections will be -# enabled during the interval defined below. Initially, this feature -# intends to be used to establish connections to ATT channels. Default is 60. -#AutoConnectTimeout = 60 - -# Use vendor id source (assigner), vendor, product and version information for -# DID profile support. The values are separated by ":" and assigner, VID, PID -# and version. -# Possible vendor id source values: bluetooth, usb (defaults to usb) -#DeviceID = bluetooth:1234:5678:abcd - -# Do reverse service discovery for previously unknown devices that connect to -# us. This option is really only needed for qualification since the BITE tester -# doesn't like us doing reverse SDP for some test cases (though there could in -# theory be other useful purposes for this too). Defaults to 'true'. -#ReverseServiceDiscovery = true - -# Enable name resolving after inquiry. Set it to 'false' if you don't need -# remote devices name and want shorter discovery cycle. Defaults to 'true'. -#NameResolving = true - -# Enable runtime persistency of debug link keys. Default is false which -# makes debug link keys valid only for the duration of the connection -# that they were created for. -#DebugKeys = false - -# Restricts all controllers to the specified transport. Default value -# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW). -# Possible values: "dual", "bredr", "le" -#ControllerMode = dual - -# Permanently enables the Fast Connectable setting for adapters that -# support it. When enabled other devices can connect faster to us, -# however the tradeoff is increased power consumptions. This feature -# will fully work only on kernel version 4.1 and newer. Defaults to -# 'false'. -#FastConnectable = false - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -# Enable the LE Privacy feature. If value is true, i.e. LE Privacy is enabled -# otherwise the feature is disabled by default for the local device. -EnableLEPrivacy = false - -# Enable the Auto Pairing feature. If value is true, Auto Paring is enabled -# otherwise the feature is disabled by defaut for the local device. -AutoPairing = false - -# Set the Pin Code for device paring. If AutoPairing is enabled, local device -# will use the specified pin code for device paring. Default value is "0000". -PinCode = 0000 -#endif - -[Policy] -# -# The ReconnectUUIDs defines the set of remote services that should try -# to be reconnected to in case of a link loss (link supervision -# timeout). The policy plugin should contain a sane set of values by -# default, but this list can be overridden here. By setting the list to -# empty the reconnection feature gets disabled. -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -ReconnectUUIDs= -#else -#ReconnectUUIDs= -#endif - diff --git a/src/oob.c b/src/oob.c deleted file mode 100644 index 708467b..0000000 --- a/src/oob.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 ST-Ericsson SA - * - * Author: Szymon Janc for ST-Ericsson - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "adapter.h" -#include "oob.h" - -static oob_read_cb_t local_oob_read_cb = NULL; - -void oob_register_cb(oob_read_cb_t cb) -{ - local_oob_read_cb = cb; -} - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void oob_read_local_data_complete(struct btd_adapter *adapter, uint8_t *hash, - uint8_t *randomizer, void *user_data) -#else -void oob_read_local_data_complete(struct btd_adapter *adapter, uint8_t *hash, - uint8_t *randomizer) -#endif -{ - if (local_oob_read_cb) - local_oob_read_cb(adapter, hash, randomizer); -} diff --git a/src/oob.h b/src/oob.h deleted file mode 100644 index d720315..0000000 --- a/src/oob.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2011 ST-Ericsson SA - * - * Author: Szymon Janc for ST-Ericsson - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -typedef void (*oob_read_cb_t) (struct btd_adapter *adapter, uint8_t *hash, - uint8_t *randomizer); - -void oob_register_cb(oob_read_cb_t cb); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void oob_read_local_data_complete(struct btd_adapter *adapter, uint8_t *hash, - uint8_t *randomizer, void *user_data); -#else -void oob_read_local_data_complete(struct btd_adapter *adapter, uint8_t *hash, - uint8_t *randomizer); -#endif diff --git a/src/org.bluez.service b/src/org.bluez.service old mode 100644 new mode 100755 diff --git a/src/oui.c b/src/oui.c old mode 100644 new mode 100755 diff --git a/src/oui.h b/src/oui.h old mode 100644 new mode 100755 diff --git a/src/plugin.c b/src/plugin.c old mode 100644 new mode 100755 diff --git a/src/plugin.h b/src/plugin.h old mode 100644 new mode 100755 diff --git a/src/profile.c b/src/profile.c old mode 100644 new mode 100755 index c5bd97f..7c5318c --- a/src/profile.c +++ b/src/profile.c @@ -69,11 +69,6 @@ #define BTD_PROFILE_PSM_AUTO -1 #define BTD_PROFILE_CHAN_AUTO -1 -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -#define HID_DEVICE_INTR_PSM 17 -#define HID_DEVICE_CTRL_PSM 19 -#endif - #define HFP_HF_RECORD \ " \ \ @@ -197,54 +192,6 @@ \ " -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define SPP_RECORD \ - " \ - \ - \ - \ - %s \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - %s \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - " - -#define LANG_SEQ \ - " \ - \ - \ - \ - \ - \ - " -#else #define SPP_RECORD \ " \ \ @@ -282,7 +229,6 @@ \ \ " -#endif #define DUN_RECORD \ " \ @@ -322,58 +268,6 @@ \ " -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define OPP_RECORD \ - " \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - " -#else #define OPP_RECORD \ " \ \ @@ -427,7 +321,6 @@ \ \ " -#endif #define FTP_RECORD \ " \ @@ -498,57 +391,6 @@ \ " -#ifdef TIZEN_FEATURE_BLUEZ_PBAP_SIM -#define PBAP_ACCESS "0x03" /* Phone and SIM access support*/ -#else -#define PBAP_ACCESS "0x01" /* Phone access support only*/ -#endif - - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define PSE_RECORD \ - " \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - " -#else #define PSE_RECORD \ " \ \ @@ -597,13 +439,6 @@ \ \ " -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define SUPPORTED_MESSAGE_TYPES "0x03" /* EMAIL and SMS_GSM */ -#else -#define SUPPORTED_MESSAGE_TYPES "0x0F" /* EMAIL, SMS_GSM, SMS_CDMA and MMS */ -#endif #define MAS_RECORD \ " \ @@ -647,7 +482,7 @@ \ \ \ - \ + \ \ \ \ @@ -776,109 +611,6 @@ \ " -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -#define HID_DEVICE_RECORD \ - " \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - " -#endif - - struct ext_io; struct ext_profile { @@ -920,10 +652,6 @@ struct ext_profile { GSList *conns; GSList *connects; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *destination; - char *app_path; -#endif }; struct ext_io { @@ -967,11 +695,6 @@ static GSList *custom_props = NULL; static GSList *profiles = NULL; static GSList *ext_profiles = NULL; -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -static int connect_io(struct ext_io *conn, const bdaddr_t *src, - const bdaddr_t *dst); -#endif - void btd_profile_foreach(void (*func)(struct btd_profile *p, void *data), void *data) { @@ -1324,10 +1047,11 @@ static void ext_connect(GIOChannel *io, GError *err, gpointer user_data) conn); } - if (conn->service && service_accept(conn->service) == 0) { - if (send_new_connection(ext, conn)) - return; - } + if (conn->service && service_set_connecting(conn->service) < 0) + goto drop; + + if (send_new_connection(ext, conn)) + return; drop: if (conn->service) @@ -1450,23 +1174,6 @@ static void ext_confirm(GIOChannel *io, gpointer user_data) DBG("incoming connect from %s", addr); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -{ - struct btd_device *device; - gboolean restricted = FALSE; - - device = btd_adapter_find_device(adapter_find(&src), &dst, - BDADDR_BREDR); - if (device) { - restricted = device_is_profile_restricted(device, HFP_HS_UUID); - if (restricted) { - DBG("HFP_HS is restricted"); - return; - } - } -} -#endif - conn = create_conn(server, io, &src, &dst); if (conn == NULL) return; @@ -1661,21 +1368,6 @@ static struct ext_profile *find_ext(struct btd_profile *p) return l->data; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -gboolean ext_profile_is_registered_as_client_role(struct btd_profile *p) -{ - struct ext_profile *ext = find_ext(p); - if (ext && ext->role) { - if(strcasecmp(ext->role, "client") == 0) { - return TRUE; - } else { - return FALSE; - } - } - return FALSE; -} -#endif - static int ext_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter) { @@ -1877,38 +1569,6 @@ static void record_cb(sdp_list_t *recs, int err, gpointer user_data) sdp_record_t *rec = r->data; sdp_list_t *protos; int port; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *profile_uuid; - sdp_list_t *svcclass = NULL; - - if (sdp_get_service_classes(rec, &svcclass) < 0) - continue; - - /* Check for empty service classes list */ - if (svcclass == NULL) { - DBG("Skipping record with no service classes"); - continue; - } - - /* Extract the first element and skip the remainning */ - profile_uuid = bt_uuid2string(svcclass->data); - if (!profile_uuid) { - sdp_list_free(svcclass, free); - continue; - } - - sdp_list_free(svcclass, free); - - DBG("profile uuid %s port uuid %s", profile_uuid, ext->remote_uuid); - - if (g_ascii_strncasecmp(profile_uuid, ext->remote_uuid, - strlen(profile_uuid)) != 0) { - free(profile_uuid); - continue; - } - - free(profile_uuid); -#endif if (sdp_get_access_protos(rec, &protos) < 0) { error("Unable to get proto list from %s record", @@ -2111,28 +1771,14 @@ static char *get_spp_record(struct ext_profile *ext, struct ext_io *l2cap, struct ext_io *rfcomm) { char *svc, *rec; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *lan_seq; - uint16_t code_ISO639 = (0x65 << 8) | 0x6e; - uint16_t encoding = 106; - uint16_t base_offset = SDP_PRIMARY_LANG_BASE; -#endif if (ext->service) svc = g_strdup_printf("", ext->service); else svc = g_strdup(""); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - lan_seq = g_strdup_printf(LANG_SEQ, code_ISO639, encoding, - base_offset); - rec = g_strdup_printf(SPP_RECORD, svc, rfcomm->chan, lan_seq, ext->version, - ext->name); - g_free(lan_seq); -#else rec = g_strdup_printf(SPP_RECORD, svc, rfcomm->chan, ext->version, ext->name); -#endif g_free(svc); return rec; } @@ -2153,14 +1799,6 @@ static char *get_pce_record(struct ext_profile *ext, struct ext_io *l2cap, static char *get_pse_record(struct ext_profile *ext, struct ext_io *l2cap, struct ext_io *rfcomm) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint8_t chan = 0; - - if (rfcomm) - chan = rfcomm->chan; - - return g_strdup_printf(PSE_RECORD, chan, ext->version, ext->name); -#else uint16_t psm = 0; uint8_t chan = 0; @@ -2170,7 +1808,6 @@ static char *get_pse_record(struct ext_profile *ext, struct ext_io *l2cap, chan = rfcomm->chan; return g_strdup_printf(PSE_RECORD, chan, ext->version, ext->name, psm); -#endif } static char *get_mas_record(struct ext_profile *ext, struct ext_io *l2cap, @@ -2208,34 +1845,18 @@ static char *get_sync_record(struct ext_profile *ext, struct ext_io *l2cap, ext->name); } -#ifdef TIZEN_BT_HID_DEVICE_ENABLE -static char *get_hid_device_record(struct ext_profile *ext, struct ext_io *l2cap, - struct ext_io *rfcomm) -{ - return g_strdup(HID_DEVICE_RECORD); -} -#endif - static char *get_opp_record(struct ext_profile *ext, struct ext_io *l2cap, struct ext_io *rfcomm) { -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY uint16_t psm = 0; -#endif uint8_t chan = 0; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (l2cap) psm = l2cap->psm; -#endif if (rfcomm) chan = rfcomm->chan; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - return g_strdup_printf(OPP_RECORD, chan, ext->version, ext->name); -#else return g_strdup_printf(OPP_RECORD, chan, ext->version, psm, ext->name); -#endif } static char *get_ftp_record(struct ext_profile *ext, struct ext_io *l2cap, @@ -2380,11 +2001,7 @@ static struct default_settings { .sec_level = BT_IO_SEC_LOW, .authorize = false, .get_record = get_opp_record, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - .version = 0x0100, -#else - .version = 0x0102, -#endif + .version = 0x0102, }, { .uuid = OBEX_FTP_UUID, .name = "File Transfer", @@ -2435,18 +2052,7 @@ static struct default_settings { .authorize = true, .get_record = get_mns_record, .version = 0x0102 -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - }, { - .uuid = HID_DEVICE_UUID, - .name = "HID Device", - .psm = HID_DEVICE_INTR_PSM, - .authorize = TRUE, - .get_record = get_hid_device_record, - .version = 0x0100, }, -#else - }, -#endif }; static void ext_set_defaults(struct ext_profile *ext) @@ -2545,32 +2151,10 @@ static int parse_ext_opt(struct ext_profile *ext, const char *key, return -EINVAL; dbus_message_iter_get_basic(value, &b); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - if (b) - ext->sec_level = BT_IO_SEC_MEDIUM; - else - ext->sec_level = BT_IO_SEC_LOW; -#else -#ifdef TIZEN_BT_IO_CAPA_NO_INPUT_OUTPUT - /* - * NoInputOut device should have another authentication method. - * So turn off force authentication setting for that device. - */ if (b) ext->sec_level = BT_IO_SEC_MEDIUM; else ext->sec_level = BT_IO_SEC_LOW; -#else - if (!strcasecmp(ext->uuid, WEARABLE_OLD_SAP_UUID) || - !strcasecmp(ext->uuid, WEARABLE_NEW_SAP_UUID)) { - DBG("Set SAP UUID's sec_level to HIGH"); - ext->sec_level = BT_IO_SEC_HIGH; - } else if (b) - ext->sec_level = BT_IO_SEC_MEDIUM; - else - ext->sec_level = BT_IO_SEC_LOW; -#endif -#endif } else if (strcasecmp(key, "RequireAuthorization") == 0) { if (type != DBUS_TYPE_BOOLEAN) return -EINVAL; @@ -2651,89 +2235,6 @@ static void set_service(struct ext_profile *ext) } } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static struct ext_profile *create_ext2(const char *owner, const char *path, - const char *uuid, const char *destination, const char *app_path, - DBusMessageIter *opts) -{ - struct btd_profile *p; - struct ext_profile *ext; - - ext = g_new0(struct ext_profile, 1); - - ext->uuid = bt_name2string(uuid); - if (ext->uuid == NULL) { - g_free(ext); - return NULL; - } - - ext->owner = g_strdup(destination); - ext->path = g_strdup(app_path); - ext->destination = g_strdup(destination); - ext->app_path = g_strdup(app_path); - DBG("VALUES Dest %s, path2 %s", destination, app_path); - ext_set_defaults(ext); - - while (dbus_message_iter_get_arg_type(opts) == DBUS_TYPE_DICT_ENTRY) { - DBusMessageIter value, entry; - const char *key; - - dbus_message_iter_recurse(opts, &entry); - dbus_message_iter_get_basic(&entry, &key); - - dbus_message_iter_next(&entry); - dbus_message_iter_recurse(&entry, &value); - - if (parse_ext_opt(ext, key, &value) < 0) - error("Invalid value for profile option %s", key); - - dbus_message_iter_next(opts); - } - - if (!ext->service) - set_service(ext); - - if (ext->enable_server && !(ext->record || ext->get_record)) - ext->get_record = get_generic_record; - - if (!ext->name) - ext->name = g_strdup_printf("%s%s/%s", owner, path, uuid); - - if (!ext->remote_uuid) { - if (ext->service) - ext->remote_uuid = g_strdup(ext->service); - else - ext->remote_uuid = g_strdup(ext->uuid); - } - - p = &ext->p; - - p->name = ext->name; - p->local_uuid = ext->service ? ext->service : ext->uuid; - p->remote_uuid = ext->remote_uuid; - - if (ext->enable_server) { - p->adapter_probe = ext_adapter_probe; - p->adapter_remove = ext_adapter_remove; - } - - if (ext->enable_client) { - p->device_probe = ext_device_probe; - p->device_remove = ext_device_remove; - p->connect = ext_connect_dev; - p->disconnect = ext_disconnect_dev; - } - - DBG("Created \"%s\"", ext->name); - - ext_profiles = g_slist_append(ext_profiles, ext); - - adapter_foreach(adapter_add_profile, &ext->p); - - return ext; -} -#endif - static struct ext_profile *create_ext(const char *owner, const char *path, const char *uuid, DBusMessageIter *opts) @@ -2806,10 +2307,7 @@ static struct ext_profile *create_ext(const char *owner, const char *path, } DBG("Created \"%s\"", ext->name); -#ifdef TIZEN_BT_HID_DEVICE_ENABLE - if (g_strcmp0(ext->uuid , HID_DEVICE_UUID) == 0) - ext->local_psm = 0; -#endif + ext_profiles = g_slist_append(ext_profiles, ext); adapter_foreach(adapter_add_profile, &ext->p); @@ -2913,72 +2411,11 @@ static DBusMessage *unregister_profile(DBusConnection *conn, return dbus_message_new_method_return(msg); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static DBusMessage *register_profile2(DBusConnection *conn, - DBusMessage *msg, void *user_data) -{ - const char *path, *sender, *uuid; - DBusMessageIter args, opts; - struct ext_profile *ext; - const char *destination, *app_path; - sender = dbus_message_get_sender(msg); - - DBG("sender %s", sender); - - dbus_message_iter_init(msg, &args); - - dbus_message_iter_get_basic(&args, &path); - dbus_message_iter_next(&args); - DBG("path %s", path); - - DBG("path %s", path); - dbus_message_iter_get_basic(&args, &uuid); - dbus_message_iter_next(&args); - DBG("uuid %s", uuid); - dbus_message_iter_get_basic(&args, &destination); - dbus_message_iter_next(&args); - DBG("destination %s", destination); - dbus_message_iter_get_basic(&args, &app_path); - dbus_message_iter_next(&args); - DBG("path2 %s", app_path); - ext = find_ext_profile(destination, path); - if (ext) - return btd_error_already_exists(msg); - if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_ARRAY) - return btd_error_invalid_args(msg); - DBG("interator"); - dbus_message_iter_recurse(&args, &opts); - - ext = create_ext2(sender, path, uuid, destination, app_path, &opts); - if (!ext) - return btd_error_invalid_args(msg); -#if 0 - ext->id = g_dbus_add_disconnect_watch(conn, sender, ext_exited, ext, - NULL); -#endif - - return dbus_message_new_method_return(msg); -} -#endif - static const GDBusMethodTable methods[] = { { GDBUS_METHOD("RegisterProfile", GDBUS_ARGS({ "profile", "o"}, { "UUID", "s" }, { "options", "a{sv}" }), NULL, register_profile) }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - /* For Dbus Smack devides dbus API, the functionality is same */ - { GDBUS_METHOD("RegisterProfile1", - GDBUS_ARGS({ "profile", "o"}, { "UUID", "s" }, - { "options", "a{sv}" }), - NULL, register_profile) }, - { GDBUS_METHOD("RegisterProfile2", - GDBUS_ARGS({"profile", "o"}, { "UUID", "s" }, - {"destination", "s"}, {"path", "s"}, - { "options", "a{sv}"}), - NULL, register_profile2) }, -#endif - { GDBUS_METHOD("UnregisterProfile", GDBUS_ARGS({ "profile", "o" }), NULL, unregister_profile) }, { } @@ -3072,22 +2509,11 @@ void btd_profile_cleanup(void) g_slist_free_full(ext->conns, ext_io_destroy); ext->conns = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (ext->destination == NULL) { - msg = dbus_message_new_method_call(ext->owner, - ext->path, - "org.bluez.Profile1", - "Release"); - if (msg) - g_dbus_send_message(conn, msg); - } -#else msg = dbus_message_new_method_call(ext->owner, ext->path, "org.bluez.Profile1", "Release"); if (msg) g_dbus_send_message(conn, msg); -#endif g_dbus_remove_watch(conn, ext->id); remove_ext(ext); diff --git a/src/profile.h b/src/profile.h old mode 100644 new mode 100755 index d6e20f3..4448a2a --- a/src/profile.h +++ b/src/profile.h @@ -73,9 +73,5 @@ bool btd_profile_add_custom_prop(const char *uuid, const char *type, void *user_data); bool btd_profile_remove_custom_prop(const char *uuid, const char *name); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -gboolean ext_profile_is_registered_as_client_role(struct btd_profile *p); -#endif - void btd_profile_init(void); void btd_profile_cleanup(void); diff --git a/src/rfkill.c b/src/rfkill.c old mode 100644 new mode 100755 diff --git a/src/sdp-client.c b/src/sdp-client.c old mode 100644 new mode 100755 diff --git a/src/sdp-client.h b/src/sdp-client.h old mode 100644 new mode 100755 diff --git a/src/sdp-xml.c b/src/sdp-xml.c old mode 100644 new mode 100755 index ec863b6..0a3eb60 --- a/src/sdp-xml.c +++ b/src/sdp-xml.c @@ -531,11 +531,6 @@ static void element_end(GMarkupParseContext *context, struct context_data *ctx_data = user_data; struct sdp_xml_data *elem; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (element_name == NULL) - return; -#endif - if (!strcmp(element_name, "record")) return; diff --git a/src/sdp-xml.h b/src/sdp-xml.h old mode 100644 new mode 100755 diff --git a/src/sdpd-database.c b/src/sdpd-database.c old mode 100644 new mode 100755 diff --git a/src/sdpd-request.c b/src/sdpd-request.c old mode 100644 new mode 100755 diff --git a/src/sdpd-server.c b/src/sdpd-server.c old mode 100644 new mode 100755 index c863508..54de393 --- a/src/sdpd-server.c +++ b/src/sdpd-server.c @@ -164,7 +164,7 @@ static gboolean io_session_event(GIOChannel *chan, GIOCondition cond, gpointer d } len = recv(sk, &hdr, sizeof(sdp_pdu_hdr_t), MSG_PEEK); - if (len != sizeof(sdp_pdu_hdr_t)) { + if (len < 0 || (unsigned int) len < sizeof(sdp_pdu_hdr_t)) { sdp_svcdb_collect_all(sk); return FALSE; } diff --git a/src/sdpd-service.c b/src/sdpd-service.c old mode 100644 new mode 100755 diff --git a/src/sdpd.h b/src/sdpd.h old mode 100644 new mode 100755 diff --git a/src/service.c b/src/service.c old mode 100644 new mode 100755 index 29e831a..207ffae --- a/src/service.c +++ b/src/service.c @@ -171,10 +171,6 @@ int service_probe(struct btd_service *service) void service_remove(struct btd_service *service) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (service->profile == NULL) - return; -#endif change_state(service, BTD_SERVICE_STATE_DISCONNECTED, -ECONNABORTED); change_state(service, BTD_SERVICE_STATE_UNAVAILABLE, 0); service->profile->device_remove(service); @@ -201,7 +197,7 @@ int service_accept(struct btd_service *service) } if (!service->profile->accept) - goto done; + return -ENOSYS; err = service->profile->accept(service); if (!err) @@ -213,7 +209,27 @@ int service_accept(struct btd_service *service) return err; done: + if (service->state == BTD_SERVICE_STATE_DISCONNECTED) + change_state(service, BTD_SERVICE_STATE_CONNECTING, 0); + return 0; +} + +int service_set_connecting(struct btd_service *service) +{ + switch (service->state) { + case BTD_SERVICE_STATE_UNAVAILABLE: + return -EINVAL; + case BTD_SERVICE_STATE_DISCONNECTED: + break; + case BTD_SERVICE_STATE_CONNECTING: + case BTD_SERVICE_STATE_CONNECTED: + return 0; + case BTD_SERVICE_STATE_DISCONNECTING: + return -EBUSY; + } + change_state(service, BTD_SERVICE_STATE_CONNECTING, 0); + return 0; } @@ -222,11 +238,8 @@ int btd_service_connect(struct btd_service *service) struct btd_profile *profile = service->profile; char addr[18]; int err; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (profile != NULL && !profile->connect) -#else + if (!profile->connect) -#endif return -ENOTSUP; switch (service->state) { @@ -360,14 +373,9 @@ bool btd_service_remove_state_cb(unsigned int id) void btd_service_connecting_complete(struct btd_service *service, int err) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY if (service->state != BTD_SERVICE_STATE_DISCONNECTED && service->state != BTD_SERVICE_STATE_CONNECTING) return; -#else - if (service->state != BTD_SERVICE_STATE_CONNECTING) - return; -#endif if (err == 0) change_state(service, BTD_SERVICE_STATE_CONNECTED, 0); diff --git a/src/service.h b/src/service.h old mode 100644 new mode 100755 index c1f97f6..6f1edfb --- a/src/service.h +++ b/src/service.h @@ -49,6 +49,7 @@ int service_probe(struct btd_service *service); void service_remove(struct btd_service *service); int service_accept(struct btd_service *service); +int service_set_connecting(struct btd_service *service); /* Connection control API */ int btd_service_connect(struct btd_service *service); diff --git a/src/shared/ad.c b/src/shared/ad.c old mode 100644 new mode 100755 diff --git a/src/shared/ad.h b/src/shared/ad.h old mode 100644 new mode 100755 diff --git a/src/shared/att-types.h b/src/shared/att-types.h old mode 100644 new mode 100755 index c3062c0..51922d1 --- a/src/shared/att-types.h +++ b/src/shared/att-types.h @@ -31,11 +31,16 @@ #define BT_ATT_SECURITY_LOW 1 #define BT_ATT_SECURITY_MEDIUM 2 #define BT_ATT_SECURITY_HIGH 3 +#define BT_ATT_SECURITY_FIPS 4 #define BT_ATT_DEFAULT_LE_MTU 23 #define BT_ATT_MAX_LE_MTU 517 #define BT_ATT_MAX_VALUE_LEN 512 +#define BT_ATT_LINK_BREDR 0x00 +#define BT_ATT_LINK_LE 0x01 +#define BT_ATT_LINK_LOCAL 0xff + /* ATT protocol opcodes */ #define BT_ATT_OP_ERROR_RSP 0x01 #define BT_ATT_OP_MTU_REQ 0x02 @@ -123,6 +128,10 @@ struct bt_att_pdu_error_rsp { BT_ATT_PERM_WRITE_AUTHEN) #define BT_ATT_PERM_AUTHOR 0x40 #define BT_ATT_PERM_NONE 0x80 +#define BT_ATT_PERM_READ_SECURE 0x0100 +#define BT_ATT_PERM_WRITE_SECURE 0x0200 +#define BT_ATT_PERM_SECURE (BT_ATT_PERM_READ_SECURE | \ + BT_ATT_PERM_WRITE_SECURE) /* GATT Characteristic Properties Bitfield values */ #define BT_GATT_CHRC_PROP_BROADCAST 0x01 diff --git a/src/shared/att.c b/src/shared/att.c old mode 100644 new mode 100755 index b7c557a..3071b51 --- a/src/shared/att.c +++ b/src/shared/att.c @@ -34,6 +34,7 @@ #include "src/shared/util.h" #include "src/shared/timeout.h" #include "lib/bluetooth.h" +#include "lib/l2cap.h" #include "lib/uuid.h" #include "src/shared/att.h" #include "src/shared/crypto.h" @@ -67,12 +68,6 @@ struct bt_att { bool in_req; /* There's a pending incoming request */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bdaddr_t bdaddr; - uint8_t bdaddr_type; - bool service_change_indication; /* Service changed indication status */ -#endif - uint8_t *buf; uint16_t mtu; @@ -190,7 +185,7 @@ struct att_send_op { unsigned int id; unsigned int timeout_id; enum att_op_type type; - uint16_t opcode; + uint8_t opcode; void *pdu; uint16_t len; bt_att_response_func_t callback; @@ -214,10 +209,6 @@ static void destroy_att_send_op(void *data) static void cancel_att_send_op(struct att_send_op *op) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (op->callback) - op->callback(BT_ATT_OP_ERROR_RSP, NULL, 0, op->user_data); -#endif if (op->destroy) op->destroy(op->user_data); @@ -343,14 +334,8 @@ static struct att_send_op *create_att_send_op(struct bt_att *att, * response from the remote end, then no callback should have been * provided, since it will never be called. */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (callback && type != ATT_OP_TYPE_REQ && type != ATT_OP_TYPE_IND - && type != ATT_OP_TYPE_CMD) - return NULL; -#else if (callback && type != ATT_OP_TYPE_REQ && type != ATT_OP_TYPE_IND) return NULL; -#endif /* Similarly, if the operation does elicit a response then a callback * must be provided. @@ -494,21 +479,12 @@ static bool can_write_data(struct io *io, void *user_data) case ATT_OP_TYPE_IND: att->pending_ind = op; break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case ATT_OP_TYPE_CMD: - if (op->callback) - op->callback(0, NULL, 0, op->user_data); - destroy_att_send_op(op); - return true; -#endif case ATT_OP_TYPE_RSP: /* Set in_req to false to indicate that no request is pending */ att->in_req = false; /* Fall through to the next case */ -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY case ATT_OP_TYPE_CMD: -#endif case ATT_OP_TYPE_NOT: case ATT_OP_TYPE_CONF: case ATT_OP_TYPE_UNKNOWN: @@ -560,6 +536,16 @@ static void disconn_handler(void *data, void *user_data) disconn->callback(err, disconn->user_data); } +static void disc_att_send_op(void *data) +{ + struct att_send_op *op = data; + + if (op->callback) + op->callback(BT_ATT_OP_ERROR_RSP, NULL, 0, op->user_data); + + destroy_att_send_op(op); +} + static bool disconnect_cb(struct io *io, void *user_data) { struct bt_att *att = user_data; @@ -582,7 +568,20 @@ static bool disconnect_cb(struct io *io, void *user_data) io_destroy(att->io); att->io = NULL; - bt_att_cancel_all(att); + /* Notify request callbacks */ + queue_remove_all(att->req_queue, NULL, NULL, disc_att_send_op); + queue_remove_all(att->ind_queue, NULL, NULL, disc_att_send_op); + queue_remove_all(att->write_queue, NULL, NULL, disc_att_send_op); + + if (att->pending_req) { + disc_att_send_op(att->pending_req); + att->pending_req = NULL; + } + + if (att->pending_ind) { + disc_att_send_op(att->pending_ind); + att->pending_ind = NULL; + } bt_att_ref(att); @@ -604,18 +603,20 @@ static bool change_security(struct bt_att *att, uint8_t ecode) security = bt_att_get_security(att); if (ecode == BT_ATT_ERROR_INSUFFICIENT_ENCRYPTION && - security < BT_ATT_SECURITY_MEDIUM) - security = BT_ATT_SECURITY_MEDIUM; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - else if (ecode == BT_ATT_ERROR_AUTHENTICATION && - security < BT_ATT_SECURITY_MEDIUM) + security < BT_ATT_SECURITY_MEDIUM) { security = BT_ATT_SECURITY_MEDIUM; -#endif - else if (ecode == BT_ATT_ERROR_AUTHENTICATION && - security < BT_ATT_SECURITY_HIGH) - security = BT_ATT_SECURITY_HIGH; - else + } else if (ecode == BT_ATT_ERROR_AUTHENTICATION) { + if (security < BT_ATT_SECURITY_MEDIUM) + security = BT_ATT_SECURITY_MEDIUM; + else if (security < BT_ATT_SECURITY_HIGH) + security = BT_ATT_SECURITY_HIGH; + else if (security < BT_ATT_SECURITY_FIPS) + security = BT_ATT_SECURITY_FIPS; + else + return false; + } else { return false; + } return bt_att_set_security(att, security); } @@ -644,13 +645,6 @@ static bool handle_error_rsp(struct bt_att *att, uint8_t *pdu, att->pending_req = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (op->timeout_id) { - timeout_remove(op->timeout_id); - op->timeout_id = 0; - } -#endif - /* Push operation back to request queue */ return queue_push_head(att->req_queue, op); } @@ -981,6 +975,18 @@ static void bt_att_free(struct bt_att *att) free(att); } +static uint16_t get_l2cap_mtu(int fd) +{ + socklen_t len; + struct l2cap_options l2o; + + len = sizeof(l2o); + if (getsockopt(fd, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &len) < 0) + return 0; + + return l2o.omtu; +} + struct bt_att *bt_att_new(int fd, bool ext_signed) { struct bt_att *att; @@ -990,10 +996,6 @@ struct bt_att *bt_att_new(int fd, bool ext_signed) att = new0(struct bt_att, 1); att->fd = fd; - att->mtu = BT_ATT_DEFAULT_LE_MTU; - att->buf = malloc(att->mtu); - if (!att->buf) - goto fail; att->io = io_new(fd); if (!att->io) @@ -1019,6 +1021,18 @@ struct bt_att *bt_att_new(int fd, bool ext_signed) if (!att->io_on_l2cap) att->io_sec_level = BT_ATT_SECURITY_LOW; + if (bt_att_get_link_type(att) == BT_ATT_LINK_BREDR) + att->mtu = get_l2cap_mtu(att->fd); + else + att->mtu = BT_ATT_DEFAULT_LE_MTU; + + if (att->mtu < BT_ATT_DEFAULT_LE_MTU) + goto fail; + + att->buf = malloc(att->mtu); + if (!att->buf) + goto fail; + return bt_att_ref(att); fail: @@ -1113,6 +1127,28 @@ bool bt_att_set_mtu(struct bt_att *att, uint16_t mtu) return true; } +uint8_t bt_att_get_link_type(struct bt_att *att) +{ + struct sockaddr_l2 src; + socklen_t len; + + if (!att) + return -EINVAL; + + if (!att->io_on_l2cap) + return BT_ATT_LINK_LOCAL; + + len = sizeof(src); + memset(&src, 0, len); + if (getsockname(att->fd, (void *)&src, &len) < 0) + return -errno; + + if (src.l2_bdaddr_type == BDADDR_BREDR) + return BT_ATT_LINK_BREDR; + + return BT_ATT_LINK_LE; +} + bool bt_att_set_timeout_cb(struct bt_att *att, bt_att_timeout_func_t callback, void *user_data, bt_att_destroy_func_t destroy) @@ -1479,50 +1515,3 @@ bool bt_att_has_crypto(struct bt_att *att) return att->crypto ? true : false; } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -bool bt_att_set_remote_addr(struct bt_att *att, - const bdaddr_t *bdaddr, uint8_t bdaddr_type) -{ - if (!att) - return false; - - bacpy(&att->bdaddr, bdaddr); - att->bdaddr_type = bdaddr_type; - - return true; -} - -bool bt_att_get_remote_addr(struct bt_att *att, - bdaddr_t *bdaddr, uint8_t *bdaddr_type) -{ - if (!att) - return false; - - if (!bacmp(&att->bdaddr, BDADDR_ANY)) - return false; - - bacpy(bdaddr, &att->bdaddr); - *bdaddr_type = att->bdaddr_type; - - return true; -} - -bool bt_att_set_svc_changed_indication_registered(struct bt_att *att, bool value) -{ - if (!att) - return false; - - att->service_change_indication = value; - - return true; -} - -bool bt_att_get_svc_changed_indication_registered(struct bt_att *att) -{ - if (!att) - return false; - - return att->service_change_indication; -} -#endif diff --git a/src/shared/att.h b/src/shared/att.h old mode 100644 new mode 100755 index 6c1159e..7bffee7 --- a/src/shared/att.h +++ b/src/shared/att.h @@ -25,9 +25,6 @@ #include #include "src/shared/att-types.h" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include "lib/bluetooth.h" -#endif struct bt_att; @@ -56,6 +53,7 @@ bool bt_att_set_debug(struct bt_att *att, bt_att_debug_func_t callback, uint16_t bt_att_get_mtu(struct bt_att *att); bool bt_att_set_mtu(struct bt_att *att, uint16_t mtu); +uint8_t bt_att_get_link_type(struct bt_att *att); bool bt_att_set_timeout_cb(struct bt_att *att, bt_att_timeout_func_t callback, void *user_data, @@ -94,11 +92,3 @@ bool bt_att_set_local_key(struct bt_att *att, uint8_t sign_key[16], bool bt_att_set_remote_key(struct bt_att *att, uint8_t sign_key[16], bt_att_counter_func_t func, void *user_data); bool bt_att_has_crypto(struct bt_att *att); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -bool bt_att_set_remote_addr(struct bt_att *att, - const bdaddr_t *bdaddr, uint8_t bdaddr_type); -bool bt_att_get_remote_addr(struct bt_att *att, - bdaddr_t *bdaddr, uint8_t *bdaddr_type); -bool bt_att_set_svc_changed_indication_registered(struct bt_att *att, bool value); -bool bt_att_get_svc_changed_indication_registered(struct bt_att *att); -#endif \ No newline at end of file diff --git a/src/shared/btsnoop.c b/src/shared/btsnoop.c old mode 100644 new mode 100755 index 41a8d9d..e20d1b3 --- a/src/shared/btsnoop.c +++ b/src/shared/btsnoop.c @@ -25,9 +25,6 @@ #include #endif -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include -#endif #include #include #include @@ -76,11 +73,6 @@ struct btsnoop { bool aborted; bool pklg_format; bool pklg_v2; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *path; - int16_t rotate_count; - ssize_t file_size; -#endif }; struct btsnoop *btsnoop_open(const char *path, unsigned long flags) @@ -139,12 +131,7 @@ failed: return NULL; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct btsnoop *btsnoop_create(const char *path, uint32_t format, - int16_t rotate_count, ssize_t file_size) -#else struct btsnoop *btsnoop_create(const char *path, uint32_t format) -#endif { struct btsnoop *btsnoop; struct btsnoop_hdr hdr; @@ -175,99 +162,9 @@ struct btsnoop *btsnoop_create(const char *path, uint32_t format) return NULL; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (rotate_count > 0 && file_size > 0) { - btsnoop->path = strdup(path); - btsnoop->rotate_count = rotate_count; - btsnoop->file_size = file_size; - } -#endif - return btsnoop_ref(btsnoop); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int btsnoop_create_2(struct btsnoop *btsnoop) -{ - struct btsnoop_hdr hdr; - ssize_t written; - - if (btsnoop->fd >= 0) - close(btsnoop->fd); - - btsnoop->fd = open(btsnoop->path, - O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, - S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (btsnoop->fd < 0) { - btsnoop_unref(btsnoop); - return -1; - } - - memcpy(hdr.id, btsnoop_id, sizeof(btsnoop_id)); - hdr.version = htobe32(btsnoop_version); - hdr.type = htobe32(btsnoop->format); - - written = write(btsnoop->fd, &hdr, BTSNOOP_HDR_SIZE); - if (written < 0) { - btsnoop_unref(btsnoop); - return -1; - } - - return btsnoop->fd; -} - -static void btsnoop_rotate_files(struct btsnoop *btsnoop) -{ - char *filename = NULL; - char *new_filename = NULL; - int i; - int postfix_width = 0; - int err; - - if (btsnoop->rotate_count <= 1) - return; - - for (i = btsnoop->rotate_count / 10; i; i /= 10) - postfix_width++; - - for (i = btsnoop->rotate_count - 2; i >= 0; i--) { - if (i == 0) { - filename = strdup(btsnoop->path); - err = (filename == NULL) ? -1 : 0; - } else { - err = asprintf(&filename, "%s.%0*d", - btsnoop->path, postfix_width, i); - } - - if (err < 0 || access(filename, F_OK) < 0) - goto done; - - err = asprintf(&new_filename, "%s.%0*d", - btsnoop->path, postfix_width, i + 1); - if (err < 0) - goto done; - - err = rename(filename, new_filename); - -done: - if (new_filename) { - free(new_filename); - new_filename = NULL; - } - - if (filename) { - free(filename); - filename = NULL; - } - - if (err < 0) - break; - } - - return; -} -#endif - struct btsnoop *btsnoop_ref(struct btsnoop *btsnoop) { if (!btsnoop) @@ -286,11 +183,6 @@ void btsnoop_unref(struct btsnoop *btsnoop) if (__sync_sub_and_fetch(&btsnoop->ref_count, 1)) return; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (btsnoop->path) - free(btsnoop->path); -#endif - if (btsnoop->fd >= 0) close(btsnoop->fd); @@ -306,7 +198,8 @@ uint32_t btsnoop_get_format(struct btsnoop *btsnoop) } bool btsnoop_write(struct btsnoop *btsnoop, struct timeval *tv, - uint32_t flags, const void *data, uint16_t size) + uint32_t flags, uint32_t drops, const void *data, + uint16_t size) { struct btsnoop_pkt pkt; uint64_t ts; @@ -320,19 +213,9 @@ bool btsnoop_write(struct btsnoop *btsnoop, struct timeval *tv, pkt.size = htobe32(size); pkt.len = htobe32(size); pkt.flags = htobe32(flags); - pkt.drops = htobe32(0); + pkt.drops = htobe32(drops); pkt.ts = htobe64(ts + 0x00E03AB44A676000ll); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if ((btsnoop->rotate_count > 0 && btsnoop->file_size > 0) && - lseek(btsnoop->fd, 0x00, SEEK_CUR) + - BTSNOOP_PKT_SIZE + size > btsnoop->file_size) { - btsnoop_rotate_files(btsnoop); - if (btsnoop_create_2(btsnoop) < 0) - return false; - } -#endif - written = write(btsnoop->fd, &pkt, BTSNOOP_PKT_SIZE); if (written < 0) return false; @@ -372,8 +255,8 @@ static uint32_t get_flags_from_opcode(uint16_t opcode) } bool btsnoop_write_hci(struct btsnoop *btsnoop, struct timeval *tv, - uint16_t index, uint16_t opcode, - const void *data, uint16_t size) + uint16_t index, uint16_t opcode, uint32_t drops, + const void *data, uint16_t size) { uint32_t flags; @@ -401,7 +284,7 @@ bool btsnoop_write_hci(struct btsnoop *btsnoop, struct timeval *tv, return false; } - return btsnoop_write(btsnoop, tv, flags, data, size); + return btsnoop_write(btsnoop, tv, flags, drops, data, size); } bool btsnoop_write_phy(struct btsnoop *btsnoop, struct timeval *tv, @@ -421,7 +304,7 @@ bool btsnoop_write_phy(struct btsnoop *btsnoop, struct timeval *tv, return false; } - return btsnoop_write(btsnoop, tv, flags, data, size); + return btsnoop_write(btsnoop, tv, flags, 0, data, size); } static bool pklg_read_hci(struct btsnoop *btsnoop, struct timeval *tv, diff --git a/src/shared/btsnoop.h b/src/shared/btsnoop.h old mode 100644 new mode 100755 index f52a297..3df8998 --- a/src/shared/btsnoop.h +++ b/src/shared/btsnoop.h @@ -49,6 +49,10 @@ #define BTSNOOP_OPCODE_VENDOR_DIAG 11 #define BTSNOOP_OPCODE_SYSTEM_NOTE 12 #define BTSNOOP_OPCODE_USER_LOGGING 13 +#define BTSNOOP_OPCODE_CTRL_OPEN 14 +#define BTSNOOP_OPCODE_CTRL_CLOSE 15 +#define BTSNOOP_OPCODE_CTRL_COMMAND 16 +#define BTSNOOP_OPCODE_CTRL_EVENT 17 #define BTSNOOP_MAX_PACKET_SIZE (1486 + 4) @@ -62,6 +66,9 @@ #define BTSNOOP_BUS_RS232 4 #define BTSNOOP_BUS_PCI 5 #define BTSNOOP_BUS_SDIO 6 +#define BTSNOOP_BUS_SPI 7 +#define BTSNOOP_BUS_I2C 8 +#define BTSNOOP_BUS_SMD 9 struct btsnoop_opcode_new_index { uint8_t type; @@ -92,23 +99,18 @@ struct btsnoop_opcode_user_logging { struct btsnoop; struct btsnoop *btsnoop_open(const char *path, unsigned long flags); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct btsnoop *btsnoop_create(const char *path, uint32_t format, - int16_t rotate_count, ssize_t file_size); -#else struct btsnoop *btsnoop_create(const char *path, uint32_t format); -#endif struct btsnoop *btsnoop_ref(struct btsnoop *btsnoop); void btsnoop_unref(struct btsnoop *btsnoop); uint32_t btsnoop_get_format(struct btsnoop *btsnoop); -bool btsnoop_write(struct btsnoop *btsnoop, struct timeval *tv, - uint32_t flags, const void *data, uint16_t size); +bool btsnoop_write(struct btsnoop *btsnoop, struct timeval *tv, uint32_t flags, + uint32_t drops, const void *data, uint16_t size); bool btsnoop_write_hci(struct btsnoop *btsnoop, struct timeval *tv, - uint16_t index, uint16_t opcode, - const void *data, uint16_t size); + uint16_t index, uint16_t opcode, uint32_t drops, + const void *data, uint16_t size); bool btsnoop_write_phy(struct btsnoop *btsnoop, struct timeval *tv, uint16_t frequency, const void *data, uint16_t size); diff --git a/src/shared/crypto.c b/src/shared/crypto.c old mode 100644 new mode 100755 index d4d58fe..6de5514 --- a/src/shared/crypto.c +++ b/src/shared/crypto.c @@ -213,11 +213,7 @@ static int alg_new(int fd, const void *keyval, socklen_t keylen) return -1; /* FIXME: This should use accept4() with SOCK_CLOEXEC */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - return accept(fd, NULL, NULL); -#else return accept(fd, NULL, 0); -#endif } static bool alg_encrypt(int fd, const void *inbuf, size_t inlen, @@ -391,7 +387,7 @@ bool bt_crypto_e(struct bt_crypto *crypto, const uint8_t key[16], * r' = padding || r * * The least significant octet of r becomes the least significant octet - * of r??and the most significant octet of padding becomes the most + * of r’ and the most significant octet of padding becomes the most * significant octet of r'. * * For example, if the 24-bit value r is 0x423456 then r' is @@ -572,8 +568,8 @@ bool bt_crypto_s1(struct bt_crypto *crypto, const uint8_t k[16], return bt_crypto_e(crypto, k, res, res); } -static bool aes_cmac(struct bt_crypto *crypto, uint8_t key[16], uint8_t *msg, - size_t msg_len, uint8_t res[16]) +static bool aes_cmac(struct bt_crypto *crypto, const uint8_t key[16], + const uint8_t *msg, size_t msg_len, uint8_t res[16]) { uint8_t key_msb[16], out[16], msg_msb[CMAC_MSG_MAX]; ssize_t len; @@ -683,3 +679,12 @@ bool bt_crypto_g2(struct bt_crypto *crypto, uint8_t u[32], uint8_t v[32], return true; } + +bool bt_crypto_h6(struct bt_crypto *crypto, const uint8_t w[16], + const uint8_t keyid[4], uint8_t res[16]) +{ + if (!aes_cmac(crypto, w, keyid, 4, res)) + return false; + + return true; +} diff --git a/src/shared/crypto.h b/src/shared/crypto.h old mode 100644 new mode 100755 index 9ba5803..84d4992 --- a/src/shared/crypto.h +++ b/src/shared/crypto.h @@ -56,6 +56,8 @@ bool bt_crypto_f6(struct bt_crypto *crypto, uint8_t w[16], uint8_t n1[16], uint8_t a1[7], uint8_t a2[7], uint8_t res[16]); bool bt_crypto_g2(struct bt_crypto *crypto, uint8_t u[32], uint8_t v[32], uint8_t x[16], uint8_t y[16], uint32_t *val); +bool bt_crypto_h6(struct bt_crypto *crypto, const uint8_t w[16], + const uint8_t keyid[4], uint8_t res[16]); bool bt_crypto_sign_att(struct bt_crypto *crypto, const uint8_t key[16], const uint8_t *m, uint16_t m_len, uint32_t sign_cnt, uint8_t signature[12]); diff --git a/src/shared/ecc.c b/src/shared/ecc.c old mode 100644 new mode 100755 diff --git a/src/shared/ecc.h b/src/shared/ecc.h old mode 100644 new mode 100755 diff --git a/src/shared/gap.c b/src/shared/gap.c old mode 100644 new mode 100755 diff --git a/src/shared/gap.h b/src/shared/gap.h old mode 100644 new mode 100755 diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c old mode 100644 new mode 100755 index 9f4e075..4386692 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -33,9 +33,6 @@ #include "src/shared/queue.h" #include "src/shared/gatt-db.h" #include "src/shared/gatt-client.h" -#if defined TIZEN_FEATURE_BLUEZ_MODIFY -#include "../log.h" -#endif #include #include @@ -58,6 +55,9 @@ struct bt_gatt_client { struct bt_att *att; int ref_count; + struct bt_gatt_client *parent; + struct queue *clones; + bt_gatt_client_callback_t ready_callback; bt_gatt_client_destroy_func_t ready_destroy; void *ready_data; @@ -112,12 +112,6 @@ struct bt_gatt_client { struct bt_gatt_request *discovery_req; unsigned int mtu_req_id; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *device_name; - struct queue *pending_noti; - bool svc_changed_failed; -#endif }; struct request { @@ -132,26 +126,6 @@ struct request { void (*destroy)(void *); }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct noti { - uint8_t opcode; - void *pdu; - uint16_t length; -}; - -static void notify_cb(uint8_t opcode, const void *pdu, uint16_t length, - void *user_data); - -static void notification_free(void *data) -{ - struct noti *noti = data; - - if (noti->pdu) - free(noti->pdu); - free(noti); -} -#endif - static struct request *request_ref(struct request *req) { __sync_fetch_and_add(&req->ref_count, 1); @@ -269,9 +243,9 @@ static struct notify_chrc *notify_chrc_create(struct bt_gatt_client *client, if (bt_uuid_cmp(&uuid, gatt_db_attribute_get_type(attr))) return NULL; - if (!gatt_db_attribute_get_char_data(attr, NULL, NULL, - &properties, NULL)) - return NULL; + if (!gatt_db_attribute_get_char_data(attr, NULL, NULL, &properties, + NULL, NULL)) + return NULL; chrc = new0(struct notify_chrc, 1); @@ -342,6 +316,7 @@ struct discovery_op { struct queue *pending_svcs; struct queue *pending_chrcs; struct queue *svcs; + struct queue *ext_prop_desc; struct gatt_db_attribute *cur_svc; bool success; uint16_t start; @@ -357,6 +332,7 @@ static void discovery_op_free(struct discovery_op *op) queue_destroy(op->pending_svcs, NULL); queue_destroy(op->pending_chrcs, free); queue_destroy(op->svcs, NULL); + queue_destroy(op->ext_prop_desc, NULL); free(op); } @@ -365,31 +341,11 @@ static void discovery_op_complete(struct discovery_op *op, bool success, { /* Reset remaining range */ if (success) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - util_debug(op->client->debug_callback, op->client->debug_data, - "op->start : %u, op->end : %u, op->last : %u", - op->start, op->end, op->last); - - if (op->last != UINT16_MAX) { - if (op->start != op->last) - op->last++; - - if (op->last <= op->end) - gatt_db_clear_range(op->client->db, - op->last, op->end); - } -#else if (op->last != UINT16_MAX) gatt_db_clear_range(op->client->db, op->last + 1, UINT16_MAX); -#endif - } else { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - util_debug(op->client->debug_callback, op->client->debug_data, - "Fail to discover service. Clear DB [%d]", err); -#endif + } else gatt_db_clear(op->client->db); - } op->success = success; op->complete_func(op, success, err); @@ -406,14 +362,12 @@ static struct discovery_op *discovery_op_create(struct bt_gatt_client *client, op->pending_svcs = queue_new(); op->pending_chrcs = queue_new(); op->svcs = queue_new(); + op->ext_prop_desc = queue_new(); op->client = client; op->complete_func = complete_func; op->failure_func = failure_func; op->start = start; op->end = end; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - op->last = start; -#endif return op; } @@ -653,6 +607,109 @@ failed: return false; } +static void ext_prop_write_cb(struct gatt_db_attribute *attrib, + int err, void *user_data) +{ + struct bt_gatt_client *client = user_data; + + util_debug(client->debug_callback, client->debug_data, + "Value set status: %d", err); +} + +static void ext_prop_read_cb(bool success, uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data); + +static bool read_ext_prop_desc(struct discovery_op *op) +{ + struct bt_gatt_client *client = op->client; + uint16_t handle; + struct gatt_db_attribute *attr; + + attr = queue_peek_head(op->ext_prop_desc); + if (!attr) + return false; + + handle = gatt_db_attribute_get_handle(attr); + + if (!bt_gatt_client_read_value(client, handle, ext_prop_read_cb, + discovery_op_ref(op), + discovery_op_unref)) + return false; + + return true; +} + +static void ext_prop_read_cb(bool success, uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + struct discovery_op *op = user_data; + struct bt_gatt_client *client = op->client; + bool discovering; + struct gatt_db_attribute *desc_attr = NULL; + struct gatt_db_attribute *next_srv; + uint16_t start, end; + + util_debug(client->debug_callback, client->debug_data, + "Ext. prop value: 0x%04x", (uint16_t)value[0]); + + desc_attr = queue_pop_head(op->ext_prop_desc); + if (!desc_attr) + goto failed; + + if (!gatt_db_attribute_write(desc_attr, 0, value, length, 0, NULL, + ext_prop_write_cb, client)) + goto failed; + + /* Any other descriptor to read? */ + if (read_ext_prop_desc(op)) + return; + + /* Continue with discovery */ + do { + if (!discover_descs(op, &discovering)) + goto failed; + + if (discovering) + return; + + /* Done with the current service */ + gatt_db_service_set_active(op->cur_svc, true); + + next_srv = queue_pop_head(op->svcs); + if (!next_srv) + goto done; + + if (!gatt_db_attribute_get_service_handles(next_srv, &start, + &end)) + goto failed; + + } while (start == end); + + /* Move on to the next service */ + op->cur_svc = next_srv; + + client->discovery_req = bt_gatt_discover_characteristics(client->att, + start, end, + discover_chrcs_cb, + discovery_op_ref(op), + discovery_op_unref); + if (client->discovery_req) + return; + + util_debug(client->debug_callback, client->debug_data, + "Failed to start characteristic discovery"); + + discovery_op_unref(op); + +failed: + success = false; + +done: + discovery_op_complete(op, success, att_ecode); +} + static void discover_descs_cb(bool success, uint8_t att_ecode, struct bt_gatt_result *result, void *user_data) @@ -667,6 +724,7 @@ static void discover_descs_cb(bool success, uint8_t att_ecode, char uuid_str[MAX_LEN_UUID_STR]; unsigned int desc_count; bool discovering; + bt_uuid_t ext_prop_uuid; discovery_req_clear(client); @@ -689,6 +747,8 @@ static void discover_descs_cb(bool success, uint8_t att_ecode, util_debug(client->debug_callback, client->debug_data, "Descriptors found: %u", desc_count); + bt_uuid16_create(&ext_prop_uuid, GATT_CHARAC_EXT_PROPER_UUID); + while (bt_gatt_iter_next_descriptor(&iter, &handle, u128.data)) { bt_uuid128_create(&uuid, u128); @@ -706,8 +766,15 @@ static void discover_descs_cb(bool success, uint8_t att_ecode, if (gatt_db_attribute_get_handle(attr) != handle) goto failed; + + if (!bt_uuid_cmp(&ext_prop_uuid, &uuid)) + queue_push_tail(op->ext_prop_desc, attr); } + /* If we got extended prop descriptor, lets read it right away */ + if (read_ext_prop_desc(op)) + return; + next: if (!discover_descs(op, &discovering)) goto failed; @@ -750,56 +817,6 @@ done: discovery_op_complete(op, success, att_ecode); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void read_name_cb(bool success, uint8_t att_ecode, const uint8_t *value, - uint16_t length, void *user_data) -{ - struct bt_gatt_client *client = user_data; - char *name; - - if (!success) { - util_debug(client->debug_callback, client->debug_data, - "read_name_cb failed"); - return; - } - - if (length == 0) - return; - - name = malloc(length + 1); - if (!name) - return; - - memcpy(name, value, length); - name[length] = '\0'; - - util_debug(client->debug_callback, client->debug_data, - "read_name_cb : %s", name); - - if (client->device_name) - free(client->device_name); - - client->device_name = name; -} - -bool bt_gatt_request_att_mtu(struct bt_gatt_client *client, uint16_t mtu, - void *callback, void *user_data) -{ - if (!client || !client->ready) - return false; - - /* Configure the MTU */ - if(!bt_gatt_exchange_mtu(client->att, - MAX(BT_ATT_DEFAULT_LE_MTU, mtu), - callback, - user_data, - NULL)) { - return false; - } - return true; -} -#endif - static void discover_chrcs_cb(bool success, uint8_t att_ecode, struct bt_gatt_result *result, void *user_data) @@ -857,16 +874,6 @@ static void discover_chrcs_cb(bool success, uint8_t att_ecode, chrc_data->properties = properties; chrc_data->uuid = uuid; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (!strcmp(uuid_str, "00002a00-0000-1000-8000-00805f9b34fb")) { - if (!bt_gatt_client_read_value(client, chrc_data->value_handle, - read_name_cb, client, NULL)) { - util_debug(client->debug_callback, client->debug_data, - "Failed to read value"); - } - } -#endif - queue_push_tail(op->pending_chrcs, chrc_data); } @@ -963,13 +970,6 @@ static void discover_secondary_cb(bool success, uint8_t att_ecode, start, end, uuid_str); /* Store the service */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->in_svc_chngd) { - util_debug(client->debug_callback, client->debug_data, - "In service changed, delete service first."); - gatt_db_clear_range(client->db, start, end); - } -#endif attr = gatt_db_insert_service(client->db, start, &uuid, false, end - start + 1); if (!attr) { @@ -1052,11 +1052,7 @@ static void discover_primary_cb(bool success, uint8_t att_ecode, "Primary service discovery failed." " ATT ECODE: 0x%02x", att_ecode); /* Reset error in case of not found */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (att_ecode == BT_ATT_ERROR_ATTRIBUTE_NOT_FOUND) { -#else if (BT_ATT_ERROR_ATTRIBUTE_NOT_FOUND) { -#endif success = true; att_ecode = 0; } @@ -1081,13 +1077,6 @@ static void discover_primary_cb(bool success, uint8_t att_ecode, "start: 0x%04x, end: 0x%04x, uuid: %s", start, end, uuid_str); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->in_svc_chngd) { - util_debug(client->debug_callback, client->debug_data, - "In service changed, delete service first."); - gatt_db_clear_range(client->db, start, end); - } -#endif attr = gatt_db_insert_service(client->db, start, &uuid, true, end - start + 1); if (!attr) { @@ -1143,12 +1132,23 @@ done: static void notify_client_ready(struct bt_gatt_client *client, bool success, uint8_t att_ecode) { + const struct queue_entry *entry; + if (!client->ready_callback || client->ready) return; bt_gatt_client_ref(client); client->ready = success; client->ready_callback(success, att_ecode, client->ready_data); + + /* Notify clones */ + for (entry = queue_get_entries(client->clones); entry; + entry = entry->next) { + struct bt_gatt_client *clone = entry->data; + + notify_client_ready(clone, success, att_ecode); + } + bt_gatt_client_unref(client); } @@ -1181,13 +1181,10 @@ static void exchange_mtu_cb(bool success, uint8_t att_ecode, void *user_data) } util_debug(client->debug_callback, client->debug_data, - "att client MTU exchange complete, with MTU: %u", + "MTU exchange complete, with MTU: %u", bt_att_get_mtu(client->att)); discover: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - op->success = false; -#endif client->discovery_req = bt_gatt_discover_all_primary_services( client->att, NULL, discover_primary_cb, @@ -1211,33 +1208,6 @@ struct service_changed_op { uint16_t end_handle; }; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY -bool bt_gatt_discover_services(struct bt_gatt_client *client) -{ - struct discovery_op *op; - - if (!client->ready) - return false; - - op = new0(struct discovery_op, 1); - if (!op) - return false; - - op->client = client; - gatt_db_unref(op->client->db); - - if (bt_gatt_discover_all_primary_services(client->att, NULL, - discover_primary_cb, - discovery_op_ref(op), - discovery_op_unref)) - return true; - - discovery_op_unref(op); - - return false; -} -#endif - static void process_service_changed(struct bt_gatt_client *client, uint16_t start_handle, uint16_t end_handle); @@ -1454,23 +1424,6 @@ static void service_changed_register_cb(uint16_t att_ecode, void *user_data) done: notify_client_ready(client, success, att_ecode); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (success) { - struct noti *noti; - - while ((noti = queue_pop_head(client->pending_noti))) { - notify_cb(noti->opcode, noti->pdu, - noti->length, client); - notification_free(noti); - } - } else { - util_debug(client->debug_callback, client->debug_data, - "Remove all pending notifications"); - queue_remove_all(client->pending_noti, NULL, NULL, - notification_free); - } -#endif } static bool register_service_changed(struct bt_gatt_client *client) @@ -1509,6 +1462,7 @@ static void service_changed_complete(struct discovery_op *op, bool success, struct service_changed_op *next_sc_op; uint16_t start_handle = op->start; uint16_t end_handle = op->end; + const struct queue_entry *entry; client->in_svc_chngd = false; @@ -1517,9 +1471,6 @@ static void service_changed_complete(struct discovery_op *op, bool success, "Failed to discover services within changed range - " "error: 0x%02x", att_ecode); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - client->svc_changed_failed = true; -#endif gatt_db_clear_range(client->db, start_handle, end_handle); } @@ -1528,6 +1479,16 @@ static void service_changed_complete(struct discovery_op *op, bool success, client->svc_chngd_callback(start_handle, end_handle, client->svc_chngd_data); + /* Notify clones */ + for (entry = queue_get_entries(client->clones); entry; + entry = entry->next) { + struct bt_gatt_client *clone = entry->data; + + if (clone->svc_chngd_callback) + clone->svc_chngd_callback(start_handle, end_handle, + clone->svc_chngd_data); + } + /* Process any queued events */ next_sc_op = queue_pop_head(client->svc_chngd_queue); if (next_sc_op) { @@ -1548,11 +1509,6 @@ static void service_changed_failure(struct discovery_op *op) { struct bt_gatt_client *client = op->client; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - util_debug(client->debug_callback, client->debug_data, - "Failed to discover services"); -#endif - gatt_db_clear_range(client->db, op->start, op->end); } @@ -1593,14 +1549,8 @@ static void service_changed_cb(uint16_t value_handle, const uint8_t *value, struct service_changed_op *op; uint16_t start, end; - if (length != 4) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - util_debug(client->debug_callback, client->debug_data, - "Service changed is received with invalid length : %d", - length); -#endif + if (length != 4) return; - } start = get_le16(value); end = get_le16(value + 2); @@ -1653,34 +1603,12 @@ fail: done: notify_client_ready(client, success, att_ecode); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (success) { - struct noti *noti; - - while ((noti = queue_pop_head(client->pending_noti))) { - notify_cb(noti->opcode, noti->pdu, - noti->length, client); - notification_free(noti); - } - } else { - util_debug(client->debug_callback, client->debug_data, - "Remove all pending notifications"); - queue_remove_all(client->pending_noti, NULL, NULL, - notification_free); - } -#endif } static void init_fail(struct discovery_op *op) { struct bt_gatt_client *client = op->client; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - util_debug(client->debug_callback, client->debug_data, - "GATT client init is failed"); -#endif - gatt_db_clear(client->db); } @@ -1696,9 +1624,25 @@ static bool gatt_client_init(struct bt_gatt_client *client, uint16_t mtu) if (!op) return false; + /* + * BLUETOOTH SPECIFICATION Version 4.2 [Vol 3, Part G] page 546: + * + * 4.3.1 Exchange MTU + * + * This sub-procedure shall not be used on a BR/EDR physical link since + * the MTU size is negotiated using L2CAP channel configuration + * procedures. + */ + if (bt_att_get_link_type(client->att) == BT_ATT_LINK_BREDR) + goto discover; + + /* Check if MTU needs to be send */ + mtu = MAX(BT_ATT_DEFAULT_LE_MTU, mtu); + if (mtu == BT_ATT_DEFAULT_LE_MTU) + goto discover; + /* Configure the MTU */ - client->mtu_req_id = bt_gatt_exchange_mtu(client->att, - MAX(BT_ATT_DEFAULT_LE_MTU, mtu), + client->mtu_req_id = bt_gatt_exchange_mtu(client->att, mtu, exchange_mtu_cb, discovery_op_ref(op), discovery_op_unref); @@ -1710,6 +1654,20 @@ static bool gatt_client_init(struct bt_gatt_client *client, uint16_t mtu) client->in_init = true; return true; + +discover: + client->discovery_req = bt_gatt_discover_all_primary_services( + client->att, NULL, + discover_primary_cb, + discovery_op_ref(op), + discovery_op_unref); + if (!client->discovery_req) { + discovery_op_free(op); + return false; + } + + client->in_init = true; + return true; } struct pdu_data { @@ -1749,10 +1707,6 @@ static void complete_unregister_notify(void *data) if (notify_data->att_id) { bt_att_cancel(notify_data->client->att, notify_data->att_id); notify_data->att_id = 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - notify_data->chrc->ccc_write_id = 0; - __sync_sub_and_fetch(¬ify_data->chrc->notify_count, 1); -#endif goto done; } @@ -1796,35 +1750,6 @@ static void notify_cb(uint8_t opcode, const void *pdu, uint16_t length, struct bt_gatt_client *client = user_data; struct pdu_data pdu_data; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->ready == false) { - struct noti *noti; - - util_debug(client->debug_callback, client->debug_data, - "Client is not ready. pend notification."); - - noti = new0(struct noti, 1); - if (!noti) - return; - - noti->pdu = malloc(length); - if (!noti->pdu) { - free(noti); - return; - } - - noti->opcode = opcode; - noti->length = length; - memcpy(noti->pdu, pdu, length); - - util_debug(client->debug_callback, client->debug_data, - "Notification handle : %d", get_le16(pdu)); - - queue_push_tail(client->pending_noti, noti); - return; - } -#endif - bt_gatt_client_ref(client); memset(&pdu_data, 0, sizeof(pdu_data)); @@ -1833,7 +1758,7 @@ static void notify_cb(uint8_t opcode, const void *pdu, uint16_t length, queue_foreach(client->notify_list, notify_handler, &pdu_data); - if (opcode == BT_ATT_OP_HANDLE_VAL_IND) + if (opcode == BT_ATT_OP_HANDLE_VAL_IND && !client->parent) bt_att_send(client->att, BT_ATT_OP_HANDLE_VAL_CONF, NULL, 0, NULL, NULL, NULL); @@ -1859,29 +1784,18 @@ static void bt_gatt_client_free(struct bt_gatt_client *client) bt_att_unref(client->att); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->in_svc_chngd || client->svc_changed_failed) { - util_debug(client->debug_callback, client->debug_data, - "Service changed is going. Clear DB"); - gatt_db_clear(client->db); - } - - queue_destroy(client->pending_noti, notification_free); -#endif - gatt_db_unref(client->db); + queue_destroy(client->clones, NULL); queue_destroy(client->svc_chngd_queue, free); queue_destroy(client->long_write_queue, request_unref); queue_destroy(client->notify_chrcs, notify_chrc_free); queue_destroy(client->pending_requests, request_unref); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->device_name) { - free(client->device_name); - client->device_name = NULL; + if (client->parent) { + queue_remove(client->parent->clones, client); + bt_gatt_client_unref(client->parent); } -#endif free(client); } @@ -1903,29 +1817,23 @@ static void att_disconnect_cb(int err, void *user_data) notify_client_ready(client, false, 0); } -struct bt_gatt_client *bt_gatt_client_new(struct gatt_db *db, - struct bt_att *att, - uint16_t mtu) +static struct bt_gatt_client *gatt_client_new(struct gatt_db *db, + struct bt_att *att) { struct bt_gatt_client *client; - if (!att || !db) - return NULL; - client = new0(struct bt_gatt_client, 1); client->disc_id = bt_att_register_disconnect(att, att_disconnect_cb, client, NULL); if (!client->disc_id) goto fail; + client->clones = queue_new(); client->long_write_queue = queue_new(); client->svc_chngd_queue = queue_new(); client->notify_list = queue_new(); client->notify_chrcs = queue_new(); client->pending_requests = queue_new(); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - client->pending_noti = queue_new(); -#endif client->notify_id = bt_att_register(att, BT_ATT_OP_HANDLE_VAL_NOT, notify_cb, client, NULL); @@ -1940,14 +1848,56 @@ struct bt_gatt_client *bt_gatt_client_new(struct gatt_db *db, client->att = bt_att_ref(att); client->db = gatt_db_ref(db); - if (!gatt_client_init(client, mtu)) - goto fail; - - return bt_gatt_client_ref(client); + return client; fail: bt_gatt_client_free(client); return NULL; + +} + +struct bt_gatt_client *bt_gatt_client_new(struct gatt_db *db, + struct bt_att *att, + uint16_t mtu) +{ + struct bt_gatt_client *client; + + if (!att || !db) + return NULL; + + client = gatt_client_new(db, att); + if (!client) + return NULL; + + if (!gatt_client_init(client, mtu)) { + bt_gatt_client_free(client); + return NULL; + } + + return bt_gatt_client_ref(client); +} + +struct bt_gatt_client *bt_gatt_client_clone(struct bt_gatt_client *client) +{ + struct bt_gatt_client *clone; + + if (!client) + return NULL; + + clone = gatt_client_new(client->db, client->att); + if (!clone) + return NULL; + + queue_push_tail(client->clones, clone); + + /* + * Reference the parent since the clones depend on it to propagate + * service changed and ready callbacks. + */ + clone->parent = bt_gatt_client_ref(client); + clone->ready = client->ready; + + return bt_gatt_client_ref(clone); } struct bt_gatt_client *bt_gatt_client_ref(struct bt_gatt_client *client) @@ -2493,93 +2443,6 @@ unsigned int bt_gatt_client_read_long_value(struct bt_gatt_client *client, return req->id; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -struct write_cmd_op { - struct bt_gatt_client *client; - bt_gatt_client_callback_t callback; - void *user_data; - bt_gatt_destroy_func_t destroy; -}; - -static void destroy_write_cmd_op(void *data) -{ - struct write_cmd_op *op = data; - - if (op->destroy) - op->destroy(op->user_data); - - free(op); -} - -static void write_cmd_cb(uint8_t opcode, const void *pdu, uint16_t length, - void *user_data) -{ - struct request *req = user_data; - struct write_cmd_op *op = req->data; - bool success = true; - uint8_t att_ecode = 0; - - if (op->callback) - op->callback(success, att_ecode, op->user_data); -} - -unsigned int bt_gatt_client_write_without_response_async( - struct bt_gatt_client *client, - uint16_t value_handle, - bool signed_write, - const uint8_t *value, uint16_t length, - bt_gatt_client_callback_t callback, - void *user_data, - bt_gatt_client_destroy_func_t destroy) -{ - - uint8_t pdu[2 + length]; - struct request *req; - struct write_cmd_op *op; - int security; - uint8_t opcode; - - if (!client) - return 0; - - op = new0(struct write_cmd_op, 1); - if (!op) - return 0; - - req = request_create(client); - if (!req) - return 0; - - op->callback = callback; - op->user_data = user_data; - op->destroy = destroy; - - req->data = op; - req->destroy = destroy_write_cmd_op; - - /* Only use signed write if unencrypted */ - if (signed_write) { - security = bt_att_get_security(client->att); - opcode = security > BT_SECURITY_LOW ? BT_ATT_OP_WRITE_CMD : - BT_ATT_OP_SIGNED_WRITE_CMD; - } else - opcode = BT_ATT_OP_WRITE_CMD; - - put_le16(value_handle, pdu); - memcpy(pdu + 2, value, length); - - req->att_id = bt_att_send(client->att, opcode, - pdu, sizeof(pdu), write_cmd_cb, req, request_unref); - if (!req->att_id) { - op->destroy = NULL; - request_unref(req); - return 0; - } - - return req->id; -} -#endif - unsigned int bt_gatt_client_write_without_response( struct bt_gatt_client *client, uint16_t value_handle, @@ -3271,14 +3134,8 @@ unsigned int bt_gatt_client_register_notify(struct bt_gatt_client *client, if (!client || !client->db || !chrc_value_handle || !callback) return 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (client->in_svc_chngd) - util_debug(client->debug_callback, client->debug_data, - "register_notify in service changed handling"); -#else if (client->in_svc_chngd) return 0; -#endif return register_notify(client, chrc_value_handle, callback, notify, user_data, destroy); @@ -3319,21 +3176,3 @@ int bt_gatt_client_get_security(struct bt_gatt_client *client) return bt_att_get_security(client->att); } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -char *bt_gatt_client_get_gap_device_name(struct bt_gatt_client *client) -{ - if (!client) - return NULL; - - return client->device_name; -} - -bool bt_gatt_client_svc_changed_received(struct bt_gatt_client *client) -{ - if (!client) - return false; - - return client->in_svc_chngd; -} -#endif diff --git a/src/shared/gatt-client.h b/src/shared/gatt-client.h old mode 100644 new mode 100755 index 8aeb145..aceb570 --- a/src/shared/gatt-client.h +++ b/src/shared/gatt-client.h @@ -32,6 +32,7 @@ struct bt_gatt_client; struct bt_gatt_client *bt_gatt_client_new(struct gatt_db *db, struct bt_att *att, uint16_t mtu); +struct bt_gatt_client *bt_gatt_client_clone(struct bt_gatt_client *client); struct bt_gatt_client *bt_gatt_client_ref(struct bt_gatt_client *client); void bt_gatt_client_unref(struct bt_gatt_client *client); @@ -91,17 +92,6 @@ unsigned int bt_gatt_client_read_multiple(struct bt_gatt_client *client, void *user_data, bt_gatt_client_destroy_func_t destroy); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -unsigned int bt_gatt_client_write_without_response_async( - struct bt_gatt_client *client, - uint16_t value_handle, - bool signed_write, - const uint8_t *value, uint16_t length, - bt_gatt_client_callback_t callback, - void *user_data, - bt_gatt_client_destroy_func_t destroy); -#endif - unsigned int bt_gatt_client_write_without_response( struct bt_gatt_client *client, uint16_t value_handle, @@ -144,14 +134,3 @@ bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client, bool bt_gatt_client_set_security(struct bt_gatt_client *client, int level); int bt_gatt_client_get_security(struct bt_gatt_client *client); - -#if defined TIZEN_FEATURE_BLUEZ_MODIFY -bool bt_gatt_discover_services(struct bt_gatt_client *client); -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -char *bt_gatt_client_get_gap_device_name(struct bt_gatt_client *client); -bool bt_gatt_request_att_mtu(struct bt_gatt_client *client, uint16_t mtu, - void *callback, void *user_data); -bool bt_gatt_client_svc_changed_received(struct bt_gatt_client *client); -#endif diff --git a/src/shared/gatt-db.c b/src/shared/gatt-db.c old mode 100644 new mode 100755 index 0126281..513451f --- a/src/shared/gatt-db.c +++ b/src/shared/gatt-db.c @@ -52,6 +52,8 @@ static const bt_uuid_t characteristic_uuid = { .type = BT_UUID16, .value.u16 = GATT_CHARAC_UUID }; static const bt_uuid_t included_service_uuid = { .type = BT_UUID16, .value.u16 = GATT_INCLUDE_UUID }; +static const bt_uuid_t ext_desc_uuid = { .type = BT_UUID16, + .value.u16 = GATT_CHARAC_EXT_PROPER_UUID }; struct gatt_db { int ref_count; @@ -93,10 +95,6 @@ struct gatt_db_attribute { uint32_t permissions; uint16_t value_len; uint8_t *value; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bool notify_indicate; - bdaddr_t unicast_addr; -#endif gatt_db_read_t read_func; gatt_db_write_t write_func; @@ -721,9 +719,6 @@ service_insert_characteristic(struct gatt_db_service *service, service->attributes[i] = new_attribute(service, handle, uuid, NULL, 0); if (!service->attributes[i]) { free(service->attributes[i - 1]); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - service->attributes[i - 1] = NULL; -#endif return NULL; } @@ -1463,10 +1458,68 @@ bool gatt_db_attribute_get_service_data(const struct gatt_db_attribute *attrib, return le_to_uuid(decl->value, decl->value_len, uuid); } +static void read_ext_prop_value(struct gatt_db_attribute *attrib, + int err, const uint8_t *value, + size_t length, void *user_data) +{ + uint16_t *ext_prop = user_data; + + if (err || (length != sizeof(uint16_t))) + return; + + *ext_prop = (uint16_t) value[0]; +} + +static void read_ext_prop(struct gatt_db_attribute *attrib, + void *user_data) +{ + uint16_t *ext_prop = user_data; + + /* + * If ext_prop is set that means extended properties descriptor + * has been already found + */ + if (*ext_prop != 0) + return; + + if (bt_uuid_cmp(&ext_desc_uuid, &attrib->uuid)) + return; + + gatt_db_attribute_read(attrib, 0, BT_ATT_OP_READ_REQ, NULL, + read_ext_prop_value, ext_prop); +} + +static uint8_t get_char_extended_prop(const struct gatt_db_attribute *attrib) +{ + uint16_t ext_prop; + + if (!attrib) + return 0; + + if (bt_uuid_cmp(&characteristic_uuid, &attrib->uuid)) + return 0; + + /* Check properties first */ + if (!(attrib->value[0] & BT_GATT_CHRC_PROP_EXT_PROP)) + return 0; + + ext_prop = 0; + + /* + * Cast needed for foreach function. We do not change attrib during + * this call + */ + gatt_db_service_foreach_desc((struct gatt_db_attribute *) attrib, + read_ext_prop, &ext_prop); + + return ext_prop; +} + bool gatt_db_attribute_get_char_data(const struct gatt_db_attribute *attrib, uint16_t *handle, uint16_t *value_handle, uint8_t *properties, + uint16_t *ext_prop, bt_uuid_t *uuid) { if (!attrib) @@ -1491,6 +1544,9 @@ bool gatt_db_attribute_get_char_data(const struct gatt_db_attribute *attrib, if (properties) *properties = attrib->value[0]; + if (ext_prop) + *ext_prop = get_char_extended_prop(attrib); + if (value_handle) *value_handle = get_le16(attrib->value + 1); @@ -1728,34 +1784,3 @@ bool gatt_db_attribute_reset(struct gatt_db_attribute *attrib) return true; } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void set_ccc_notify_indicate(struct gatt_db_attribute *ccc, - bool enable) -{ - if (ccc) - ccc->notify_indicate = enable; -} - -bool get_ccc_notify_indicate(const struct gatt_db_attribute *ccc) -{ - if (ccc) - return ccc->notify_indicate; - - return false; -} - -void set_ccc_unicast_address(struct gatt_db_attribute *ccc, - const char *address) -{ - if (ccc) - str2ba(address, &ccc->unicast_addr); -} - -const bdaddr_t *get_ccc_unicast_address(const struct gatt_db_attribute *ccc) -{ - if (ccc) - return &ccc->unicast_addr; - return NULL; -} -#endif diff --git a/src/shared/gatt-db.h b/src/shared/gatt-db.h old mode 100644 new mode 100755 index f9044f1..134ec63 --- a/src/shared/gatt-db.h +++ b/src/shared/gatt-db.h @@ -199,6 +199,7 @@ bool gatt_db_attribute_get_char_data(const struct gatt_db_attribute *attrib, uint16_t *handle, uint16_t *value_handle, uint8_t *properties, + uint16_t *ext_prop, bt_uuid_t *uuid); bool gatt_db_attribute_get_incl_data(const struct gatt_db_attribute *attrib, @@ -234,15 +235,3 @@ bool gatt_db_attribute_write_result(struct gatt_db_attribute *attrib, unsigned int id, int err); bool gatt_db_attribute_reset(struct gatt_db_attribute *attrib); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -void set_ccc_notify_indicate(struct gatt_db_attribute *ccc, - bool enable); - -bool get_ccc_notify_indicate(const struct gatt_db_attribute *ccc); - -void set_ccc_unicast_address(struct gatt_db_attribute *ccc, - const char *address); - -const bdaddr_t *get_ccc_unicast_address(const struct gatt_db_attribute *ccc); -#endif diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c old mode 100644 new mode 100755 index a0a5b26..6b39bb1 --- a/src/shared/gatt-helpers.c +++ b/src/shared/gatt-helpers.c @@ -797,7 +797,7 @@ static void find_by_type_val_cb(uint8_t opcode, const void *pdu, goto done; } - success = false; + success = true; done: discovery_op_complete(op, success, att_ecode); diff --git a/src/shared/gatt-helpers.h b/src/shared/gatt-helpers.h old mode 100644 new mode 100755 diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c old mode 100644 new mode 100755 index 53c60f3..79e01c8 --- a/src/shared/gatt-server.c +++ b/src/shared/gatt-server.c @@ -72,6 +72,8 @@ struct prep_write_data { uint16_t handle; uint16_t offset; uint16_t length; + + bool reliable_supported; }; static void prep_write_data_destroy(void *user_data) @@ -110,12 +112,6 @@ struct bt_gatt_server { bt_gatt_server_debug_func_t debug_callback; bt_gatt_server_destroy_func_t debug_destroy; void *debug_data; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - bt_gatt_server_mtu_changed_callback_t mtu_chngd_callback; - bt_gatt_server_destroy_func_t mtu_chngd_destroy; - void *mtu_chngd_data; -#endif }; static void bt_gatt_server_free(struct bt_gatt_server *server) @@ -186,11 +182,7 @@ static bool encode_read_by_grp_type_rsp(struct gatt_db *db, struct queue *q, int iter = 0; uint16_t start_handle, end_handle; struct iovec value; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - uint8_t data_val_len = 0; -#else uint8_t data_val_len; -#endif *len = 0; @@ -406,6 +398,9 @@ static uint8_t check_permissions(struct bt_gatt_server *server, return 0; security = bt_att_get_security(server->att); + if (perm & BT_ATT_PERM_SECURE && security < BT_ATT_SECURITY_FIPS) + return BT_ATT_ERROR_AUTHENTICATION; + if (perm & BT_ATT_PERM_AUTHEN && security < BT_ATT_SECURITY_HIGH) return BT_ATT_ERROR_AUTHENTICATION; @@ -529,11 +524,7 @@ static bool encode_find_info_rsp(struct gatt_db *db, struct queue *q, uint16_t handle; struct gatt_db_attribute *attr; const bt_uuid_t *type; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - int uuid_len = 0, cur_uuid_len; -#else int uuid_len, cur_uuid_len; -#endif int iter = 0; *len = 0; @@ -798,26 +789,14 @@ static void write_cb(uint8_t opcode, const void *pdu, goto error; if (server->pending_write_op) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (opcode != BT_ATT_OP_WRITE_CMD) { -#endif ecode = BT_ATT_ERROR_UNLIKELY; goto error; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - } -#endif } op = new0(struct async_write_op, 1); op->server = server; op->opcode = opcode; - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (opcode != BT_ATT_OP_WRITE_CMD) - server->pending_write_op = op; -#else server->pending_write_op = op; -#endif if (gatt_db_attribute_write(attr, 0, pdu + 2, length - 2, opcode, server->att, @@ -830,13 +809,6 @@ static void write_cb(uint8_t opcode, const void *pdu, ecode = BT_ATT_ERROR_UNLIKELY; error: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - util_debug(server->debug_callback, server->debug_data, - "Handling \"Write %s\" is failed : %d", - (opcode == BT_ATT_OP_WRITE_REQ) ? "Req" : "Cmd", - ecode); -#endif - if (opcode == BT_ATT_OP_WRITE_CMD) return; @@ -940,12 +912,6 @@ static void handle_read_req(struct bt_gatt_server *server, uint8_t opcode, ecode = BT_ATT_ERROR_UNLIKELY; error: -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - util_debug(server->debug_callback, server->debug_data, - "Handling \"Read %sReq\" is failed : %d", - (opcode == BT_ATT_OP_READ_BLOB_REQ) ? "Blob" : "", - ecode); -#endif if (op) async_read_op_destroy(op); @@ -1127,11 +1093,97 @@ error: bt_att_send_error_rsp(server->att, opcode, 0, ecode); } +static bool append_prep_data(struct prep_write_data *prep_data, uint16_t handle, + uint16_t length, uint8_t *value) +{ + uint8_t *val; + uint16_t len; + + if (!length) + return true; + + len = prep_data->length + length; + + val = realloc(prep_data->value, len); + if (!val) + return false; + + memcpy(val + prep_data->length, value, length); + + prep_data->value = val; + prep_data->length = len; + + return true; +} + +static bool is_reliable_write_supported(const struct bt_gatt_server *server, + uint16_t handle) +{ + struct gatt_db_attribute *attr; + uint16_t ext_prop; + + attr = gatt_db_get_attribute(server->db, handle); + if (!attr) + return false; + + if (!gatt_db_attribute_get_char_data(attr, NULL, NULL, NULL, &ext_prop, + NULL)) + return false; + + return (ext_prop & BT_GATT_CHRC_EXT_PROP_RELIABLE_WRITE); +} + +static bool prep_data_new(struct bt_gatt_server *server, + uint16_t handle, uint16_t offset, + uint16_t length, uint8_t *value) +{ + struct prep_write_data *prep_data; + + prep_data = new0(struct prep_write_data, 1); + + if (!append_prep_data(prep_data, handle, length, value)) { + prep_write_data_destroy(prep_data); + return false; + } + + prep_data->server = server; + prep_data->handle = handle; + prep_data->offset = offset; + + /* + * Handle is the value handle. We need characteristic declaration + * handle which in BlueZ is handle_value -1 + */ + prep_data->reliable_supported = is_reliable_write_supported(server, + handle - 1); + + queue_push_tail(server->prep_queue, prep_data); + + return true; +} + +static bool store_prep_data(struct bt_gatt_server *server, + uint16_t handle, uint16_t offset, + uint16_t length, uint8_t *value) +{ + struct prep_write_data *prep_data = NULL; + + /* + * Now lets check if prep write is a continuation of long write + * If so do aggregation of data + */ + prep_data = queue_peek_tail(server->prep_queue); + if (prep_data && (prep_data->handle == handle) && + (offset == (prep_data->length + prep_data->offset))) + return append_prep_data(prep_data, handle, length, value); + + return prep_data_new(server, handle, offset, length, value); +} + static void prep_write_cb(uint8_t opcode, const void *pdu, uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; - struct prep_write_data *prep_data = NULL; uint16_t handle = 0; uint16_t offset; struct gatt_db_attribute *attr; @@ -1165,33 +1217,18 @@ static void prep_write_cb(uint8_t opcode, const void *pdu, if (ecode) goto error; - prep_data = new0(struct prep_write_data, 1); - prep_data->length = length - 4; - if (prep_data->length) { - prep_data->value = malloc(prep_data->length); - if (!prep_data->value) { - ecode = BT_ATT_ERROR_INSUFFICIENT_RESOURCES; - goto error; - } + if (!store_prep_data(server, handle, offset, length - 4, + &((uint8_t *) pdu)[4])) { + ecode = BT_ATT_ERROR_INSUFFICIENT_RESOURCES; + goto error; } - prep_data->server = server; - prep_data->handle = handle; - prep_data->offset = offset; - memcpy(prep_data->value, pdu + 4, prep_data->length); - - queue_push_tail(server->prep_queue, prep_data); - bt_att_send(server->att, BT_ATT_OP_PREP_WRITE_RSP, pdu, length, NULL, NULL, NULL); return; error: - if (prep_data) - prep_write_data_destroy(prep_data); - bt_att_send_error_rsp(server->att, opcode, handle, ecode); - } static void exec_next_prep_write(struct bt_gatt_server *server, @@ -1250,6 +1287,14 @@ error: ehandle, err); } +static bool find_no_reliable_characteristic(const void *data, + const void *match_data) +{ + const struct prep_write_data *prep_data = data; + + return !prep_data->reliable_supported; +} + static void exec_write_cb(uint8_t opcode, const void *pdu, uint16_t length, void *user_data) { @@ -1257,6 +1302,7 @@ static void exec_write_cb(uint8_t opcode, const void *pdu, uint8_t flags; uint8_t ecode; bool write; + uint16_t ehandle = 0; if (length != 1) { ecode = BT_ATT_ERROR_INVALID_PDU; @@ -1285,6 +1331,19 @@ static void exec_write_cb(uint8_t opcode, const void *pdu, return; } + /* If there is more than one prep request, we are in reliable session */ + if (queue_length(server->prep_queue) > 1) { + struct prep_write_data *prep_data; + + prep_data = queue_find(server->prep_queue, + find_no_reliable_characteristic, NULL); + if (prep_data) { + ecode = BT_ATT_ERROR_REQUEST_NOT_SUPPORTED; + ehandle = prep_data->handle; + goto error; + } + } + exec_next_prep_write(server, 0, 0); return; @@ -1292,7 +1351,7 @@ static void exec_write_cb(uint8_t opcode, const void *pdu, error: queue_remove_all(server->prep_queue, NULL, NULL, prep_write_data_destroy); - bt_att_send_error_rsp(server->att, opcode, 0, ecode); + bt_att_send_error_rsp(server->att, opcode, ehandle, ecode); } static void exchange_mtu_cb(uint8_t opcode, const void *pdu, @@ -1310,7 +1369,6 @@ static void exchange_mtu_cb(uint8_t opcode, const void *pdu, } client_rx_mtu = get_le16(pdu); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY final_mtu = MAX(MIN(client_rx_mtu, server->mtu), BT_ATT_DEFAULT_LE_MTU); /* Respond with the server MTU */ @@ -1321,24 +1379,9 @@ static void exchange_mtu_cb(uint8_t opcode, const void *pdu, /* Set MTU to be the minimum */ server->mtu = final_mtu; bt_att_set_mtu(server->att, final_mtu); -#else - final_mtu = MAX(MIN(client_rx_mtu, BT_ATT_MAX_LE_MTU), BT_ATT_DEFAULT_LE_MTU); - - /* Set MTU to be the minimum */ - server->mtu = final_mtu; - bt_att_set_mtu(server->att, final_mtu); - - /* Respond with the server MTU */ - put_le16(server->mtu, rsp_pdu); - bt_att_send(server->att, BT_ATT_OP_MTU_RSP, rsp_pdu, 2, NULL, NULL, - NULL); - - if (server->mtu_chngd_callback) - server->mtu_chngd_callback(final_mtu, server->mtu_chngd_data); -#endif util_debug(server->debug_callback, server->debug_data, - "att server MTU exchange complete, with MTU: %u", final_mtu); + "MTU exchange complete, with MTU: %u", final_mtu); } static bool gatt_server_register_att_handlers(struct bt_gatt_server *server) @@ -1590,23 +1633,3 @@ bool bt_gatt_server_send_indication(struct bt_gatt_server *server, return result; } - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -bool bt_gatt_server_set_mtu_changed(struct bt_gatt_server *server, - bt_gatt_server_mtu_changed_callback_t callback, - void *user_data, - bt_gatt_server_destroy_func_t destroy) -{ - if (!server) - return false; - - if (server->mtu_chngd_destroy) - server->mtu_chngd_destroy(server->mtu_chngd_data); - - server->mtu_chngd_callback = callback; - server->mtu_chngd_destroy = destroy; - server->mtu_chngd_data = user_data; - - return true; -} -#endif diff --git a/src/shared/gatt-server.h b/src/shared/gatt-server.h old mode 100644 new mode 100755 index c61eabe..0e480e1 --- a/src/shared/gatt-server.h +++ b/src/shared/gatt-server.h @@ -50,14 +50,3 @@ bool bt_gatt_server_send_indication(struct bt_gatt_server *server, bt_gatt_server_conf_func_t callback, void *user_data, bt_gatt_server_destroy_func_t destroy); - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef void (*bt_gatt_server_mtu_changed_callback_t)(uint16_t mtu, - void *user_data); - -bool bt_gatt_server_set_mtu_changed(struct bt_gatt_server *server, - bt_gatt_server_mtu_changed_callback_t callback, - void *user_data, - bt_gatt_server_destroy_func_t destroy); - -#endif diff --git a/src/shared/hci-crypto.c b/src/shared/hci-crypto.c old mode 100644 new mode 100755 diff --git a/src/shared/hci-crypto.h b/src/shared/hci-crypto.h old mode 100644 new mode 100755 diff --git a/src/shared/hci.c b/src/shared/hci.c old mode 100644 new mode 100755 diff --git a/src/shared/hci.h b/src/shared/hci.h old mode 100644 new mode 100755 diff --git a/src/shared/hfp.c b/src/shared/hfp.c old mode 100644 new mode 100755 diff --git a/src/shared/hfp.h b/src/shared/hfp.h old mode 100644 new mode 100755 diff --git a/src/shared/io-glib.c b/src/shared/io-glib.c old mode 100644 new mode 100755 diff --git a/src/shared/io-mainloop.c b/src/shared/io-mainloop.c old mode 100644 new mode 100755 diff --git a/src/shared/io.h b/src/shared/io.h old mode 100644 new mode 100755 diff --git a/src/shared/mainloop.c b/src/shared/mainloop.c old mode 100644 new mode 100755 diff --git a/src/shared/mainloop.h b/src/shared/mainloop.h old mode 100644 new mode 100755 diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c old mode 100644 new mode 100755 diff --git a/src/shared/mgmt.h b/src/shared/mgmt.h old mode 100644 new mode 100755 diff --git a/src/shared/pcap.c b/src/shared/pcap.c old mode 100644 new mode 100755 diff --git a/src/shared/pcap.h b/src/shared/pcap.h old mode 100644 new mode 100755 diff --git a/src/shared/queue.c b/src/shared/queue.c old mode 100644 new mode 100755 diff --git a/src/shared/queue.h b/src/shared/queue.h old mode 100644 new mode 100755 diff --git a/src/shared/ringbuf.c b/src/shared/ringbuf.c old mode 100644 new mode 100755 diff --git a/src/shared/ringbuf.h b/src/shared/ringbuf.h old mode 100644 new mode 100755 diff --git a/src/shared/tester.c b/src/shared/tester.c old mode 100644 new mode 100755 diff --git a/src/shared/tester.h b/src/shared/tester.h old mode 100644 new mode 100755 diff --git a/src/shared/timeout-glib.c b/src/shared/timeout-glib.c old mode 100644 new mode 100755 diff --git a/src/shared/timeout-mainloop.c b/src/shared/timeout-mainloop.c old mode 100644 new mode 100755 diff --git a/src/shared/timeout.h b/src/shared/timeout.h old mode 100644 new mode 100755 diff --git a/src/shared/tty.h b/src/shared/tty.h new file mode 100755 index 0000000..66ec09f --- /dev/null +++ b/src/shared/tty.h @@ -0,0 +1,80 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2016 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include + +static inline unsigned int tty_get_speed(int speed) +{ + switch (speed) { + case 9600: + return B9600; + case 19200: + return B19200; + case 38400: + return B38400; + case 57600: + return B57600; + case 115200: + return B115200; + case 230400: + return B230400; + case 460800: + return B460800; + case 500000: + return B500000; + case 576000: + return B576000; + case 921600: + return B921600; + case 1000000: + return B1000000; + case 1152000: + return B1152000; + case 1500000: + return B1500000; + case 2000000: + return B2000000; +#ifdef B2500000 + case 2500000: + return B2500000; +#endif +#ifdef B3000000 + case 3000000: + return B3000000; +#endif +#ifdef B3500000 + case 3500000: + return B3500000; +#endif +#ifdef B3710000 + case 3710000: + return B3710000; +#endif +#ifdef B4000000 + case 4000000: + return B4000000; +#endif + } + + return 0; +} diff --git a/src/shared/uhid.c b/src/shared/uhid.c old mode 100644 new mode 100755 diff --git a/src/shared/uhid.h b/src/shared/uhid.h old mode 100644 new mode 100755 diff --git a/src/shared/util.c b/src/shared/util.c old mode 100644 new mode 100755 diff --git a/src/shared/util.h b/src/shared/util.h old mode 100644 new mode 100755 index ff705d0..7d28ae9 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -108,6 +108,11 @@ unsigned char util_get_dt(const char *parent, const char *name); uint8_t util_get_uid(unsigned int *bitmap, uint8_t max); void util_clear_uid(unsigned int *bitmap, uint8_t id); +static inline int8_t get_s8(const void *ptr) +{ + return *((int8_t *) ptr); +} + static inline uint8_t get_u8(const void *ptr) { return *((uint8_t *) ptr); diff --git a/src/storage.c b/src/storage.c old mode 100644 new mode 100755 index c478e03..734a9e0 --- a/src/storage.c +++ b/src/storage.c @@ -144,53 +144,6 @@ int read_local_name(const bdaddr_t *bdaddr, char *name) return 0; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int write_device_characteristics(const bdaddr_t *sba, const bdaddr_t *dba, - uint8_t bdaddr_type, uint16_t handle, - const char *chars) -{ - char filename[PATH_MAX + 1], addr[18], key[25]; - - create_filename(filename, PATH_MAX, sba, "characteristics"); - - create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - - ba2str(dba, addr); - snprintf(key, sizeof(key), "%17s#%hhu#%04X", addr, bdaddr_type, handle); - - return textfile_put(filename, key, chars); -} - -char *read_device_characteristics(const bdaddr_t *sba, const bdaddr_t *dba, - uint8_t bdaddr_type, uint16_t handle) -{ - char filename[PATH_MAX + 1], addr[18], key[25]; - - create_filename(filename, PATH_MAX, sba, "characteristics"); - - ba2str(dba, addr); - snprintf(key, sizeof(key), "%17s#%hhu#%04X", addr, bdaddr_type, handle); - - return textfile_get(filename, key); -} - -int write_device_attribute(const bdaddr_t *sba, const bdaddr_t *dba, - uint8_t bdaddr_type, uint16_t handle, - const char *chars) -{ - char filename[PATH_MAX + 1], addr[18], key[25]; - - create_filename(filename, PATH_MAX, sba, "attributes"); - - create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - - ba2str(dba, addr); - snprintf(key, sizeof(key), "%17s#%hhu#%04X", addr, bdaddr_type, handle); - - return textfile_put(filename, key, chars); -} -#endif - sdp_record_t *record_from_string(const char *str) { sdp_record_t *rec; diff --git a/src/storage.h b/src/storage.h old mode 100644 new mode 100755 index 979075b..1c0ad57 --- a/src/storage.h +++ b/src/storage.h @@ -25,15 +25,5 @@ int read_discoverable_timeout(const char *src, int *timeout); int read_pairable_timeout(const char *src, int *timeout); int read_on_mode(const char *src, char *mode, int length); int read_local_name(const bdaddr_t *bdaddr, char *name); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int write_device_characteristics(const bdaddr_t *sba, const bdaddr_t *dba, - uint8_t bdaddr_type, uint16_t handle, - const char *chars); -char *read_device_characteristics(const bdaddr_t *sba, const bdaddr_t *dba, - uint8_t bdaddr_type, uint16_t handle); -int write_device_attribute(const bdaddr_t *sba, const bdaddr_t *dba, - uint8_t bdaddr_type, uint16_t handle, - const char *chars); -#endif sdp_record_t *record_from_string(const char *str); sdp_record_t *find_record_in_list(sdp_list_t *recs, const char *uuid); diff --git a/src/systemd.c b/src/systemd.c old mode 100644 new mode 100755 diff --git a/src/systemd.h b/src/systemd.h old mode 100644 new mode 100755 diff --git a/src/textfile.c b/src/textfile.c old mode 100644 new mode 100755 diff --git a/src/textfile.h b/src/textfile.h old mode 100644 new mode 100755 diff --git a/src/uinput.h b/src/uinput.h old mode 100644 new mode 100755 diff --git a/src/uuid-helper.c b/src/uuid-helper.c old mode 100644 new mode 100755 diff --git a/src/uuid-helper.h b/src/uuid-helper.h old mode 100644 new mode 100755 diff --git a/test-driver b/test-driver new file mode 100755 index 0000000..d306056 --- /dev/null +++ b/test-driver @@ -0,0 +1,139 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2013-07-13.22; # UTC + +# Copyright (C) 2011-2013 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, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/test/advertisement-example b/test/advertisement-example deleted file mode 100644 index 98aeafa..0000000 --- a/test/advertisement-example +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/python - -import dbus -import dbus.exceptions -import dbus.mainloop.glib -import dbus.service - -import array -import gobject - -from random import randint - -mainloop = None - -BLUEZ_SERVICE_NAME = 'org.bluez' -LE_ADVERTISING_MANAGER_IFACE = 'org.bluez.LEAdvertisingManager1' -DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager' -DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties' - -LE_ADVERTISEMENT_IFACE = 'org.bluez.LEAdvertisement1' - - -class InvalidArgsException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.freedesktop.DBus.Error.InvalidArgs' - - -class NotSupportedException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.NotSupported' - - -class NotPermittedException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.NotPermitted' - - -class InvalidValueLengthException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.InvalidValueLength' - - -class FailedException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.Failed' - - -class Advertisement(dbus.service.Object): - PATH_BASE = '/org/bluez/example/advertisement' - - def __init__(self, bus, index, advertising_type): - self.path = self.PATH_BASE + str(index) - self.bus = bus - self.ad_type = advertising_type - self.service_uuids = None - self.manufacturer_data = None - self.solicit_uuids = None - self.service_data = None - dbus.service.Object.__init__(self, bus, self.path) - - def get_properties(self): - properties = dict() - properties['Type'] = self.ad_type - if self.service_uuids is not None: - properties['ServiceUUIDs'] = dbus.Array(self.service_uuids, - signature='s') - if self.solicit_uuids is not None: - properties['SolicitUUIDs'] = dbus.Array(self.solicit_uuids, - signature='s') - if self.manufacturer_data is not None: - properties['ManufacturerData'] = dbus.Dictionary( - self.manufacturer_data, signature='qay') - if self.service_data is not None: - properties['ServiceData'] = dbus.Dictionary(self.service_data, - signature='say') - return {LE_ADVERTISEMENT_IFACE: properties} - - def get_path(self): - return dbus.ObjectPath(self.path) - - def add_service_uuid(self, uuid): - if not self.service_uuids: - self.service_uuids = [] - self.service_uuids.append(uuid) - - def add_solicit_uuid(self, uuid): - if not self.solicit_uuids: - self.solicit_uuids = [] - self.solicit_uuids.append(uuid) - - def add_manufacturer_data(self, manuf_code, data): - if not self.manufacturer_data: - self.manufacturer_data = dict() - self.manufacturer_data[manuf_code] = data - - def add_service_data(self, uuid, data): - if not self.service_data: - self.service_data = dict() - self.service_data[uuid] = data - - @dbus.service.method(DBUS_PROP_IFACE, - in_signature='s', - out_signature='a{sv}') - def GetAll(self, interface): - print 'GetAll' - if interface != LE_ADVERTISEMENT_IFACE: - raise InvalidArgsException() - print 'returning props' - return self.get_properties()[LE_ADVERTISEMENT_IFACE] - - @dbus.service.method(LE_ADVERTISEMENT_IFACE, - in_signature='', - out_signature='') - def Release(self): - print '%s: Released!' % self.path - -class TestAdvertisement(Advertisement): - - def __init__(self, bus, index): - Advertisement.__init__(self, bus, index, 'broadcast') - self.add_service_uuid('0000180D-0000-1000-8000-00805F9B34FB') - self.add_service_uuid('0000180F-0000-1000-8000-00805F9B34FB') - self.add_manufacturer_data(0xffff, [0x00, 0x01, 0x02, 0x03, 0x04]) - self.add_service_data('00009999-0000-1000-8000-00805F9B34FB', - [0x00, 0x01, 0x02, 0x03, 0x04]) - - -def register_ad_cb(): - print 'Advertisement registered' - - -def register_ad_error_cb(error): - print 'Failed to register advertisement: ' + str(error) - mainloop.quit() - - -def find_adapter(bus): - remote_om = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, '/'), - DBUS_OM_IFACE) - objects = remote_om.GetManagedObjects() - - for o, props in objects.iteritems(): - if LE_ADVERTISING_MANAGER_IFACE in props: - return o - - return None - - -def main(): - global mainloop - - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - - bus = dbus.SystemBus() - - adapter = find_adapter(bus) - if not adapter: - print 'LEAdvertisingManager1 interface not found' - return - - ad_manager = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, adapter), - LE_ADVERTISING_MANAGER_IFACE) - - test_advertisement = TestAdvertisement(bus, 0) - - mainloop = gobject.MainLoop() - - ad_manager.RegisterAdvertisement(test_advertisement.get_path(), {}, - reply_handler=register_ad_cb, - error_handler=register_ad_error_cb) - - mainloop.run() - -if __name__ == '__main__': - main() diff --git a/test/bluezutils.py b/test/bluezutils.py old mode 100644 new mode 100755 diff --git a/test/dbusdef.py b/test/dbusdef.py old mode 100644 new mode 100755 diff --git a/test/example-advertisement b/test/example-advertisement old mode 100644 new mode 100755 index ce6e40f..7da0c7b --- a/test/example-advertisement +++ b/test/example-advertisement @@ -65,10 +65,10 @@ class Advertisement(dbus.service.Object): signature='s') if self.manufacturer_data is not None: properties['ManufacturerData'] = dbus.Dictionary( - self.manufacturer_data, signature='qay') + self.manufacturer_data, signature='qv') if self.service_data is not None: properties['ServiceData'] = dbus.Dictionary(self.service_data, - signature='say') + signature='sv') if self.include_tx_power is not None: properties['IncludeTxPower'] = dbus.Boolean(self.include_tx_power) return {LE_ADVERTISEMENT_IFACE: properties} @@ -88,13 +88,13 @@ class Advertisement(dbus.service.Object): def add_manufacturer_data(self, manuf_code, data): if not self.manufacturer_data: - self.manufacturer_data = dict() - self.manufacturer_data[manuf_code] = data + self.manufacturer_data = dbus.Dictionary({}, signature='qv') + self.manufacturer_data[manuf_code] = dbus.Array(data, signature='y') def add_service_data(self, uuid, data): if not self.service_data: - self.service_data = dict() - self.service_data[uuid] = data + self.service_data = dbus.Dictionary({}, signature='sv') + self.service_data[uuid] = dbus.Array(data, signature='y') @dbus.service.method(DBUS_PROP_IFACE, in_signature='s', diff --git a/test/example-gatt-client b/test/example-gatt-client old mode 100644 new mode 100755 index 724a45d..b4bbaa9 --- a/test/example-gatt-client +++ b/test/example-gatt-client @@ -1,8 +1,10 @@ -#!/usr/bin/python +#!/usr/bin/env python3 -import argparse import dbus -import gobject +try: + from gi.repository import GObject +except ImportError: + import gobject as GObject import sys from dbus.mainloop.glib import DBusGMainLoop @@ -111,7 +113,7 @@ def hr_msrmt_changed_cb(iface, changed_props, invalidated_props): def start_client(): # Read the Body Sensor Location value and print it asynchronously. - body_snsr_loc_chrc[0].ReadValue(reply_handler=body_sensor_val_cb, + body_snsr_loc_chrc[0].ReadValue({}, reply_handler=body_sensor_val_cb, error_handler=generic_error_cb, dbus_interface=GATT_CHRC_IFACE) @@ -149,7 +151,7 @@ def process_chrc(chrc_path): return True -def process_hr_service(service_path): +def process_hr_service(service_path, chrc_paths): service = bus.get_object(BLUEZ_SERVICE_NAME, service_path) service_props = service.GetAll(GATT_SERVICE_IFACE, dbus_interface=DBUS_PROP_IFACE) @@ -157,11 +159,11 @@ def process_hr_service(service_path): uuid = service_props['UUID'] if uuid != HR_SVC_UUID: - print('Service is not a Heart Rate Service: ' + uuid) return False + print('Heart Rate Service found: ' + service_path) + # Process the characteristics. - chrc_paths = service_props['Characteristics'] for chrc_path in chrc_paths: process_chrc(chrc_path) @@ -181,33 +183,39 @@ def interfaces_removed_cb(object_path, interfaces): def main(): - # Prase the service path from the arguments. - parser = argparse.ArgumentParser( - description='D-Bus Heart Rate Service client example') - parser.add_argument('service_path', metavar='', - type=dbus.ObjectPath, nargs=1, - help='GATT service object path') - args = parser.parse_args() - service_path = args.service_path[0] - # Set up the main loop. DBusGMainLoop(set_as_default=True) global bus bus = dbus.SystemBus() global mainloop - mainloop = gobject.MainLoop() + mainloop = GObject.MainLoop() om = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, '/'), DBUS_OM_IFACE) om.connect_to_signal('InterfacesRemoved', interfaces_removed_cb) - try: - if not process_hr_service(service_path): - sys.exit(1) - except dbus.DBusException as e: - print e.message - sys.exit(1) + print('Getting objects...') + objects = om.GetManagedObjects() + chrcs = [] + + # List characteristics found + for path, interfaces in objects.items(): + if GATT_CHRC_IFACE not in interfaces.keys(): + continue + chrcs.append(path) + + # List sevices found + for path, interfaces in objects.items(): + if GATT_SERVICE_IFACE not in interfaces.keys(): + continue - print 'Heart Rate Service ready' + chrc_paths = [d for d in chrcs if d.startswith(path + "/")] + + if process_hr_service(path, chrc_paths): + break + + if not hr_service: + print('No Heart Rate Service found') + sys.exit(1) start_client() diff --git a/test/example-gatt-server b/test/example-gatt-server old mode 100644 new mode 100755 index 67dee1a..24aaff9 --- a/test/example-gatt-server +++ b/test/example-gatt-server @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 import dbus import dbus.exceptions @@ -6,10 +6,13 @@ import dbus.mainloop.glib import dbus.service import array -import gobject +try: + from gi.repository import GObject +except ImportError: + import gobject as GObject +import sys from random import randint -from collections import OrderedDict mainloop = None @@ -39,6 +42,9 @@ class FailedException(dbus.exceptions.DBusException): class Application(dbus.service.Object): + """ + org.bluez.GattApplication1 interface implementation + """ def __init__(self, bus): self.path = '/' self.services = [] @@ -55,7 +61,7 @@ class Application(dbus.service.Object): @dbus.service.method(DBUS_OM_IFACE, out_signature='a{oa{sa{sv}}}') def GetManagedObjects(self): - response = OrderedDict() + response = {} print('GetManagedObjects') for service in self.services: @@ -71,6 +77,9 @@ class Application(dbus.service.Object): class Service(dbus.service.Object): + """ + org.bluez.GattService1 interface implementation + """ PATH_BASE = '/org/bluez/example/service' def __init__(self, bus, index, uuid, primary): @@ -114,10 +123,13 @@ class Service(dbus.service.Object): if interface != GATT_SERVICE_IFACE: raise InvalidArgsException() - return self.get_properties[GATT_SERVICE_IFACE] + return self.get_properties()[GATT_SERVICE_IFACE] class Characteristic(dbus.service.Object): + """ + org.bluez.GattCharacteristic1 interface implementation + """ def __init__(self, bus, index, uuid, flags, service): self.path = service.path + '/char' + str(index) self.bus = bus @@ -161,15 +173,17 @@ class Characteristic(dbus.service.Object): if interface != GATT_CHRC_IFACE: raise InvalidArgsException() - return self.get_properties[GATT_CHRC_IFACE] + return self.get_properties()[GATT_CHRC_IFACE] - @dbus.service.method(GATT_CHRC_IFACE, out_signature='ay') - def ReadValue(self): + @dbus.service.method(GATT_CHRC_IFACE, + in_signature='a{sv}', + out_signature='ay') + def ReadValue(self, options): print('Default ReadValue called, returning error') raise NotSupportedException() - @dbus.service.method(GATT_CHRC_IFACE, in_signature='ay') - def WriteValue(self, value): + @dbus.service.method(GATT_CHRC_IFACE, in_signature='aya{sv}') + def WriteValue(self, value, options): print('Default WriteValue called, returning error') raise NotSupportedException() @@ -190,6 +204,9 @@ class Characteristic(dbus.service.Object): class Descriptor(dbus.service.Object): + """ + org.bluez.GattDescriptor1 interface implementation + """ def __init__(self, bus, index, uuid, flags, characteristic): self.path = characteristic.path + '/desc' + str(index) self.bus = bus @@ -217,15 +234,17 @@ class Descriptor(dbus.service.Object): if interface != GATT_DESC_IFACE: raise InvalidArgsException() - return self.get_properties[GATT_CHRC_IFACE] + return self.get_properties()[GATT_DESC_IFACE] - @dbus.service.method(GATT_DESC_IFACE, out_signature='ay') - def ReadValue(self): + @dbus.service.method(GATT_DESC_IFACE, + in_signature='a{sv}', + out_signature='ay') + def ReadValue(self, options): print ('Default ReadValue called, returning error') raise NotSupportedException() - @dbus.service.method(GATT_DESC_IFACE, in_signature='ay') - def WriteValue(self, value): + @dbus.service.method(GATT_DESC_IFACE, in_signature='aya{sv}') + def WriteValue(self, value, options): print('Default WriteValue called, returning error') raise NotSupportedException() @@ -285,7 +304,7 @@ class HeartRateMeasurementChrc(Characteristic): if not self.notifying: return - gobject.timeout_add(1000, self.hr_msrmt_cb) + GObject.timeout_add(1000, self.hr_msrmt_cb) def StartNotify(self): if self.notifying: @@ -314,7 +333,7 @@ class BodySensorLocationChrc(Characteristic): ['read'], service) - def ReadValue(self): + def ReadValue(self, options): # Return 'Chest' as the sensor location. return [ 0x01 ] @@ -328,7 +347,7 @@ class HeartRateControlPointChrc(Characteristic): ['write'], service) - def WriteValue(self, value): + def WriteValue(self, value, options): print('Heart Rate Control Point WriteValue called') if len(value) != 1: @@ -372,7 +391,7 @@ class BatteryLevelCharacteristic(Characteristic): service) self.notifying = False self.battery_lvl = 100 - gobject.timeout_add(5000, self.drain_battery) + GObject.timeout_add(5000, self.drain_battery) def notify_battery_level(self): if not self.notifying: @@ -390,7 +409,7 @@ class BatteryLevelCharacteristic(Characteristic): self.notify_battery_level() return True - def ReadValue(self): + def ReadValue(self, options): print('Battery Level read: ' + repr(self.battery_lvl)) return [dbus.Byte(self.battery_lvl)] @@ -419,9 +438,10 @@ class TestService(Service): TEST_SVC_UUID = '12345678-1234-5678-1234-56789abcdef0' def __init__(self, bus, index): - Service.__init__(self, bus, index, self.TEST_SVC_UUID, False) + Service.__init__(self, bus, index, self.TEST_SVC_UUID, True) self.add_characteristic(TestCharacteristic(bus, 0, self)) self.add_characteristic(TestEncryptCharacteristic(bus, 1, self)) + self.add_characteristic(TestSecureCharacteristic(bus, 2, self)) class TestCharacteristic(Characteristic): """ @@ -442,11 +462,11 @@ class TestCharacteristic(Characteristic): self.add_descriptor( CharacteristicUserDescriptionDescriptor(bus, 1, self)) - def ReadValue(self): + def ReadValue(self, options): print('TestCharacteristic Read: ' + repr(self.value)) return self.value - def WriteValue(self, value): + def WriteValue(self, value, options): print('TestCharacteristic Write: ' + repr(value)) self.value = value @@ -465,7 +485,7 @@ class TestDescriptor(Descriptor): ['read', 'write'], characteristic) - def ReadValue(self): + def ReadValue(self, options): return [ dbus.Byte('T'), dbus.Byte('e'), dbus.Byte('s'), dbus.Byte('t') ] @@ -480,7 +500,7 @@ class CharacteristicUserDescriptionDescriptor(Descriptor): def __init__(self, bus, index, characteristic): self.writable = 'writable-auxiliaries' in characteristic.flags - self.value = array.array('B', 'This is a characteristic for testing') + self.value = array.array('B', b'This is a characteristic for testing') self.value = self.value.tolist() Descriptor.__init__( self, bus, index, @@ -488,10 +508,10 @@ class CharacteristicUserDescriptionDescriptor(Descriptor): ['read', 'write'], characteristic) - def ReadValue(self): + def ReadValue(self, options): return self.value - def WriteValue(self, value): + def WriteValue(self, value, options): if not self.writable: raise NotPermittedException() self.value = value @@ -514,12 +534,12 @@ class TestEncryptCharacteristic(Characteristic): self.add_descriptor( CharacteristicUserDescriptionDescriptor(bus, 3, self)) - def ReadValue(self): - print('TestCharacteristic Read: ' + repr(self.value)) + def ReadValue(self, options): + print('TestEncryptCharacteristic Read: ' + repr(self.value)) return self.value - def WriteValue(self, value): - print('TestCharacteristic Write: ' + repr(value)) + def WriteValue(self, value, options): + print('TestEncryptCharacteristic Write: ' + repr(value)) self.value = value class TestEncryptDescriptor(Descriptor): @@ -536,7 +556,54 @@ class TestEncryptDescriptor(Descriptor): ['encrypt-read', 'encrypt-write'], characteristic) - def ReadValue(self): + def ReadValue(self, options): + return [ + dbus.Byte('T'), dbus.Byte('e'), dbus.Byte('s'), dbus.Byte('t') + ] + + +class TestSecureCharacteristic(Characteristic): + """ + Dummy test characteristic requiring secure connection. + + """ + TEST_CHRC_UUID = '12345678-1234-5678-1234-56789abcdef5' + + def __init__(self, bus, index, service): + Characteristic.__init__( + self, bus, index, + self.TEST_CHRC_UUID, + ['secure-read', 'secure-write'], + service) + self.value = [] + self.add_descriptor(TestSecureDescriptor(bus, 2, self)) + self.add_descriptor( + CharacteristicUserDescriptionDescriptor(bus, 3, self)) + + def ReadValue(self, options): + print('TestSecureCharacteristic Read: ' + repr(self.value)) + return self.value + + def WriteValue(self, value, options): + print('TestSecureCharacteristic Write: ' + repr(value)) + self.value = value + + +class TestSecureDescriptor(Descriptor): + """ + Dummy test descriptor requiring secure connection. Returns a static value. + + """ + TEST_DESC_UUID = '12345678-1234-5678-1234-56789abcdef6' + + def __init__(self, bus, index, characteristic): + Descriptor.__init__( + self, bus, index, + self.TEST_DESC_UUID, + ['secure-read', 'secure-write'], + characteristic) + + def ReadValue(self, options): return [ dbus.Byte('T'), dbus.Byte('e'), dbus.Byte('s'), dbus.Byte('t') ] @@ -555,8 +622,8 @@ def find_adapter(bus): DBUS_OM_IFACE) objects = remote_om.GetManagedObjects() - for o, props in objects.iteritems(): - if props.has_key(GATT_MANAGER_IFACE): + for o, props in objects.items(): + if GATT_MANAGER_IFACE in props.keys(): return o return None @@ -579,7 +646,9 @@ def main(): app = Application(bus) - mainloop = gobject.MainLoop() + mainloop = GObject.MainLoop() + + print('Registering GATT application...') service_manager.RegisterApplication(app.get_path(), {}, reply_handler=register_app_cb, diff --git a/test/exchange-business-cards b/test/exchange-business-cards deleted file mode 100644 index 6805cf7..0000000 --- a/test/exchange-business-cards +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python - -import sys -import dbus - -bus = dbus.SessionBus() -client = dbus.Interface(bus.get_object("org.bluez.obex", "/org/bluez/obex"), - "org.bluez.obex.Client") - -if (len(sys.argv) < 4): - print "Usage: %s " % (sys.argv[0]) - sys.exit(1) - -print "Creating Session" -path = client.CreateSession(sys.argv[1], { "Target": "OPP" }) -opp = dbus.Interface(bus.get_object("org.bluez.obex", path), - "org.bluez.obex.ObjectPush") - -opp.ExchangeBusinessCards(sys.argv[2], sys.argv[3]) diff --git a/test/ftp-client b/test/ftp-client old mode 100644 new mode 100755 diff --git a/test/get-managed-objects b/test/get-managed-objects deleted file mode 100644 index 3156f65..0000000 --- a/test/get-managed-objects +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python - -from __future__ import absolute_import, print_function, unicode_literals - -import dbus - -bus = dbus.SystemBus() - -manager = dbus.Interface(bus.get_object("org.bluez", "/"), - "org.freedesktop.DBus.ObjectManager") - -objects = manager.GetManagedObjects() - -for path in objects.keys(): - print("[ %s ]" % (path)) - - interfaces = objects[path] - - for interface in interfaces.keys(): - if interface in ["org.freedesktop.DBus.Introspectable", - "org.freedesktop.DBus.Properties"]: - continue - - print(" %s" % (interface)) - - properties = interfaces[interface] - - for key in properties.keys(): - print(" %s = %s" % (key, properties[key])) diff --git a/test/get-obex-capabilities b/test/get-obex-capabilities deleted file mode 100644 index e8afbad..0000000 --- a/test/get-obex-capabilities +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/python - -import sys -import dbus - -bus = dbus.SessionBus() -client = dbus.Interface(bus.get_object("org.bluez.obex", "/org/bluez/obex"), - "org.bluez.obex.Client") - -if (len(sys.argv) < 3): - print "Usage: %s " % (sys.argv[0]) - sys.exit(1) - -print "Creating Session" -session_path = client.CreateSession(sys.argv[1], { "Target": sys.argv[2] }) -session = dbus.Interface(bus.get_object("org.bluez.obex", session_path), - "org.bluez.obex.Session") - -print session.GetCapabilities() diff --git a/test/list-devices b/test/list-devices old mode 100644 new mode 100755 diff --git a/test/list-folders b/test/list-folders deleted file mode 100644 index 7321a15..0000000 --- a/test/list-folders +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/python - -import sys -import dbus - - -def list_folder(folder): - bus = dbus.SessionBus() - client = dbus.Interface(bus.get_object("org.bluez.obex", - "/org/bluez/obex"), - "org.bluez.obex.Client") - - path = client.CreateSession(sys.argv[1], { "Target": "ftp" }) - - ftp = dbus.Interface(bus.get_object("org.bluez.obex", path), - "org.bluez.obex.FileTransfer") - - if folder: - for node in folder.split("/"): - ftp.ChangeFolder(node) - - for i in ftp.ListFolder(): - if i["Type"] == "folder": - print "%s/" % (i["Name"]) - else: - print "%s" % (i["Name"]) - - -if __name__ == '__main__': - - if len(sys.argv) < 2: - print "Usage: %s [folder]" % (sys.argv[0]) - sys.exit(1) - - folder = None - if len(sys.argv) == 3: - folder = sys.argv[2] - - list_folder(folder) diff --git a/test/map-client b/test/map-client old mode 100644 new mode 100755 diff --git a/test/monitor-bluetooth b/test/monitor-bluetooth old mode 100644 new mode 100755 diff --git a/test/opp-client b/test/opp-client old mode 100644 new mode 100755 diff --git a/test/pbap-client b/test/pbap-client old mode 100644 new mode 100755 diff --git a/test/sap_client.py b/test/sap_client.py old mode 100644 new mode 100755 diff --git a/test/service-did.xml b/test/service-did.xml old mode 100644 new mode 100755 diff --git a/test/service-ftp.xml b/test/service-ftp.xml old mode 100644 new mode 100755 diff --git a/test/service-opp.xml b/test/service-opp.xml old mode 100644 new mode 100755 diff --git a/test/service-record.dtd b/test/service-record.dtd old mode 100644 new mode 100755 diff --git a/test/service-spp.xml b/test/service-spp.xml old mode 100644 new mode 100755 diff --git a/test/simple-agent b/test/simple-agent old mode 100644 new mode 100755 diff --git a/test/simple-endpoint b/test/simple-endpoint old mode 100644 new mode 100755 index 0164cff..78fb5fd --- a/test/simple-endpoint +++ b/test/simple-endpoint @@ -66,9 +66,9 @@ class Endpoint(dbus.service.Object): mainloop.quit() @dbus.service.method("org.bluez.MediaEndpoint1", - in_signature="", out_signature="") - def ClearConfiguration(self): - print("ClearConfiguration") + in_signature="o", out_signature="") + def ClearConfiguration(self, transport): + print("ClearConfiguration (%s)" % (transport)) @dbus.service.method("org.bluez.MediaEndpoint1", in_signature="oay", out_signature="") diff --git a/test/simple-obex-agent b/test/simple-obex-agent deleted file mode 100644 index 05ec4ed..0000000 --- a/test/simple-obex-agent +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/python - -from __future__ import absolute_import, print_function, unicode_literals - -import sys -import dbus -import dbus.service -import dbus.mainloop.glib -try: - from gi.repository import GObject -except ImportError: - import gobject as GObject - -BUS_NAME = 'org.bluez.obex' -PATH = '/org/bluez/obex' -AGENT_MANAGER_INTERFACE = 'org.bluez.obex.AgentManager1' -AGENT_INTERFACE = 'org.bluez.obex.Agent1' -TRANSFER_INTERFACE = 'org.bluez.obex.Transfer1' - -def ask(prompt): - try: - return raw_input(prompt) - except: - return input(prompt) - -class Agent(dbus.service.Object): - def __init__(self, conn=None, obj_path=None): - dbus.service.Object.__init__(self, conn, obj_path) - self.pending_auth = False - - @dbus.service.method(AGENT_INTERFACE, in_signature="o", - out_signature="s") - def AuthorizePush(self, path): - transfer = dbus.Interface(bus.get_object(BUS_NAME, path), - 'org.freedesktop.DBus.Properties') - properties = transfer.GetAll(TRANSFER_INTERFACE); - - self.pending_auth = True - auth = ask("Authorize (%s, %s) (Y/n):" % (path, - properties['Name'])) - - if auth == "n" or auth == "N": - self.pending_auth = False - raise dbus.DBusException( - "org.bluez.obex.Error.Rejected: " - "Not Authorized") - - self.pending_auth = False - - return properties['Name'] - - @dbus.service.method(AGENT_INTERFACE, in_signature="", - out_signature="") - def Cancel(self): - print("Authorization Canceled") - self.pending_auth = False - -if __name__ == '__main__': - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - - bus = dbus.SessionBus() - manager = dbus.Interface(bus.get_object(BUS_NAME, PATH), - AGENT_MANAGER_INTERFACE) - - path = "/test/agent" - agent = Agent(bus, path) - - mainloop = GObject.MainLoop() - - manager.RegisterAgent(path) - print("Agent registered") - - cont = True - while cont: - try: - mainloop.run() - except KeyboardInterrupt: - if agent.pending_auth: - agent.Cancel() - elif len(transfers) > 0: - for a in transfers: - a.cancel() - else: - cont = False - - # manager.UnregisterAgent(path) - # print "Agent unregistered" diff --git a/test/simple-player b/test/simple-player old mode 100644 new mode 100755 diff --git a/test/test-adapter b/test/test-adapter old mode 100644 new mode 100755 diff --git a/test/test-alert b/test/test-alert old mode 100644 new mode 100755 diff --git a/test/test-cyclingspeed b/test/test-cyclingspeed old mode 100644 new mode 100755 diff --git a/test/test-device b/test/test-device old mode 100644 new mode 100755 diff --git a/test/test-discovery b/test/test-discovery old mode 100644 new mode 100755 diff --git a/test/test-gatt-profile b/test/test-gatt-profile old mode 100644 new mode 100755 index ad320b1..995a659 --- a/test/test-gatt-profile +++ b/test/test-gatt-profile @@ -15,46 +15,116 @@ except ImportError: import gobject as GObject import bluezutils -class GattProfile(dbus.service.Object): - @dbus.service.method("org.bluez.GattProfile1", - in_signature="", out_signature="") - def Release(self): - print("Release") - mainloop.quit() +BLUEZ_SERVICE_NAME = 'org.bluez' +GATT_MANAGER_IFACE = 'org.bluez.GattManager1' +DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager' +DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties' -if __name__ == '__main__': - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) +GATT_PROFILE_IFACE = 'org.bluez.GattProfile1' + + +class InvalidArgsException(dbus.exceptions.DBusException): + _dbus_error_name = 'org.freedesktop.DBus.Error.InvalidArgs' + + +class Application(dbus.service.Object): + def __init__(self, bus): + self.path = '/' + self.profiles = [] + dbus.service.Object.__init__(self, bus, self.path) + + def get_path(self): + return dbus.ObjectPath(self.path) + + def add_profile(self, profile): + self.profiles.append(profile) + + @dbus.service.method(DBUS_OM_IFACE, out_signature='a{oa{sa{sv}}}') + def GetManagedObjects(self): + response = {} + print('GetManagedObjects') + + for profile in self.profiles: + response[profile.get_path()] = profile.get_properties() + + return response + + +class Profile(dbus.service.Object): + PATH_BASE = '/org/bluez/example/profile' - bus = dbus.SystemBus() + def __init__(self, bus, uuids): + self.path = self.PATH_BASE + self.bus = bus + self.uuids = uuids + dbus.service.Object.__init__(self, bus, self.path) + + def get_properties(self): + return { + GATT_PROFILE_IFACE: { + 'UUIDs': self.uuids, + } + } + + def get_path(self): + return dbus.ObjectPath(self.path) + + @dbus.service.method(GATT_PROFILE_IFACE, + in_signature="", + out_signature="") + def Release(self): + print("Release") + mainloop.quit() + + @dbus.service.method(DBUS_PROP_IFACE, + in_signature='s', + out_signature='a{sv}') + def GetAll(self, interface): + if interface != GATT_PROFILE_IFACE: + raise InvalidArgsException() + + return self.get_properties[GATT_PROFILE_IFACE] + + +def register_app_cb(): + print('GATT application registered') + + +def register_app_error_cb(error): + print('Failed to register application: ' + str(error)) + mainloop.quit() + +if __name__ == '__main__': + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - path = bluezutils.find_adapter().object_path + bus = dbus.SystemBus() - manager = dbus.Interface(bus.get_object("org.bluez", path), - "org.bluez.GattManager1") + path = bluezutils.find_adapter().object_path - option_list = [ - make_option("-u", "--uuid", action="store", - type="string", dest="uuid", - default=None), - make_option("-p", "--path", action="store", - type="string", dest="path", - default="/foo/bar/profile"), - ] + manager = dbus.Interface(bus.get_object("org.bluez", path), + GATT_MANAGER_IFACE) - opts = dbus.Dictionary({ }, signature='sv') + option_list = [make_option("-u", "--uuid", action="store", + type="string", dest="uuid", + default=None), + ] - parser = OptionParser(option_list=option_list) + opts = dbus.Dictionary({}, signature='sv') - (options, args) = parser.parse_args() + parser = OptionParser(option_list=option_list) - profile = GattProfile(bus, options.path) + (options, args) = parser.parse_args() - mainloop = GObject.MainLoop() + mainloop = GObject.MainLoop() - if not options.uuid: - options.uuid = str(uuid.uuid4()) + if not options.uuid: + options.uuid = str(uuid.uuid4()) - uuids = { options.uuid } - manager.RegisterProfile(options.path, uuids, opts) + app = Application(bus) + profile = Profile(bus, [options.uuid]) + app.add_profile(profile) + manager.RegisterApplication(app.get_path(), {}, + reply_handler=register_app_cb, + error_handler=register_app_error_cb) - mainloop.run() + mainloop.run() diff --git a/test/test-health b/test/test-health old mode 100644 new mode 100755 diff --git a/test/test-health-sink b/test/test-health-sink old mode 100644 new mode 100755 diff --git a/test/test-heartrate b/test/test-heartrate old mode 100644 new mode 100755 diff --git a/test/test-hfp b/test/test-hfp old mode 100644 new mode 100755 diff --git a/test/test-manager b/test/test-manager old mode 100644 new mode 100755 diff --git a/test/test-nap b/test/test-nap old mode 100644 new mode 100755 diff --git a/test/test-network b/test/test-network old mode 100644 new mode 100755 diff --git a/test/test-profile b/test/test-profile old mode 100644 new mode 100755 diff --git a/test/test-proximity b/test/test-proximity old mode 100644 new mode 100755 diff --git a/test/test-sap-server b/test/test-sap-server old mode 100644 new mode 100755 diff --git a/test/test-thermometer b/test/test-thermometer old mode 100644 new mode 100755 diff --git a/tools/3dsp.c b/tools/3dsp.c old mode 100644 new mode 100755 diff --git a/tools/amptest.c b/tools/amptest.c old mode 100644 new mode 100755 diff --git a/tools/avinfo.c b/tools/avinfo.c old mode 100644 new mode 100755 diff --git a/tools/avtest.c b/tools/avtest.c old mode 100644 new mode 100755 diff --git a/tools/bccmd.1 b/tools/bccmd.1 old mode 100644 new mode 100755 diff --git a/tools/bccmd.c b/tools/bccmd.c old mode 100644 new mode 100755 index 4d15f3f..84f1a4a --- a/tools/bccmd.c +++ b/tools/bccmd.c @@ -36,6 +36,8 @@ #include "lib/hci.h" #include "lib/hci_lib.h" +#include "src/shared/tty.h" + #include "csr.h" #define CSR_TRANSPORT_UNKNOWN 0 @@ -1193,34 +1195,8 @@ int main(int argc, char *argv[]) device = strdup(optarg); break; case 'b': - switch (atoi(optarg)) { - case 9600: bcsp_rate = B9600; break; - case 19200: bcsp_rate = B19200; break; - case 38400: bcsp_rate = B38400; break; - case 57600: bcsp_rate = B57600; break; - case 115200: bcsp_rate = B115200; break; - case 230400: bcsp_rate = B230400; break; - case 460800: bcsp_rate = B460800; break; - case 500000: bcsp_rate = B500000; break; - case 576000: bcsp_rate = B576000; break; - case 921600: bcsp_rate = B921600; break; - case 1000000: bcsp_rate = B1000000; break; - case 1152000: bcsp_rate = B1152000; break; - case 1500000: bcsp_rate = B1500000; break; - case 2000000: bcsp_rate = B2000000; break; -#ifdef B2500000 - case 2500000: bcsp_rate = B2500000; break; -#endif -#ifdef B3000000 - case 3000000: bcsp_rate = B3000000; break; -#endif -#ifdef B3500000 - case 3500000: bcsp_rate = B3500000; break; -#endif -#ifdef B4000000 - case 4000000: bcsp_rate = B4000000; break; -#endif - default: + bcsp_rate = tty_get_speed(atoi(optarg)); + if (!bcsp_rate) { printf("Unknown BCSP baud rate specified, defaulting to 38400bps\n"); bcsp_rate = B38400; } diff --git a/tools/bdaddr.1 b/tools/bdaddr.1 deleted file mode 100644 index efb77d2..0000000 --- a/tools/bdaddr.1 +++ /dev/null @@ -1,68 +0,0 @@ -.TH BDADDR 1 "Sep 27 2005" BlueZ "Linux System Administration" -.SH NAME -bdaddr \- Utility for changing the Bluetooth device address -.SH SYNOPSIS -.B bdaddr -.br -.B bdaddr -h -.br -.B bdaddr [-i ] [-r] [-t] [new bdaddr] - -.SH DESCRIPTION -.LP -.B -bdaddr -is used to query or set the local Bluetooth device address (BD_ADDR). If run -with no arguments, -.B -bdaddr -prints the chip manufacturer's name, and the current BD_ADDR. If the IEEE OUI -index file "oui.txt" is installed on the system, the BD_ADDR owner will be -displayed. If the optional [new bdaddr] argument is given, the device will be -reprogrammed with that address. This can either be permanent or temporary, as -specified by the -t flag. In both cases, the device must be reset before the -new address will become active. This can be done with a 'soft' reset by -specifying the -r flag, or a 'hard' reset by removing and replugging the -device. A 'hard' reset will cause the address to revert to the current -non-volatile value. -.PP -.B -bdaddr -uses manufacturer specific commands to set the address, and is therefore -device specific. For this reason, not all devices are supported, and not all -options are supported on all devices. -Current supported manufacturers are: -.B Ericsson, Cambridge Silicon Radio (CSR), Texas Instruments (TI), Zeevo -and -.B ST Microelectronics (ST) - -.SH OPTIONS -.TP -.BI -h -Gives a list of possible commands. -.TP -.BI -i\ -Specify a particular device to operate on. If not specified, default is the -first available device. -.TP -.BI -r -Reset device and make new BD_ADDR active. -.B -CSR -devices only. -.TP -.BI -t -Temporary change. Do not write to non-volatile memory. -.B -CSR -devices only. -.SH FILES -.TP -.I -/usr/share/misc/oui.txt -IEEE Organizationally Unique Identifier master file. -Manually update from: http://standards.ieee.org/regauth/oui/oui.txt -.SH AUTHORS -Written by Marcel Holtmann , -man page by Adam Laurie -.PP diff --git a/tools/bdaddr.c b/tools/bdaddr.c old mode 100644 new mode 100755 diff --git a/tools/bluemoon.c b/tools/bluemoon.c old mode 100644 new mode 100755 index 650ab0c..5fc6269 --- a/tools/bluemoon.c +++ b/tools/bluemoon.c @@ -620,6 +620,7 @@ static const struct { { 0x09, "iBT 1.5 (AG610)" }, { 0x0a, "iBT 2.1 (AG620)" }, { 0x0b, "iBT 3.0 (LnP)" }, + { 0x0c, "iBT 3.0 (WsP)" }, { } }; diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c old mode 100644 new mode 100755 diff --git a/tools/bnep-tester.c b/tools/bnep-tester.c old mode 100644 new mode 100755 diff --git a/tools/bneptest.c b/tools/bneptest.c old mode 100644 new mode 100755 index c761e16..1404252 --- a/tools/bneptest.c +++ b/tools/bneptest.c @@ -327,11 +327,7 @@ static gboolean setup_bnep_cb(GIOChannel *chan, GIOCondition cond, sk = g_io_channel_unix_get_fd(chan); /* Reading BNEP_SETUP_CONNECTION_REQUEST_MSG */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY n = recv(sk, packet, sizeof(packet), MSG_PEEK); -#else - n = read(sk, packet, sizeof(packet)); -#endif if (n < 0) { error("read(): %s(%d)", strerror(errno), errno); return FALSE; diff --git a/tools/btattach.1 b/tools/btattach.1 old mode 100644 new mode 100755 diff --git a/tools/btattach.c b/tools/btattach.c old mode 100644 new mode 100755 index a025bb0..9d1868a --- a/tools/btattach.c +++ b/tools/btattach.c @@ -46,9 +46,10 @@ #include "src/shared/mainloop.h" #include "src/shared/timeout.h" #include "src/shared/util.h" +#include "src/shared/tty.h" #include "src/shared/hci.h" -static int open_serial(const char *path) +static int open_serial(const char *path, unsigned int speed) { struct termios ti; int fd, saved_ldisc, ldisc = N_HCI; @@ -75,7 +76,7 @@ static int open_serial(const char *path) memset(&ti, 0, sizeof(ti)); cfmakeraw(&ti); - ti.c_cflag |= (B115200 | CLOCAL | CREAD); + ti.c_cflag |= (speed | CLOCAL | CREAD); /* Set flow control */ ti.c_cflag |= CRTSCTS; @@ -106,11 +107,11 @@ static void local_version_callback(const void *data, uint8_t size, } static int attach_proto(const char *path, unsigned int proto, - unsigned int flags) + unsigned int speed, unsigned int flags) { int fd, dev_id; - fd = open_serial(path); + fd = open_serial(path, speed); if (fd < 0) return -1; @@ -186,9 +187,10 @@ static void usage(void) "Usage:\n"); printf("\tbtattach [options]\n"); printf("options:\n" - "\t-B, --bredr Attach BR/EDR controller\n" + "\t-B, --bredr Attach Primary controller\n" "\t-A, --amp Attach AMP controller\n" "\t-P, --protocol Specify protocol type\n" + "\t-S, --speed Specify which baudrate to use\n" "\t-h, --help Show help options\n"); } @@ -196,6 +198,7 @@ static const struct option main_options[] = { { "bredr", required_argument, NULL, 'B' }, { "amp", required_argument, NULL, 'A' }, { "protocol", required_argument, NULL, 'P' }, + { "speed", required_argument, NULL, 'S' }, { "version", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, { } @@ -214,6 +217,9 @@ static const struct { { "intel", HCI_UART_INTEL }, { "bcm", HCI_UART_BCM }, { "qca", HCI_UART_QCA }, + { "ag6xx", HCI_UART_AG6XX }, + { "nokia", HCI_UART_NOKIA }, + { "mrvl", HCI_UART_MRVL }, { } }; @@ -223,11 +229,12 @@ int main(int argc, char *argv[]) bool raw_device = false; sigset_t mask; int exit_status, count = 0, proto_id = HCI_UART_H4; + unsigned int speed = B115200; for (;;) { int opt; - opt = getopt_long(argc, argv, "B:A:P:Rvh", + opt = getopt_long(argc, argv, "B:A:P:S:Rvh", main_options, NULL); if (opt < 0) break; @@ -242,6 +249,13 @@ int main(int argc, char *argv[]) case 'P': proto = optarg; break; + case 'S': + speed = tty_get_speed(atoi(optarg)); + if (!speed) { + fprintf(stderr, "Invalid speed: %s\n", optarg); + return EXIT_FAILURE; + } + break; case 'R': raw_device = true; break; @@ -289,14 +303,14 @@ int main(int argc, char *argv[]) unsigned long flags; int fd; - printf("Attaching BR/EDR controller to %s\n", bredr_path); + printf("Attaching Primary controller to %s\n", bredr_path); flags = (1 << HCI_UART_RESET_ON_INIT); if (raw_device) flags = (1 << HCI_UART_RAW_DEVICE); - fd = attach_proto(bredr_path, proto_id, flags); + fd = attach_proto(bredr_path, proto_id, speed, flags); if (fd >= 0) { mainloop_add_fd(fd, 0, uart_callback, NULL, NULL); count++; @@ -315,7 +329,7 @@ int main(int argc, char *argv[]) if (raw_device) flags = (1 << HCI_UART_RAW_DEVICE); - fd = attach_proto(amp_path, proto_id, flags); + fd = attach_proto(amp_path, proto_id, speed, flags); if (fd >= 0) { mainloop_add_fd(fd, 0, uart_callback, NULL, NULL); count++; diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c old mode 100644 new mode 100755 index a0fab21..4c8c9dd --- a/tools/btgatt-client.c +++ b/tools/btgatt-client.c @@ -297,18 +297,20 @@ static void print_chrc(struct gatt_db_attribute *attr, void *user_data) { uint16_t handle, value_handle; uint8_t properties; + uint16_t ext_prop; bt_uuid_t uuid; if (!gatt_db_attribute_get_char_data(attr, &handle, &value_handle, &properties, + &ext_prop, &uuid)) return; printf("\t " COLOR_YELLOW "charac" COLOR_OFF - " - start: 0x%04x, value: 0x%04x, " - "props: 0x%02x, uuid: ", - handle, value_handle, properties); + " - start: 0x%04x, value: 0x%04x, " + "props: 0x%02x, ext_props: 0x%04x, uuid: ", + handle, value_handle, properties, ext_prop); print_uuid(&uuid); gatt_db_service_foreach_desc(attr, print_desc, NULL); @@ -363,13 +365,8 @@ static void ready_cb(bool success, uint8_t att_ecode, void *user_data) struct client *cli = user_data; if (!success) { -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY PRLOG("GATT discovery procedures failed - error code: 0x%02x\n", att_ecode); -#else - PRLOG("GATT discovery procedures failed: %s (0x%02x)\n", - ecode_to_string(att_ecode), att_ecode); -#endif return; } @@ -483,12 +480,7 @@ static void read_multiple_cb(bool success, uint8_t att_ecode, int i; if (!success) { -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY PRLOG("\nRead multiple request failed: 0x%02x\n", att_ecode); -#else - PRLOG("\nRead multiple request failed: %s (0x%02x)\n", - ecode_to_string(att_ecode), att_ecode); -#endif return; } @@ -668,7 +660,7 @@ static void write_cb(bool success, uint8_t att_ecode, void *user_data) static void cmd_write_value(struct client *cli, char *cmd_str) { - int opt, i; + int opt, i, val; char *argvbuf[516]; char **argv = argvbuf; int argc = 1; @@ -736,19 +728,14 @@ static void cmd_write_value(struct client *cli, char *cmd_str) } for (i = 1; i < argc; i++) { - if (strlen(argv[i]) != 2) { - printf("Invalid value byte: %s\n", - argv[i]); - goto done; - } - - value[i-1] = strtol(argv[i], &endptr, 0); + val = strtol(argv[i], &endptr, 0); if (endptr == argv[i] || *endptr != '\0' - || errno == ERANGE) { + || errno == ERANGE || val < 0 || val > 255) { printf("Invalid value byte: %s\n", argv[i]); goto done; } + value[i-1] = val; } } @@ -803,7 +790,7 @@ static void write_long_cb(bool success, bool reliable_error, uint8_t att_ecode, static void cmd_write_long_value(struct client *cli, char *cmd_str) { - int opt, i; + int opt, i, val; char *argvbuf[516]; char **argv = argvbuf; int argc = 1; @@ -875,21 +862,15 @@ static void cmd_write_long_value(struct client *cli, char *cmd_str) } for (i = 2; i < argc; i++) { - if (strlen(argv[i]) != 2) { - printf("Invalid value byte: %s\n", - argv[i]); - free(value); - return; - } - - value[i-2] = strtol(argv[i], &endptr, 0); + val = strtol(argv[i], &endptr, 0); if (endptr == argv[i] || *endptr != '\0' - || errno == ERANGE) { + || errno == ERANGE || val < 0 || val > 255) { printf("Invalid value byte: %s\n", argv[i]); free(value); return; } + value[i-2] = val; } } @@ -919,7 +900,7 @@ static struct option write_prepare_options[] = { static void cmd_write_prepare(struct client *cli, char *cmd_str) { - int opt, i; + int opt, i, val; char *argvbuf[516]; char **argv = argvbuf; int argc = 0; @@ -1012,18 +993,14 @@ static void cmd_write_prepare(struct client *cli, char *cmd_str) } for (i = 2; i < argc; i++) { - if (strlen(argv[i]) != 2) { - printf("Invalid value byte: %s\n", argv[i]); - free(value); - return; - } - - value[i-2] = strtol(argv[i], &endptr, 0); - if (endptr == argv[i] || *endptr != '\0' || errno == ERANGE) { + val = strtol(argv[i], &endptr, 0); + if (endptr == argv[i] || *endptr != '\0' || errno == ERANGE + || val < 0 || val > 255) { printf("Invalid value byte: %s\n", argv[i]); free(value); return; } + value[i-2] = val; } done: @@ -1132,13 +1109,8 @@ static void notify_cb(uint16_t value_handle, const uint8_t *value, static void register_notify_cb(uint16_t att_ecode, void *user_data) { if (att_ecode) { -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY PRLOG("Failed to register notify handler " "- error code: 0x%02x\n", att_ecode); -#else - PRLOG("Failed to register notify handler: %s (0x%02x)\n", - ecode_to_string(att_ecode), att_ecode); -#endif return; } diff --git a/tools/btgatt-server.c b/tools/btgatt-server.c old mode 100644 new mode 100755 index 292b584..fadaff2 --- a/tools/btgatt-server.c +++ b/tools/btgatt-server.c @@ -419,7 +419,8 @@ static void populate_gap_service(struct server *server) bt_uuid16_create(&uuid, GATT_CHARAC_DEVICE_NAME); gatt_db_service_add_characteristic(service, &uuid, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, - BT_GATT_CHRC_PROP_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_EXT_PROP, gap_device_name_read_cb, gap_device_name_write_cb, server); @@ -931,18 +932,20 @@ static void print_chrc(struct gatt_db_attribute *attr, void *user_data) { uint16_t handle, value_handle; uint8_t properties; + uint16_t ext_prop; bt_uuid_t uuid; if (!gatt_db_attribute_get_char_data(attr, &handle, &value_handle, &properties, + &ext_prop, &uuid)) return; printf("\t " COLOR_YELLOW "charac" COLOR_OFF - " - start: 0x%04x, value: 0x%04x, " - "props: 0x%02x, uuid: ", - handle, value_handle, properties); + " - start: 0x%04x, value: 0x%04x, " + "props: 0x%02x, ext_prop: 0x%04x, uuid: ", + handle, value_handle, properties, ext_prop); print_uuid(&uuid); gatt_db_service_foreach_desc(attr, print_desc, NULL); diff --git a/tools/btinfo.c b/tools/btinfo.c old mode 100644 new mode 100755 index fd11ac4..8e36577 --- a/tools/btinfo.c +++ b/tools/btinfo.c @@ -79,7 +79,7 @@ struct hci_dev_info { #define HCI_UP (1 << 0) -#define HCI_BREDR 0x00 +#define HCI_PRIMARY 0x00 #define HCI_AMP 0x01 static struct hci_dev_info hci_info; @@ -128,7 +128,7 @@ static void local_version_callback(const void *data, uint8_t size, printf("HCI revision: %u\n", le16_to_cpu(rsp->hci_rev)); switch (hci_type) { - case HCI_BREDR: + case HCI_PRIMARY: printf("LMP version: %u\n", rsp->lmp_ver); printf("LMP subversion: %u\n", le16_to_cpu(rsp->lmp_subver)); break; diff --git a/tools/btiotest.c b/tools/btiotest.c old mode 100644 new mode 100755 diff --git a/tools/btmgmt.c b/tools/btmgmt.c old mode 100644 new mode 100755 index 3d03455..d5facc5 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -223,18 +223,14 @@ static void print_eir(const uint8_t *eir, uint16_t eir_len) } } -static bool load_identity(uint16_t index, struct mgmt_irk_info *irk) +static bool load_identity(const char *path, struct mgmt_irk_info *irk) { - char identity_path[PATH_MAX]; char *addr, *key; unsigned int type; int n; FILE *fp; - snprintf(identity_path, sizeof(identity_path), - "/sys/kernel/debug/bluetooth/hci%u/identity", index); - - fp = fopen(identity_path, "r"); + fp = fopen(path, "r"); if (!fp) { error("Failed to open identity file: %s", strerror(errno)); return false; @@ -1394,6 +1390,56 @@ done: noninteractive_quit(EXIT_SUCCESS); } +static void ext_info_rsp(uint8_t status, uint16_t len, const void *param, + void *user_data) +{ + const struct mgmt_rp_read_ext_info *rp = param; + uint16_t index = PTR_TO_UINT(user_data); + uint32_t supported_settings, current_settings; + char addr[18]; + + if (status != 0) { + error("Reading hci%u info failed with status 0x%02x (%s)", + index, status, mgmt_errstr(status)); + goto done; + } + + if (len < sizeof(*rp)) { + error("Too small info reply (%u bytes)", len); + goto done; + } + + print("hci%u:\tPrimary controller", index); + + ba2str(&rp->bdaddr, addr); + print("\taddr %s version %u manufacturer %u", + addr, rp->version, le16_to_cpu(rp->manufacturer)); + + supported_settings = le32_to_cpu(rp->supported_settings); + print("\tsupported settings: %s", settings2str(supported_settings)); + + current_settings = le32_to_cpu(rp->current_settings); + print("\tcurrent settings: %s", settings2str(current_settings)); + + if (supported_settings & MGMT_SETTING_CONFIGURATION) { + if (!mgmt_send(mgmt, MGMT_OP_READ_CONFIG_INFO, + index, 0, NULL, config_options_rsp, + UINT_TO_PTR(index), NULL)) { + error("Unable to send read_config cmd"); + goto done; + } + return; + } + +done: + pending_index--; + + if (pending_index > 0) + return; + + noninteractive_quit(EXIT_SUCCESS); +} + static void index_rsp(uint8_t status, uint16_t len, const void *param, void *user_data) { @@ -1498,10 +1544,10 @@ static void ext_index_rsp(uint8_t status, uint16_t len, const void *param, switch (rp->entry[i].type) { case 0x00: print("Primary controller (hci%u,%s)", index, busstr); - if (!mgmt_send(mgmt, MGMT_OP_READ_INFO, - index, 0, NULL, info_rsp, + if (!mgmt_send(mgmt, MGMT_OP_READ_EXT_INFO, + index, 0, NULL, ext_info_rsp, UINT_TO_PTR(index), NULL)) { - error("Unable to send read_info cmd"); + error("Unable to send read_ext_info cmd"); return noninteractive_quit(EXIT_FAILURE); } pending_index++; @@ -2592,7 +2638,7 @@ static void cmd_cancel_pair(struct mgmt *mgmt, uint16_t index, int argc, str2ba(argv[0], &cp.bdaddr); cp.type = type; - if (mgmt_send(mgmt, MGMT_OP_CANCEL_PAIR_DEVICE, index, sizeof(cp), &cp, + if (mgmt_reply(mgmt, MGMT_OP_CANCEL_PAIR_DEVICE, index, sizeof(cp), &cp, cancel_pair_rsp, NULL, NULL) == 0) { error("Unable to send cancel_pair_device cmd"); return noninteractive_quit(EXIT_FAILURE); @@ -2762,6 +2808,7 @@ static void irks_usage(void) static struct option irks_options[] = { { "help", 0, 0, 'h' }, { "local", 1, 0, 'l' }, + { "file", 1, 0, 'f' }, { 0, 0, 0, 0 } }; @@ -2772,6 +2819,7 @@ static void cmd_irks(struct mgmt *mgmt, uint16_t index, int argc, char **argv) struct mgmt_cp_load_irks *cp; uint8_t buf[sizeof(*cp) + 23 * MAX_IRKS]; uint16_t count, local_index; + char path[PATH_MAX]; int opt; if (index == MGMT_INDEX_NONE) @@ -2780,7 +2828,7 @@ static void cmd_irks(struct mgmt *mgmt, uint16_t index, int argc, char **argv) cp = (void *) buf; count = 0; - while ((opt = getopt_long(argc, argv, "+l:h", + while ((opt = getopt_long(argc, argv, "+l:f:h", irks_options, NULL)) != -1) { switch (opt) { case 'l': @@ -2794,13 +2842,29 @@ static void cmd_irks(struct mgmt *mgmt, uint16_t index, int argc, char **argv) local_index = atoi(optarg + 3); else local_index = atoi(optarg); - if (!load_identity(local_index, &cp->irks[count])) { + snprintf(path, sizeof(path), + "/sys/kernel/debug/bluetooth/hci%u/identity", + local_index); + if (!load_identity(path, &cp->irks[count])) { error("Unable to load identity"); optind = 0; return noninteractive_quit(EXIT_FAILURE); } count++; break; + case 'f': + if (count >= MAX_IRKS) { + error("Number of IRKs exceeded"); + optind = 0; + return noninteractive_quit(EXIT_FAILURE); + } + if (!load_identity(optarg, &cp->irks[count])) { + error("Unable to load identities"); + optind = 0; + return noninteractive_quit(EXIT_FAILURE); + } + count++; + break; case 'h': irks_usage(); optind = 0; @@ -3904,7 +3968,9 @@ static void advsize_usage(void) "\t -g, --general-discov \"general-discoverable\" flag\n" "\t -l, --limited-discov \"limited-discoverable\" flag\n" "\t -m, --managed-flags \"managed-flags\" flag\n" - "\t -p, --tx-power \"tx-power\" flag"); + "\t -p, --tx-power \"tx-power\" flag\n"\ + "\t -a, --appearance \"appearance\" flag\n"\ + "\t -n, --local-name \"local-name\" flag"); } static struct option advsize_options[] = { @@ -3914,6 +3980,8 @@ static struct option advsize_options[] = { { "limited-discov", 0, 0, 'l' }, { "managed-flags", 0, 0, 'm' }, { "tx-power", 0, 0, 'p' }, + { "appearance", 0, 0, 'a' }, + { "local-name", 0, 0, 'n' }, { 0, 0, 0, 0} }; @@ -3925,7 +3993,7 @@ static void cmd_advsize(struct mgmt *mgmt, uint16_t index, uint32_t flags = 0; int opt; - while ((opt = getopt_long(argc, argv, "+cglmph", + while ((opt = getopt_long(argc, argv, "+cglmphna", advsize_options, NULL)) != -1) { switch (opt) { case 'c': @@ -3943,6 +4011,12 @@ static void cmd_advsize(struct mgmt *mgmt, uint16_t index, case 'p': flags |= MGMT_ADV_FLAG_TX_POWER; break; + case 'a': + flags |= MGMT_ADV_FLAG_APPEARANCE; + break; + case 'n': + flags |= MGMT_ADV_FLAG_LOCAL_NAME; + break; default: advsize_usage(); return noninteractive_quit(EXIT_FAILURE); @@ -4007,6 +4081,8 @@ static void add_adv_usage(void) "\t -c, --connectable \"connectable\" flag\n" "\t -g, --general-discov \"general-discoverable\" flag\n" "\t -l, --limited-discov \"limited-discoverable\" flag\n" + "\t -n, --scan-rsp-local-name \"local-name\" flag\n" + "\t -a, --scan-rsp-appearance \"appearance\" flag\n" "\t -m, --managed-flags \"managed-flags\" flag\n" "\t -p, --tx-power \"tx-power\" flag\n" "e.g.:\n" @@ -4088,7 +4164,7 @@ static void cmd_add_adv(struct mgmt *mgmt, uint16_t index, bool quit = true; uint32_t flags = 0; - while ((opt = getopt_long(argc, argv, "+u:d:s:t:D:cglmph", + while ((opt = getopt_long(argc, argv, "+u:d:s:t:D:cglmphna", add_adv_options, NULL)) != -1) { switch (opt) { case 'u': @@ -4167,6 +4243,12 @@ static void cmd_add_adv(struct mgmt *mgmt, uint16_t index, case 'p': flags |= MGMT_ADV_FLAG_TX_POWER; break; + case 'n': + flags |= MGMT_ADV_FLAG_LOCAL_NAME; + break; + case 'a': + flags |= MGMT_ADV_FLAG_APPEARANCE; + break; case 'h': success = true; default: @@ -4290,6 +4372,40 @@ static void cmd_clr_adv(struct mgmt *mgmt, uint16_t index, int argc, char **argv cmd_rm_adv(mgmt, index, 2, rm_argv); } +static void appearance_rsp(uint8_t status, uint16_t len, const void *param, + void *user_data) +{ + if (status != 0) + error("Could not set Appearance with status 0x%02x (%s)", + status, mgmt_errstr(status)); + else + print("Appearance successfully set"); + + noninteractive_quit(EXIT_SUCCESS); +} + +static void cmd_appearance(struct mgmt *mgmt, uint16_t index, int argc, + char **argv) +{ + struct mgmt_cp_set_appearance cp; + + if (argc < 2) { + print("Usage: appearance "); + return noninteractive_quit(EXIT_FAILURE); + } + + if (index == MGMT_INDEX_NONE) + index = 0; + + cp.appearance = cpu_to_le16(strtol(argv[1], NULL, 0)); + + if (mgmt_send(mgmt, MGMT_OP_SET_APPEARANCE, index, sizeof(cp), &cp, + appearance_rsp, NULL, NULL) == 0) { + error("Unable to send appearance cmd"); + return noninteractive_quit(EXIT_FAILURE); + } +} + struct cmd_info { char *cmd; void (*func)(struct mgmt *mgmt, uint16_t index, int argc, char **argv); @@ -4358,6 +4474,7 @@ static struct cmd_info all_cmd[] = { { "add-adv", cmd_add_adv, "Add advertising instance" }, { "rm-adv", cmd_rm_adv, "Remove advertising instance" }, { "clr-adv", cmd_clr_adv, "Clear advertising instances" }, + { "appearance", cmd_appearance, "Set appearance" }, }; static void cmd_quit(struct mgmt *mgmt, uint16_t index, diff --git a/tools/btproxy.c b/tools/btproxy.c old mode 100644 new mode 100755 index 43de037..4bb7fef --- a/tools/btproxy.c +++ b/tools/btproxy.c @@ -49,7 +49,7 @@ #include "src/shared/ecc.h" #include "monitor/bt.h" -#define HCI_BREDR 0x00 +#define HCI_PRIMARY 0x00 #define HCI_AMP 0x01 #define BTPROTO_HCI 1 @@ -758,7 +758,7 @@ int main(int argc, char *argv[]) const char *unix_path = NULL; unsigned short tcp_port = 0xb1ee; /* 45550 */ bool use_redirect = false; - uint8_t type = HCI_BREDR; + uint8_t type = HCI_PRIMARY; const char *str; sigset_t mask; diff --git a/tools/btsnoop.c b/tools/btsnoop.c old mode 100644 new mode 100755 index a9b7f3c..3eb8082 --- a/tools/btsnoop.c +++ b/tools/btsnoop.c @@ -34,10 +34,6 @@ #include #include #include -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#include -#include -#endif #include #include #include @@ -275,118 +271,6 @@ close_input: for (i = 0; i < num_input; i++) close(input_fd[i]); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define BT_SNOOP_TYPE_HCI_PREFIX "btsnoop_type_hci" -#define MAX_SUPPORTED_ADAPTER 16 - -static void command_split(const char *input) -{ - unsigned char buf[BTSNOOP_MAX_PACKET_SIZE]; - uint16_t pktlen,opcode; - uint32_t type; - struct timeval tv; - uint16_t index, max_index = 0; - char write_file_name[255]; - struct btsnoop *btsnoop_read_file = NULL; - struct btsnoop *btsnoop_write_file[MAX_SUPPORTED_ADAPTER] = { NULL }; - time_t t; - struct tm tm; - unsigned long num_packets = 0; - - btsnoop_read_file = btsnoop_open(input, BTSNOOP_FLAG_PKLG_SUPPORT); - if (!btsnoop_read_file) - return; - - type = btsnoop_get_format(btsnoop_read_file); - if (type != BTSNOOP_FORMAT_MONITOR) { - fprintf(stderr, "unsupported link data type %u\n", type); - btsnoop_unref(btsnoop_read_file); - return; - } - -next_packet: - if (!btsnoop_read_hci(btsnoop_read_file, &tv, &index, &opcode, buf, - &pktlen)) - goto close_files; - - if (opcode == 0xffff || index >= MAX_SUPPORTED_ADAPTER) - goto next_packet; - - switch (opcode) { - case BTSNOOP_OPCODE_NEW_INDEX: - t = tv.tv_sec; - localtime_r(&t, &tm); - - if (max_index < index) - max_index = index; - - sprintf(write_file_name, "%s%d_%02d:%02d:%02d.%06lu.log", - BT_SNOOP_TYPE_HCI_PREFIX, index, tm.tm_hour, tm.tm_min, - tm.tm_sec, tv.tv_usec); - - printf("New Index %d would be saved in %s\n", index, - write_file_name); - - btsnoop_write_file[index] = btsnoop_create(write_file_name, - BTSNOOP_FORMAT_HCI, -1, -1); - if (!btsnoop_write_file[index]) - goto close_files; - - break; - case BTSNOOP_OPCODE_DEL_INDEX: - printf("Del Index %d\n", index); - - btsnoop_unref(btsnoop_write_file[index]); - btsnoop_write_file[index] = NULL; - break; - - case BTSNOOP_OPCODE_COMMAND_PKT: - case BTSNOOP_OPCODE_EVENT_PKT: - case BTSNOOP_OPCODE_ACL_TX_PKT: - case BTSNOOP_OPCODE_ACL_RX_PKT: - case BTSNOOP_OPCODE_SCO_TX_PKT: - case BTSNOOP_OPCODE_SCO_RX_PKT: - if (!btsnoop_write_file[index]) { - t = tv.tv_sec; - localtime_r(&t, &tm); - - if (max_index < index) - max_index = index; - - sprintf(write_file_name, "%s%d_%02d:%02d:%02d.%06lu.log", - BT_SNOOP_TYPE_HCI_PREFIX, index, - tm.tm_hour, tm.tm_min, - tm.tm_sec, tv.tv_usec); - - printf("New Index %d would be saved in %s\n", index, - write_file_name); - - btsnoop_write_file[index] = btsnoop_create(write_file_name, - BTSNOOP_FORMAT_HCI, -1, -1); - } - - if (!btsnoop_write_file[index]) - goto close_files; - btsnoop_write_hci(btsnoop_write_file[index], &tv, index, - opcode, buf, pktlen); - break; - default: - printf("skip btmon opcode(%d)\n",opcode); - } - num_packets++; - - goto next_packet; - -close_files: - for (index = 0; index < max_index; index++) - btsnoop_unref(btsnoop_write_file[index]); - - btsnoop_unref(btsnoop_read_file); - - printf("BT Snoop data link transfer is completed for %lu packets\n", - num_packets); -} -#endif static void command_extract_eir(const char *input) { @@ -634,9 +518,6 @@ static void usage(void) printf("commands:\n" "\t-m, --merge Merge multiple btsnoop files\n" "\t-e, --extract Extract data from btsnoop file\n" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - "\t-s, --split Split btmon file into legacy btsnoop file(s)\n" -#endif "\t-h, --help Show help options\n"); } @@ -644,19 +525,12 @@ static const struct option main_options[] = { { "merge", required_argument, NULL, 'm' }, { "extract", required_argument, NULL, 'e' }, { "type", required_argument, NULL, 't' }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "split", required_argument, NULL, 's' }, -#endif { "version", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, { } }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -enum { INVALID, MERGE, EXTRACT, SPLIT }; -#else enum { INVALID, MERGE, EXTRACT }; -#endif int main(int argc, char *argv[]) { @@ -667,11 +541,8 @@ int main(int argc, char *argv[]) for (;;) { int opt; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - opt = getopt_long(argc, argv, "m:e:s:t:vh", main_options, NULL); -#else + opt = getopt_long(argc, argv, "m:e:t:vh", main_options, NULL); -#endif if (opt < 0) break; @@ -684,11 +555,6 @@ int main(int argc, char *argv[]) command = EXTRACT; input_path = optarg; break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case 's': - command = SPLIT; - input_path = optarg; -#endif case 't': type = optarg; break; @@ -734,16 +600,6 @@ int main(int argc, char *argv[]) fprintf(stderr, "extract type not supported\n"); break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case SPLIT: - if (argc - optind > 0) { - fprintf(stderr, "extra arguments not allowed\n"); - return EXIT_FAILURE; - } - - command_split(input_path); - break; -#endif default: usage(); return EXIT_FAILURE; diff --git a/tools/check-selftest.c b/tools/check-selftest.c old mode 100644 new mode 100755 diff --git a/tools/ciptool.1 b/tools/ciptool.1 old mode 100644 new mode 100755 diff --git a/tools/ciptool.c b/tools/ciptool.c old mode 100644 new mode 100755 diff --git a/tools/cltest.c b/tools/cltest.c old mode 100644 new mode 100755 index 95fa7b6..44a17a8 --- a/tools/cltest.c +++ b/tools/cltest.c @@ -228,7 +228,7 @@ static bool find_controllers(void) if (ioctl(fd, HCIGETDEVINFO, (void *) &di) < 0) continue; - if (((di.type & 0x30) >> 4) != HCI_BREDR) + if (((di.type & 0x30) >> 4) != HCI_PRIMARY) continue; if (!bacmp(&bdaddr_src, BDADDR_ANY)) { diff --git a/tools/create-image.c b/tools/create-image.c old mode 100644 new mode 100755 diff --git a/tools/csr.c b/tools/csr.c old mode 100644 new mode 100755 index 2c09189..15ae7c4 --- a/tools/csr.c +++ b/tools/csr.c @@ -2756,7 +2756,7 @@ static int parse_line(char *str) off++; - while (1) { + while (length <= sizeof(array) - 2) { value = strtol(off, &end, 16); if (value == 0 && off == end) break; diff --git a/tools/csr.h b/tools/csr.h old mode 100644 new mode 100755 diff --git a/tools/csr_3wire.c b/tools/csr_3wire.c old mode 100644 new mode 100755 diff --git a/tools/csr_bcsp.c b/tools/csr_bcsp.c old mode 100644 new mode 100755 diff --git a/tools/csr_h4.c b/tools/csr_h4.c old mode 100644 new mode 100755 diff --git a/tools/csr_hci.c b/tools/csr_hci.c old mode 100644 new mode 100755 diff --git a/tools/csr_usb.c b/tools/csr_usb.c old mode 100644 new mode 100755 diff --git a/tools/eddystone.c b/tools/eddystone.c old mode 100644 new mode 100755 index 23a34f9..9569ee0 --- a/tools/eddystone.c +++ b/tools/eddystone.c @@ -149,7 +149,6 @@ static void adv_tx_power_callback(const void *data, uint8_t size, cmd.data[0] = 0x02; /* Field length */ cmd.data[1] = 0x01; /* Flags */ - cmd.data[2] = 0x02; /* LE General Discoverable Mode */ cmd.data[2] |= 0x04; /* BR/EDR Not Supported */ cmd.data[3] = 0x03; /* Field length */ diff --git a/tools/example.psr b/tools/example.psr deleted file mode 100644 index bbbec73..0000000 --- a/tools/example.psr +++ /dev/null @@ -1,12 +0,0 @@ -// PSKEY_BDADDR -&0001 = 0001 2821 005b 6789 -// PSKEY_ANA_FTRIM -&01f6 = 0025 -// PSKEY_HOST_INTERFACE -&01f9 = 0001 -// PSKEY_UART_BAUD_RATE -&0204 = 01d8 -// PSKEY_ANA_FREQ -&01fe = 0004 -// PSKEY_UART_CONFIG -&0205 = 0006 diff --git a/tools/gap-tester.c b/tools/gap-tester.c old mode 100644 new mode 100755 diff --git a/tools/gatt-example b/tools/gatt-example deleted file mode 100644 index a6f5cbe..0000000 --- a/tools/gatt-example +++ /dev/null @@ -1,533 +0,0 @@ -#!/usr/bin/python - -import dbus -import dbus.exceptions -import dbus.mainloop.glib -import dbus.service - -import array -import gobject - -from random import randint - -mainloop = None - -BLUEZ_SERVICE_NAME = 'org.bluez' -GATT_MANAGER_IFACE = 'org.bluez.GattManager1' -DBUS_OM_IFACE = 'org.freedesktop.DBus.ObjectManager' -DBUS_PROP_IFACE = 'org.freedesktop.DBus.Properties' - -GATT_SERVICE_IFACE = 'org.bluez.GattService1' -GATT_CHRC_IFACE = 'org.bluez.GattCharacteristic1' -GATT_DESC_IFACE = 'org.bluez.GattDescriptor1' - -class InvalidArgsException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.freedesktop.DBus.Error.InvalidArgs' - -class NotSupportedException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.NotSupported' - -class NotPermittedException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.NotPermitted' - -class InvalidValueLengthException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.InvalidValueLength' - -class FailedException(dbus.exceptions.DBusException): - _dbus_error_name = 'org.bluez.Error.Failed' - - -class Service(dbus.service.Object): - PATH_BASE = '/org/bluez/example/service' - - def __init__(self, bus, index, uuid, primary): - self.path = self.PATH_BASE + str(index) - self.bus = bus - self.uuid = uuid - self.primary = primary - self.characteristics = [] - dbus.service.Object.__init__(self, bus, self.path) - - def get_properties(self): - return { - GATT_SERVICE_IFACE: { - 'UUID': self.uuid, - 'Primary': self.primary, - 'Characteristics': dbus.Array( - self.get_characteristic_paths(), - signature='o') - } - } - - def get_path(self): - return dbus.ObjectPath(self.path) - - def add_characteristic(self, characteristic): - self.characteristics.append(characteristic) - - def get_characteristic_paths(self): - result = [] - for chrc in self.characteristics: - result.append(chrc.get_path()) - return result - - def get_characteristics(self): - return self.characteristics - - @dbus.service.method(DBUS_PROP_IFACE, - in_signature='s', - out_signature='a{sv}') - def GetAll(self, interface): - if interface != GATT_SERVICE_IFACE: - raise InvalidArgsException() - - return self.get_properties[GATT_SERVICE_IFACE] - - @dbus.service.method(DBUS_OM_IFACE, out_signature='a{oa{sa{sv}}}') - def GetManagedObjects(self): - response = {} - print 'GetManagedObjects' - - response[self.get_path()] = self.get_properties() - chrcs = self.get_characteristics() - for chrc in chrcs: - response[chrc.get_path()] = chrc.get_properties() - descs = chrc.get_descriptors() - for desc in descs: - response[desc.get_path()] = desc.get_properties() - - return response - - -class Characteristic(dbus.service.Object): - def __init__(self, bus, index, uuid, flags, service): - self.path = service.path + '/char' + str(index) - self.bus = bus - self.uuid = uuid - self.service = service - self.flags = flags - self.descriptors = [] - dbus.service.Object.__init__(self, bus, self.path) - - def get_properties(self): - return { - GATT_CHRC_IFACE: { - 'Service': self.service.get_path(), - 'UUID': self.uuid, - 'Flags': self.flags, - 'Descriptors': dbus.Array( - self.get_descriptor_paths(), - signature='o') - } - } - - def get_path(self): - return dbus.ObjectPath(self.path) - - def add_descriptor(self, descriptor): - self.descriptors.append(descriptor) - - def get_descriptor_paths(self): - result = [] - for desc in self.descriptors: - result.append(desc.get_path()) - return result - - def get_descriptors(self): - return self.descriptors - - @dbus.service.method(DBUS_PROP_IFACE, - in_signature='s', - out_signature='a{sv}') - def GetAll(self, interface): - if interface != GATT_CHRC_IFACE: - raise InvalidArgsException() - - return self.get_properties[GATT_CHRC_IFACE] - - @dbus.service.method(GATT_CHRC_IFACE, out_signature='ay') - def ReadValue(self): - print 'Default ReadValue called, returning error' - raise NotSupportedException() - - @dbus.service.method(GATT_CHRC_IFACE, in_signature='ay') - def WriteValue(self, value): - print 'Default WriteValue called, returning error' - raise NotSupportedException() - - @dbus.service.method(GATT_CHRC_IFACE) - def StartNotify(self): - print 'Default StartNotify called, returning error' - raise NotSupportedException() - - @dbus.service.method(GATT_CHRC_IFACE) - def StopNotify(self): - print 'Default StopNotify called, returning error' - raise NotSupportedException() - - @dbus.service.signal(DBUS_PROP_IFACE, - signature='sa{sv}as') - def PropertiesChanged(self, interface, changed, invalidated): - pass - - -class Descriptor(dbus.service.Object): - def __init__(self, bus, index, uuid, characteristic): - self.path = characteristic.path + '/desc' + str(index) - self.bus = bus - self.uuid = uuid - self.chrc = characteristic - dbus.service.Object.__init__(self, bus, self.path) - - def get_properties(self): - return { - GATT_DESC_IFACE: { - 'Characteristic': self.chrc.get_path(), - 'UUID': self.uuid, - } - } - - def get_path(self): - return dbus.ObjectPath(self.path) - - @dbus.service.method(DBUS_PROP_IFACE, - in_signature='s', - out_signature='a{sv}') - def GetAll(self, interface): - if interface != GATT_DESC_IFACE: - raise InvalidArgsException() - - return self.get_properties[GATT_CHRC_IFACE] - - @dbus.service.method(GATT_DESC_IFACE, out_signature='ay') - def ReadValue(self): - print 'Default ReadValue called, returning error' - raise NotSupportedException() - - @dbus.service.method(GATT_DESC_IFACE, in_signature='ay') - def WriteValue(self, value): - print 'Default WriteValue called, returning error' - raise NotSupportedException() - - -class HeartRateService(Service): - """ - Fake Heart Rate Service that simulates a fake heart beat and control point - behavior. - - """ - HR_UUID = '0000180d-0000-1000-8000-00805f9b34fb' - - def __init__(self, bus, index): - Service.__init__(self, bus, index, self.HR_UUID, True) - self.add_characteristic(HeartRateMeasurementChrc(bus, 0, self)) - self.add_characteristic(BodySensorLocationChrc(bus, 1, self)) - self.add_characteristic(HeartRateControlPointChrc(bus, 2, self)) - self.energy_expended = 0 - - -class HeartRateMeasurementChrc(Characteristic): - HR_MSRMT_UUID = '00002a37-0000-1000-8000-00805f9b34fb' - - def __init__(self, bus, index, service): - Characteristic.__init__( - self, bus, index, - self.HR_MSRMT_UUID, - ['notify'], - service) - self.notifying = False - self.hr_ee_count = 0 - - def hr_msrmt_cb(self): - value = [] - value.append(dbus.Byte(0x06)) - - value.append(dbus.Byte(randint(90, 130))) - - if self.hr_ee_count % 10 == 0: - value[0] = dbus.Byte(value[0] | 0x08) - value.append(dbus.Byte(self.service.energy_expended & 0xff)) - value.append(dbus.Byte((self.service.energy_expended >> 8) & 0xff)) - - self.service.energy_expended = \ - min(0xffff, self.service.energy_expended + 1) - self.hr_ee_count += 1 - - print 'Updating value: ' + repr(value) - - self.PropertiesChanged(GATT_CHRC_IFACE, { 'Value': value }, []) - - return self.notifying - - def _update_hr_msrmt_simulation(self): - print 'Update HR Measurement Simulation' - - if not self.notifying: - return - - gobject.timeout_add(1000, self.hr_msrmt_cb) - - def StartNotify(self): - if self.notifying: - print 'Already notifying, nothing to do' - return - - self.notifying = True - self._update_hr_msrmt_simulation() - - def StopNotify(self): - if not self.notifying: - print 'Not notifying, nothing to do' - return - - self.notifying = False - self._update_hr_msrmt_simulation() - - -class BodySensorLocationChrc(Characteristic): - BODY_SNSR_LOC_UUID = '00002a38-0000-1000-8000-00805f9b34fb' - - def __init__(self, bus, index, service): - Characteristic.__init__( - self, bus, index, - self.BODY_SNSR_LOC_UUID, - ['read'], - service) - - def ReadValue(self): - # Return 'Chest' as the sensor location. - return [ 0x01 ] - -class HeartRateControlPointChrc(Characteristic): - HR_CTRL_PT_UUID = '00002a39-0000-1000-8000-00805f9b34fb' - - def __init__(self, bus, index, service): - Characteristic.__init__( - self, bus, index, - self.HR_CTRL_PT_UUID, - ['write'], - service) - - def WriteValue(self, value): - print 'Heart Rate Control Point WriteValue called' - - if len(value) != 1: - raise InvalidValueLengthException() - - byte = value[0] - print 'Control Point value: ' + repr(byte) - - if byte != 1: - raise FailedException("0x80") - - print 'Energy Expended field reset!' - self.service.energy_expended = 0 - - -class BatteryService(Service): - """ - Fake Battery service that emulates a draining battery. - - """ - BATTERY_UUID = '180f' - - def __init__(self, bus, index): - Service.__init__(self, bus, index, self.BATTERY_UUID, True) - self.add_characteristic(BatteryLevelCharacteristic(bus, 0, self)) - - -class BatteryLevelCharacteristic(Characteristic): - """ - Fake Battery Level characteristic. The battery level is drained by 2 points - every 5 seconds. - - """ - BATTERY_LVL_UUID = '2a19' - - def __init__(self, bus, index, service): - Characteristic.__init__( - self, bus, index, - self.BATTERY_LVL_UUID, - ['read', 'notify'], - service) - self.notifying = False - self.battery_lvl = 100 - gobject.timeout_add(5000, self.drain_battery) - - def notify_battery_level(self): - if not self.notifying: - return - self.PropertiesChanged( - GATT_CHRC_IFACE, - { 'Value': [dbus.Byte(self.battery_lvl)] }, []) - - def drain_battery(self): - if self.battery_lvl > 0: - self.battery_lvl -= 2 - if self.battery_lvl < 0: - self.battery_lvl = 0 - print 'Battery Level drained: ' + repr(self.battery_lvl) - self.notify_battery_level() - return True - - def ReadValue(self): - print 'Battery Level read: ' + repr(self.battery_lvl) - return [dbus.Byte(self.battery_lvl)] - - def StartNotify(self): - if self.notifying: - print 'Already notifying, nothing to do' - return - - self.notifying = True - self.notify_battery_level() - - def StopNotify(self): - if not self.notifying: - print 'Not notifying, nothing to do' - return - - self.notifying = False - - -class TestService(Service): - """ - Dummy test service that provides characteristics and descriptors that - exercise various API functionality. - - """ - TEST_SVC_UUID = '12345678-1234-5678-1234-56789abcdef0' - - def __init__(self, bus, index): - Service.__init__(self, bus, index, self.TEST_SVC_UUID, False) - self.add_characteristic(TestCharacteristic(bus, 0, self)) - - -class TestCharacteristic(Characteristic): - """ - Dummy test characteristic. Allows writing arbitrary bytes to its value, and - contains "extended properties", as well as a test descriptor. - - """ - TEST_CHRC_UUID = '12345678-1234-5678-1234-56789abcdef1' - - def __init__(self, bus, index, service): - Characteristic.__init__( - self, bus, index, - self.TEST_CHRC_UUID, - ['read', 'write', 'writable-auxiliaries'], - service) - self.value = [] - self.add_descriptor(TestDescriptor(bus, 0, self)) - self.add_descriptor( - CharacteristicUserDescriptionDescriptor(bus, 1, self)) - - def ReadValue(self): - print 'TestCharacteristic Read: ' + repr(self.value) - return self.value - - def WriteValue(self, value): - print 'TestCharacteristic Write: ' + repr(value) - self.value = value - - -class TestDescriptor(Descriptor): - """ - Dummy test descriptor. Returns a static value. - - """ - TEST_DESC_UUID = '12345678-1234-5678-1234-56789abcdef2' - - def __init__(self, bus, index, characteristic): - Descriptor.__init__( - self, bus, index, - self.TEST_DESC_UUID, - characteristic) - - def ReadValue(self): - return [ - dbus.Byte('T'), dbus.Byte('e'), dbus.Byte('s'), dbus.Byte('t') - ] - - -class CharacteristicUserDescriptionDescriptor(Descriptor): - """ - Writable CUD descriptor. - - """ - CUD_UUID = '2901' - - def __init__(self, bus, index, characteristic): - self.writable = 'writable-auxiliaries' in characteristic.flags - self.value = array.array('B', 'This is a characteristic for testing') - self.value = self.value.tolist() - Descriptor.__init__( - self, bus, index, - self.CUD_UUID, - characteristic) - - def ReadValue(self): - return self.value - - def WriteValue(self, value): - if not self.writable: - raise NotPermittedException() - self.value = value - - -def register_service_cb(): - print 'GATT service registered' - - -def register_service_error_cb(error): - print 'Failed to register service: ' + str(error) - mainloop.quit() - - -def find_adapter(bus): - remote_om = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, '/'), - DBUS_OM_IFACE) - objects = remote_om.GetManagedObjects() - - for o, props in objects.iteritems(): - if props.has_key(GATT_MANAGER_IFACE): - return o - - return None - -def main(): - global mainloop - - dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - - bus = dbus.SystemBus() - - adapter = find_adapter(bus) - if not adapter: - print 'GattManager1 interface not found' - return - - service_manager = dbus.Interface( - bus.get_object(BLUEZ_SERVICE_NAME, adapter), - GATT_MANAGER_IFACE) - - hr_service = HeartRateService(bus, 0) - bat_service = BatteryService(bus, 1) - test_service = TestService(bus, 2) - - mainloop = gobject.MainLoop() - - service_manager.RegisterService(hr_service.get_path(), {}, - reply_handler=register_service_cb, - error_handler=register_service_error_cb) - service_manager.RegisterService(bat_service.get_path(), {}, - reply_handler=register_service_cb, - error_handler=register_service_error_cb) - service_manager.RegisterService(test_service.get_path(), {}, - reply_handler=register_service_cb, - error_handler=register_service_error_cb) - - mainloop.run() - -if __name__ == '__main__': - main() diff --git a/tools/gatt-service.c b/tools/gatt-service.c old mode 100644 new mode 100755 index 9baa9e1..6bd5576 --- a/tools/gatt-service.c +++ b/tools/gatt-service.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,7 @@ static GSList *services; static DBusConnection *connection; struct characteristic { + char *service; char *uuid; char *path; uint8_t *value; @@ -63,10 +65,12 @@ struct characteristic { }; struct descriptor { + struct characteristic *chr; char *uuid; char *path; uint8_t *value; int vlen; + const char **props; }; /* @@ -75,6 +79,7 @@ struct descriptor { * property of the GattCharacteristic1. */ static const char *ias_alert_level_props[] = { "write-without-response", NULL }; +static const char *desc_props[] = { "read", "write", NULL }; static gboolean desc_get_uuid(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) @@ -86,13 +91,20 @@ static gboolean desc_get_uuid(const GDBusPropertyTable *property, return TRUE; } -static gboolean desc_get_value(const GDBusPropertyTable *property, +static gboolean desc_get_characteristic(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) { struct descriptor *desc = user_data; - DBusMessageIter array; - printf("Descriptor(%s): Get(\"Value\")\n", desc->uuid); + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, + &desc->chr->path); + + return TRUE; +} + +static bool desc_read(struct descriptor *desc, DBusMessageIter *iter) +{ + DBusMessageIter array; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING, &array); @@ -103,7 +115,40 @@ static gboolean desc_get_value(const GDBusPropertyTable *property, dbus_message_iter_close_container(iter, &array); - return TRUE; + return true; +} + +static gboolean desc_get_value(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + struct descriptor *desc = user_data; + + printf("Descriptor(%s): Get(\"Value\")\n", desc->uuid); + + return desc_read(desc, iter); +} + +static void desc_write(struct descriptor *desc, const uint8_t *value, int len) +{ + g_free(desc->value); + desc->value = g_memdup(value, len); + desc->vlen = len; + + g_dbus_emit_property_changed(connection, desc->path, + GATT_DESCRIPTOR_IFACE, "Value"); +} + +static int parse_value(DBusMessageIter *iter, const uint8_t **value, int *len) +{ + DBusMessageIter array; + + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) + return -EINVAL; + + dbus_message_iter_recurse(iter, &array); + dbus_message_iter_get_fixed_array(&array, value, len); + + return 0; } static void desc_set_value(const GDBusPropertyTable *property, @@ -111,29 +156,48 @@ static void desc_set_value(const GDBusPropertyTable *property, GDBusPendingPropertySet id, void *user_data) { struct descriptor *desc = user_data; - DBusMessageIter array; const uint8_t *value; - int vlen; + int len; printf("Descriptor(%s): Set(\"Value\", ...)\n", desc->uuid); - dbus_message_iter_recurse(iter, &array); - dbus_message_iter_get_fixed_array(&array, &value, &vlen); + if (parse_value(iter, &value, &len)) { + printf("Invalid value for Set('Value'...)\n"); + g_dbus_pending_property_error(id, + ERROR_INTERFACE ".InvalidArguments", + "Invalid arguments in method call"); + return; + } - g_free(desc->value); - desc->value = g_memdup(value, vlen); - desc->vlen = vlen; + desc_write(desc, value, len); g_dbus_pending_property_success(id); +} - g_dbus_emit_property_changed(connection, desc->path, - GATT_DESCRIPTOR_IFACE, "Value"); +static gboolean desc_get_props(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct descriptor *desc = data; + DBusMessageIter array; + int i; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_STRING_AS_STRING, &array); + + for (i = 0; desc->props[i]; i++) + dbus_message_iter_append_basic(&array, + DBUS_TYPE_STRING, &desc->props[i]); + dbus_message_iter_close_container(iter, &array); + + return TRUE; } static const GDBusPropertyTable desc_properties[] = { - { "UUID", "s", desc_get_uuid }, - { "Value", "ay", desc_get_value, desc_set_value, NULL }, + { "UUID", "s", desc_get_uuid }, + { "Characteristic", "o", desc_get_characteristic }, + { "Value", "ay", desc_get_value, desc_set_value, NULL }, + { "Flags", "as", desc_get_props, NULL, NULL }, { } }; @@ -147,13 +211,20 @@ static gboolean chr_get_uuid(const GDBusPropertyTable *property, return TRUE; } -static gboolean chr_get_value(const GDBusPropertyTable *property, +static gboolean chr_get_service(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) { struct characteristic *chr = user_data; - DBusMessageIter array; - printf("Characteristic(%s): Get(\"Value\")\n", chr->uuid); + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, + &chr->service); + + return TRUE; +} + +static bool chr_read(struct characteristic *chr, DBusMessageIter *iter) +{ + DBusMessageIter array; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING, &array); @@ -163,7 +234,17 @@ static gboolean chr_get_value(const GDBusPropertyTable *property, dbus_message_iter_close_container(iter, &array); - return TRUE; + return true; +} + +static gboolean chr_get_value(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + struct characteristic *chr = user_data; + + printf("Characteristic(%s): Get(\"Value\")\n", chr->uuid); + + return chr_read(chr, iter); } static gboolean chr_get_props(const GDBusPropertyTable *property, @@ -185,18 +266,27 @@ static gboolean chr_get_props(const GDBusPropertyTable *property, return TRUE; } +static void chr_write(struct characteristic *chr, const uint8_t *value, int len) +{ + g_free(chr->value); + chr->value = g_memdup(value, len); + chr->vlen = len; + + g_dbus_emit_property_changed(connection, chr->path, GATT_CHR_IFACE, + "Value"); +} + static void chr_set_value(const GDBusPropertyTable *property, DBusMessageIter *iter, GDBusPendingPropertySet id, void *user_data) { struct characteristic *chr = user_data; - DBusMessageIter array; - uint8_t *value; + const uint8_t *value; int len; printf("Characteristic(%s): Set('Value', ...)\n", chr->uuid); - if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) { + if (!parse_value(iter, &value, &len)) { printf("Invalid value for Set('Value'...)\n"); g_dbus_pending_property_error(id, ERROR_INTERFACE ".InvalidArguments", @@ -204,25 +294,31 @@ static void chr_set_value(const GDBusPropertyTable *property, return; } - dbus_message_iter_recurse(iter, &array); - dbus_message_iter_get_fixed_array(&array, &value, &len); - - g_free(chr->value); - chr->value = g_memdup(value, len); - chr->vlen = len; + chr_write(chr, value, len); g_dbus_pending_property_success(id); - g_dbus_emit_property_changed(connection, chr->path, - GATT_CHR_IFACE, "Value"); } static const GDBusPropertyTable chr_properties[] = { - { "UUID", "s", chr_get_uuid }, - { "Value", "ay", chr_get_value, chr_set_value, NULL }, - { "Flags", "as", chr_get_props, NULL, NULL }, + { "UUID", "s", chr_get_uuid }, + { "Service", "o", chr_get_service }, + { "Value", "ay", chr_get_value, chr_set_value, NULL }, + { "Flags", "as", chr_get_props, NULL, NULL }, { } }; +static gboolean service_get_primary(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *user_data) +{ + dbus_bool_t primary = TRUE; + + printf("Get Primary: %s\n", primary ? "True" : "False"); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &primary); + + return TRUE; +} + static gboolean service_get_uuid(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) { @@ -256,6 +352,7 @@ static gboolean service_exist_includes(const GDBusPropertyTable *property, } static const GDBusPropertyTable service_properties[] = { + { "Primary", "b", service_get_primary }, { "UUID", "s", service_get_uuid }, { "Includes", "ao", service_get_includes, NULL, service_exist_includes }, @@ -267,6 +364,7 @@ static void chr_iface_destroy(gpointer user_data) struct characteristic *chr = user_data; g_free(chr->uuid); + g_free(chr->service); g_free(chr->value); g_free(chr->path); g_free(chr); @@ -282,10 +380,187 @@ static void desc_iface_destroy(gpointer user_data) g_free(desc); } +static int parse_options(DBusMessageIter *iter, const char **device) +{ + DBusMessageIter dict; + + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) + return -EINVAL; + + dbus_message_iter_recurse(iter, &dict); + + while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) { + const char *key; + DBusMessageIter value, entry; + int var; + + dbus_message_iter_recurse(&dict, &entry); + dbus_message_iter_get_basic(&entry, &key); + + dbus_message_iter_next(&entry); + dbus_message_iter_recurse(&entry, &value); + + var = dbus_message_iter_get_arg_type(&value); + if (strcasecmp(key, "device") == 0) { + if (var != DBUS_TYPE_OBJECT_PATH) + return -EINVAL; + dbus_message_iter_get_basic(&value, device); + printf("Device: %s\n", *device); + } + + dbus_message_iter_next(&dict); + } + + return 0; +} + +static DBusMessage *chr_read_value(DBusConnection *conn, DBusMessage *msg, + void *user_data) +{ + struct characteristic *chr = user_data; + DBusMessage *reply; + DBusMessageIter iter; + const char *device; + + if (!dbus_message_iter_init(msg, &iter)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + if (parse_options(&iter, &device)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + reply = dbus_message_new_method_return(msg); + if (!reply) + return g_dbus_create_error(msg, DBUS_ERROR_NO_MEMORY, + "No Memory"); + + dbus_message_iter_init_append(reply, &iter); + + chr_read(chr, &iter); + + return reply; +} + +static DBusMessage *chr_write_value(DBusConnection *conn, DBusMessage *msg, + void *user_data) +{ + struct characteristic *chr = user_data; + DBusMessageIter iter; + const uint8_t *value; + int len; + const char *device; + + dbus_message_iter_init(msg, &iter); + + if (parse_value(&iter, &value, &len)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + if (parse_options(&iter, &device)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + chr_write(chr, value, len); + + return dbus_message_new_method_return(msg); +} + +static DBusMessage *chr_start_notify(DBusConnection *conn, DBusMessage *msg, + void *user_data) +{ + return g_dbus_create_error(msg, DBUS_ERROR_NOT_SUPPORTED, + "Not Supported"); +} + +static DBusMessage *chr_stop_notify(DBusConnection *conn, DBusMessage *msg, + void *user_data) +{ + return g_dbus_create_error(msg, DBUS_ERROR_NOT_SUPPORTED, + "Not Supported"); +} + +static const GDBusMethodTable chr_methods[] = { + { GDBUS_ASYNC_METHOD("ReadValue", GDBUS_ARGS({ "options", "a{sv}" }), + GDBUS_ARGS({ "value", "ay" }), + chr_read_value) }, + { GDBUS_ASYNC_METHOD("WriteValue", GDBUS_ARGS({ "value", "ay" }, + { "options", "a{sv}" }), + NULL, chr_write_value) }, + { GDBUS_ASYNC_METHOD("StartNotify", NULL, NULL, chr_start_notify) }, + { GDBUS_METHOD("StopNotify", NULL, NULL, chr_stop_notify) }, + { } +}; + +static DBusMessage *desc_read_value(DBusConnection *conn, DBusMessage *msg, + void *user_data) +{ + struct descriptor *desc = user_data; + DBusMessage *reply; + DBusMessageIter iter; + const char *device; + + if (!dbus_message_iter_init(msg, &iter)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + if (parse_options(&iter, &device)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + reply = dbus_message_new_method_return(msg); + if (!reply) + return g_dbus_create_error(msg, DBUS_ERROR_NO_MEMORY, + "No Memory"); + + dbus_message_iter_init_append(reply, &iter); + + desc_read(desc, &iter); + + return reply; +} + +static DBusMessage *desc_write_value(DBusConnection *conn, DBusMessage *msg, + void *user_data) +{ + struct descriptor *desc = user_data; + DBusMessageIter iter; + const char *device; + const uint8_t *value; + int len; + + if (!dbus_message_iter_init(msg, &iter)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + if (parse_value(&iter, &value, &len)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + if (parse_options(&iter, &device)) + return g_dbus_create_error(msg, DBUS_ERROR_INVALID_ARGS, + "Invalid arguments"); + + desc_write(desc, value, len); + + return dbus_message_new_method_return(msg); +} + +static const GDBusMethodTable desc_methods[] = { + { GDBUS_ASYNC_METHOD("ReadValue", GDBUS_ARGS({ "options", "a{sv}" }), + GDBUS_ARGS({ "value", "ay" }), + desc_read_value) }, + { GDBUS_ASYNC_METHOD("WriteValue", GDBUS_ARGS({ "value", "ay" }, + { "options", "a{sv}" }), + NULL, desc_write_value) }, + { } +}; + static gboolean register_characteristic(const char *chr_uuid, const uint8_t *value, int vlen, const char **props, const char *desc_uuid, + const char **desc_props, const char *service_path) { struct characteristic *chr; @@ -297,10 +572,11 @@ static gboolean register_characteristic(const char *chr_uuid, chr->value = g_memdup(value, vlen); chr->vlen = vlen; chr->props = props; + chr->service = g_strdup(service_path); chr->path = g_strdup_printf("%s/characteristic%d", service_path, id++); if (!g_dbus_register_interface(connection, chr->path, GATT_CHR_IFACE, - NULL, NULL, chr_properties, + chr_methods, NULL, chr_properties, chr, chr_iface_destroy)) { printf("Couldn't register characteristic interface\n"); chr_iface_destroy(chr); @@ -312,11 +588,13 @@ static gboolean register_characteristic(const char *chr_uuid, desc = g_new0(struct descriptor, 1); desc->uuid = g_strdup(desc_uuid); + desc->chr = chr; + desc->props = desc_props; desc->path = g_strdup_printf("%s/descriptor%d", chr->path, id++); if (!g_dbus_register_interface(connection, desc->path, GATT_DESCRIPTOR_IFACE, - NULL, NULL, desc_properties, + desc_methods, NULL, desc_properties, desc, desc_iface_destroy)) { printf("Couldn't register descriptor interface\n"); g_dbus_unregister_interface(connection, chr->path, @@ -360,6 +638,7 @@ static void create_services() &level, sizeof(level), ias_alert_level_props, READ_WRITE_DESCRIPTOR_UUID, + desc_props, service_path)) { printf("Couldn't register Alert Level characteristic (IAS)\n"); g_dbus_unregister_interface(connection, service_path, @@ -372,63 +651,55 @@ static void create_services() printf("Registered service: %s\n", service_path); } -static void register_external_service_reply(DBusPendingCall *call, - void *user_data) +static void register_app_reply(DBusMessage *reply, void *user_data) { - DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusError derr; dbus_error_init(&derr); dbus_set_error_from_message(&derr, reply); if (dbus_error_is_set(&derr)) - printf("RegisterService: %s\n", derr.message); + printf("RegisterApplication: %s\n", derr.message); else - printf("RegisterService: OK\n"); + printf("RegisterApplication: OK\n"); - dbus_message_unref(reply); dbus_error_free(&derr); } -static void register_external_service(gpointer a, gpointer b) +static void register_app_setup(DBusMessageIter *iter, void *user_data) { - DBusConnection *conn = b; - const char *path = a; - DBusMessage *msg; - DBusPendingCall *call; - DBusMessageIter iter, dict; + const char *path = "/"; + DBusMessageIter dict; - msg = dbus_message_new_method_call("org.bluez", "/org/bluez", - GATT_MGR_IFACE, "RegisterService"); - if (!msg) { - printf("Couldn't allocate D-Bus message\n"); - return; - } - - dbus_message_iter_init_append(msg, &iter); + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path); - dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH, &path); - - dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &dict); + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "{sv}", &dict); /* TODO: Add options dictionary */ - dbus_message_iter_close_container(&iter, &dict); + dbus_message_iter_close_container(iter, &dict); +} - if (!g_dbus_send_message_with_reply(conn, msg, &call, -1)) { - dbus_message_unref(msg); +static void register_app(GDBusProxy *proxy) +{ + if (!g_dbus_proxy_method_call(proxy, "RegisterApplication", + register_app_setup, register_app_reply, + NULL, NULL)) { + printf("Unable to call RegisterApplication\n"); return; } - - dbus_pending_call_set_notify(call, register_external_service_reply, - NULL, NULL); - - dbus_pending_call_unref(call); } -static void connect_handler(DBusConnection *conn, void *user_data) +static void proxy_added_cb(GDBusProxy *proxy, void *user_data) { - g_slist_foreach(services, register_external_service, conn); + const char *iface; + + iface = g_dbus_proxy_get_interface(proxy); + + if (g_strcmp0(iface, GATT_MGR_IFACE)) + return; + + register_app(proxy); } static gboolean signal_handler(GIOChannel *channel, GIOCondition cond, @@ -520,9 +791,10 @@ int main(int argc, char *argv[]) create_services(); - client = g_dbus_client_new(connection, "org.bluez", "/org/bluez"); + client = g_dbus_client_new(connection, "org.bluez", "/"); - g_dbus_client_set_connect_watch(client, connect_handler, NULL); + g_dbus_client_set_proxy_handlers(client, proxy_added_cb, NULL, NULL, + NULL); g_main_loop_run(main_loop); diff --git a/tools/hci-tester.c b/tools/hci-tester.c old mode 100644 new mode 100755 diff --git a/tools/hciattach.1 b/tools/hciattach.1 old mode 100644 new mode 100755 diff --git a/tools/hciattach.c b/tools/hciattach.c old mode 100644 new mode 100755 index 0aa4e3b..fad176c --- a/tools/hciattach.c +++ b/tools/hciattach.c @@ -27,9 +27,6 @@ #include #endif -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY -#define _GNU_SOURCE -#endif #include #include #include @@ -49,8 +46,9 @@ #include "lib/hci.h" #include "lib/hci_lib.h" +#include "src/shared/tty.h" + #include "hciattach.h" -#include "../profile.h" struct uart_t { char *type; @@ -64,26 +62,8 @@ struct uart_t { char *bdaddr; int (*init) (int fd, struct uart_t *u, struct termios *ti); int (*post) (int fd, struct uart_t *u, struct termios *ti); - -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined __TI_PATCH__ - uint16_t device_param; -#endif }; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined __TI_PATCH__ - int firmware_path = 0; -#endif - -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#if defined(__TI_PATCH__) || 1 -#define TIOSETBRFPOWER 0x6000 -#define BRF_DEEP_SLEEP_OPCODE_BYTE_1 0x0c -#define BRF_DEEP_SLEEP_OPCODE_BYTE_2 0xfd -#define BRF_DEEP_SLEEP_OPCODE \ - (BRF_DEEP_SLEEP_OPCODE_BYTE_1 | (BRF_DEEP_SLEEP_OPCODE_BYTE_2 << 8)) -#endif -#endif #define FLOW_CTL 0x0001 #define AMP_DEV 0x0002 #define ENABLE_PM 1 @@ -106,68 +86,12 @@ static void sig_alarm(int sig) exit(1); } -int uart_speed(int s) -{ - switch (s) { - case 9600: - return B9600; - case 19200: - return B19200; - case 38400: - return B38400; - case 57600: - return B57600; - case 115200: - return B115200; - case 230400: - return B230400; - case 460800: - return B460800; - case 500000: - return B500000; - case 576000: - return B576000; - case 921600: - return B921600; - case 1000000: - return B1000000; - case 1152000: - return B1152000; - case 1500000: - return B1500000; - case 2000000: - return B2000000; -#ifdef B2500000 - case 2500000: - return B2500000; -#endif -#ifdef B3000000 - case 3000000: - return B3000000; -#endif -#ifdef B3500000 - case 3500000: - return B3500000; -#endif -#ifdef B3710000 - case 3710000: - return B3710000; -#endif -#ifdef B4000000 - case 4000000: - return B4000000; -#endif - default: - return B57600; - } -} - int set_speed(int fd, struct termios *ti, int speed) { - if (cfsetospeed(ti, uart_speed(speed)) < 0) + if (cfsetospeed(ti, tty_get_speed(speed)) < 0) return -errno; - if (cfsetispeed(ti, uart_speed(speed)) < 0) + if (cfsetispeed(ti, tty_get_speed(speed)) < 0) return -errno; if (tcsetattr(fd, TCSANOW, ti) < 0) @@ -668,7 +592,7 @@ static int csr(int fd, struct uart_t *u, struct termios *ti) fprintf(stderr, "Speed %d too high. Remaining at %d baud\n", u->speed, u->init_speed); u->speed = u->init_speed; - } else if (u->speed != 57600 && uart_speed(u->speed) == B57600) { + } else if (!tty_get_speed(u->speed)) { /* Unknown speed. Why oh why can't we just pass an int to the kernel? */ fprintf(stderr, "Speed %d unrecognised. Remaining at %d baud\n", u->speed, u->init_speed); @@ -1022,78 +946,40 @@ static int bcm2035(int fd, struct uart_t *u, struct termios *ti) /* Set the baud rate */ memset(cmd, 0, sizeof(cmd)); memset(resp, 0, sizeof(resp)); - -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) - if (TIZEN_FEATURE_BLUEZ_BRCM_CHIP) { - cmd[0] = HCI_COMMAND_PKT; - cmd[1] = 0x18; - cmd[2] = 0xfc; - cmd[3] = 0x02; - switch (u->speed) { - case 57600: - cmd[4] = 0x00; - cmd[5] = 0xe6; - break; - case 230400: - cmd[4] = 0x22; - cmd[5] = 0xfa; - break; - case 460800: - cmd[4] = 0x22; - cmd[5] = 0xfd; - break; - case 921600: - cmd[4] = 0x55; - cmd[5] = 0xff; - break; - default: - /* Default is 115200 */ - cmd[4] = 0x00; - cmd[5] = 0xf3; - break; - } - fprintf(stderr, "Baud rate parameters: DHBR=0x%2x,DLBR=0x%2x\n", - cmd[4], cmd[5]); - - /* Send command */ - if (write(fd, cmd, 6) != 6) { - fprintf(stderr, "Failed to write \"set baud rate\" command\n"); - return -1; - } - } else -#endif - { - cmd[0] = HCI_COMMAND_PKT; - cmd[1] = 0x18; - cmd[2] = 0xfc; - - switch (u->speed) { - case 57600: - case 230400: - case 460800: - case 921600: - case 3000000: - break; - default: - break; - } - - cmd[3] = 0x06; + cmd[0] = HCI_COMMAND_PKT; + cmd[1] = 0x18; + cmd[2] = 0xfc; + cmd[3] = 0x02; + switch (u->speed) { + case 57600: cmd[4] = 0x00; - cmd[5] = 0x00; - cmd[6] = u->speed & 0xFF; - cmd[7] = (u->speed >> 8) & 0xFF; - cmd[8] = (u->speed >> 16) & 0xFF; - cmd[9] = (u->speed >> 24) & 0xFF; - - fprintf(stderr, "Set the baud rate %d : 0x%02x,0x%02x,0x%02x,0x%02x\n",u->speed,cmd[6],cmd[7],cmd[8],cmd[9] ); + cmd[5] = 0xe6; + break; + case 230400: + cmd[4] = 0x22; + cmd[5] = 0xfa; + break; + case 460800: + cmd[4] = 0x22; + cmd[5] = 0xfd; + break; + case 921600: + cmd[4] = 0x55; + cmd[5] = 0xff; + break; + default: + /* Default is 115200 */ + cmd[4] = 0x00; + cmd[5] = 0xf3; + break; + } + fprintf(stderr, "Baud rate parameters: DHBR=0x%2x,DLBR=0x%2x\n", + cmd[4], cmd[5]); - /* Send command */ - if (write(fd, cmd, 10) != 10) { - fprintf(stderr, "Failed to write \"set baud rate\" command\n"); - return -1; - } + /* Send command */ + if (write(fd, cmd, 6) != 6) { + fprintf(stderr, "Failed to write \"set baud rate\" command\n"); + return -1; } if ((n = read_hci_event(fd, resp, 6)) < 0) { @@ -1104,21 +990,10 @@ static int bcm2035(int fd, struct uart_t *u, struct termios *ti) return 0; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY /*SPRD add Start*/ -static int init_sprd_config(int fd, struct uart_t *u, struct termios *ti) -{ - - return sprd_config_init(fd, u->bdaddr, ti); -} -#endif - struct uart_t uart[] = { { "any", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, DISABLE_PM, NULL, NULL }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY /*SPRD*/ - { "sprd", 0x0000, 0x0000, HCI_UART_H4, 3000000, 3000000, - FLOW_CTL, DISABLE_PM, NULL, init_sprd_config }, -#endif + { "ericsson", 0x0000, 0x0000, HCI_UART_H4, 57600, 115200, FLOW_CTL, DISABLE_PM, NULL, ericsson }, @@ -1144,18 +1019,12 @@ struct uart_t uart[] = { { "swave", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, DISABLE_PM, NULL, swave }, -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined TIZEN_FEATURE_BLUEZ_MODIFY && defined __TI_PATCH__ - /* Texas Instruments BRF63xx modules */ - { "texas", 0x0000, 0x0000, HCI_UART_LL, 115200,3000000, FLOW_CTL, NULL, texas, NULL/*texas_continue_script*/, BRF_DEEP_SLEEP_OPCODE}, -#else /* Texas Instruments Bluelink (BRF) modules */ { "texas", 0x0000, 0x0000, HCI_UART_LL, 115200, 115200, FLOW_CTL, DISABLE_PM, NULL, texas, texas2 }, { "texasalt", 0x0000, 0x0000, HCI_UART_LL, 115200, 115200, FLOW_CTL, DISABLE_PM, NULL, texasalt, NULL }, -#endif /* ST Microelectronics minikits based on STLC2410/STLC2415 */ { "st", 0x0000, 0x0000, HCI_UART_H4, 57600, 115200, @@ -1263,46 +1132,6 @@ static struct uart_t * get_by_type(char *type) return NULL; } -#if defined TIZEN_FEATURE_BLUEZ_MODIFY -static int enable_hci(char *dev, struct uart_t *u) -{ - int fd, i; - unsigned long flags = 0; - - fd = open(dev, O_RDWR | O_NOCTTY); - if (fd < 0) { - fprintf(stderr, "Can't open serial port"); - return -1; - } - - tcflush(fd, TCIOFLUSH); - - /* Set TTY to N_HCI line discipline */ - i = N_HCI; - if (ioctl(fd, TIOCSETD, &i) < 0) { - fprintf(stderr, "Can't set line discipline"); - close(fd); - return -1; - } - - if (flags && ioctl(fd, HCIUARTSETFLAGS, flags) < 0) { - fprintf(stderr, "Can't set UART flags"); - close(fd); - return -1; - } - - tcflush(fd, TCIOFLUSH); - - if (ioctl(fd, HCIUARTSETPROTO, u->proto) < 0) { - fprintf(stderr, "Can't set device"); - close(fd); - return -1; - } - - return fd; -} -#endif /* TIZEN_FEATURE_BLUEZ_MODIFY */ - /* Initialize UART driver */ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) { @@ -1310,13 +1139,6 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) int fd, i; unsigned long flags = 0; -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#if defined(__TI_PATCH__) || 1 - int power; -#endif -#endif - if (raw) flags |= 1 << HCI_UART_RAW_DEVICE; @@ -1338,16 +1160,11 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) cfmakeraw(&ti); -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) - if (!TIZEN_FEATURE_BLUEZ_BRCM_CHIP) { - ti.c_cflag |= CLOCAL; - if (u->flags & FLOW_CTL) - ti.c_cflag |= CRTSCTS; - else - ti.c_cflag &= ~CRTSCTS; - } -#endif + ti.c_cflag |= CLOCAL; + if (u->flags & FLOW_CTL) + ti.c_cflag |= CRTSCTS; + else + ti.c_cflag &= ~CRTSCTS; if (tcsetattr(fd, TCSANOW, &ti) < 0) { perror("Can't set port settings"); @@ -1367,24 +1184,6 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) usleep(500000); } -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#if defined(__TI_PATCH__) - /* Power up the BRF chip */ - power = 1; - ioctl(fd, TIOSETBRFPOWER, &power); -#else - if (TIZEN_FEATURE_BLUEZ_BRCM_CHIP) { - /* Power up the BRF chip */ - power = 1; - ioctl(fd, TIOSETBRFPOWER, &power); - } -#endif -#ifdef __TI_PATCH__ - usleep(500000); -#endif -#endif - if (u->init && u->init(fd, u, &ti) < 0) goto fail; @@ -1413,10 +1212,8 @@ static int init_uart(char *dev, struct uart_t *u, int send_break, int raw) goto fail; } -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (u->post && u->post(fd, u, &ti) < 0) goto fail; -#endif return fd; @@ -1429,69 +1226,33 @@ static void usage(void) { printf("hciattach - HCI UART driver initialization utility\n"); printf("Usage:\n"); - -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && !defined(__TI_PATCH__) -/* This commented code was present before bluez 5.25 upgrade - * printf("\thciattach [-n] [-p] [-b] [-g device_param] [-r] [-f] [-t timeout] [-s initial_speed] [speed] [flow|noflow] [bdaddr]\n");*/ - printf("\thciattach [-n] [-p] [-b] [-g device_param] [-r] [-f]" - " [-t timeout] [-s initial_speed]" - " [speed] [flow|noflow]" - " [sleep|nosleep] [bdaddr]\n"); -#else printf("\thciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed]" " [speed] [flow|noflow]" " [sleep|nosleep] [bdaddr]\n"); -#endif printf("\thciattach -l\n"); } int main(int argc, char *argv[]) { struct uart_t *u = NULL; -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) int detach, printpid, raw, opt, i, n, ld, err; -#else - int detach, printpid, opt, i, n, ld, err; -#endif int to = 10; int init_speed = 0; -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) int send_break = 0; -#endif pid_t pid; struct sigaction sa; struct pollfd p; sigset_t sigs; char dev[PATH_MAX]; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#if defined(__TI_PATCH__) || 1 -/* TIZEN_FEATURE_BLUEZ_MODIFY */ - int power; -#endif -#endif -#ifdef __TI_PATCH__ - uint16_t device_param = 0; - int reset_device = 0; - int bt_fd; -#endif detach = 1; printpid = 0; -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) raw = 0; -#endif -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && !defined(__TI_PATCH__) - while ((opt=getopt(argc, argv, "bnprft:g:s:l")) != EOF) { -#else + while ((opt=getopt(argc, argv, "bnpt:s:lr")) != EOF) { -#endif switch(opt) { case 'b': -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) - if (!TIZEN_FEATURE_BLUEZ_BRCM_CHIP) - send_break = 1; -#endif + send_break = 1; break; case 'n': @@ -1506,20 +1267,6 @@ int main(int argc, char *argv[]) to = atoi(optarg); break; -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(__TI_PATCH__) - case 'g': - device_param = (uint16_t)strtol(optarg, NULL, 16); - break; - - case 'r': - reset_device = 1; - break; - - case 'f': - firmware_path = 1; - break; -#endif case 's': init_speed = atoi(optarg); break; @@ -1532,10 +1279,7 @@ int main(int argc, char *argv[]) exit(0); case 'r': -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) - if (!TIZEN_FEATURE_BLUEZ_BRCM_CHIP) - raw = 1; -#endif + raw = 1; break; default: @@ -1545,10 +1289,6 @@ int main(int argc, char *argv[]) } n = argc - optind; -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(__TI_PATCH__) - if (!reset_device || (reset_device && n < 1)) -#endif if (n < 2) { usage(); exit(1); @@ -1612,42 +1352,16 @@ int main(int argc, char *argv[]) break; } } -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(__TI_PATCH__) - if (reset_device) - { - // Reset row device - bt_fd = open(dev, O_RDWR | O_NOCTTY); - if (bt_fd< 0) { - perror("Can't open serial port"); - return -1; - } - /* Power up the BRF chip */ - power = 0; - ioctl(bt_fd, TIOSETBRFPOWER, &power); - return 0; - } -#endif if (!u) { fprintf(stderr, "Unknown device type or id\n"); exit(1); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -// __hci_attach_log_init(); -#endif - /* If user specified a initial speed, use that instead of the hardware's default */ if (init_speed) u->init_speed = init_speed; -#if defined(TIZEN_FEATURE_BLUEZ_MODIFY) && defined(__TI_PATCH__) - /* If user specified a device parameter, use that instead of - the hardware's default */ - if (device_param) - u->device_param = device_param; -#endif memset(&sa, 0, sizeof(sa)); sa.sa_flags = SA_NOCLDSTOP; @@ -1657,14 +1371,8 @@ int main(int argc, char *argv[]) /* 10 seconds should be enough for initialization */ alarm(to); bcsp_max_retries = to; -#if defined TIZEN_FEATURE_BLUEZ_MODIFY - if (TIZEN_FEATURE_BLUEZ_BRCM_CHIP) - n = enable_hci(dev, u); - else - n = init_uart(dev, u, send_break, raw); -#else + n = init_uart(dev, u, send_break, raw); -#endif if (n < 0) { perror("Can't initialize device"); exit(1); @@ -1725,19 +1433,5 @@ int main(int argc, char *argv[]) exit(1); } -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#if defined(__TI_PATCH__) - /* Power down the BRF or BCMchip */ - power = 0; - ioctl(n, TIOSETBRFPOWER, &power); -#else - if (TIZEN_FEATURE_BLUEZ_BRCM_CHIP) { - /* Power down the BRF or BCMchip */ - power = 0; - ioctl(n, TIOSETBRFPOWER, &power); - } -#endif -#endif return 0; } diff --git a/tools/hciattach.h b/tools/hciattach.h old mode 100644 new mode 100755 index 7164e0d..249aab4 --- a/tools/hciattach.h +++ b/tools/hciattach.h @@ -42,6 +42,9 @@ #define HCI_UART_INTEL 6 #define HCI_UART_BCM 7 #define HCI_UART_QCA 8 +#define HCI_UART_AG6XX 9 +#define HCI_UART_NOKIA 10 +#define HCI_UART_MRVL 11 #define HCI_UART_RAW_DEVICE 0 #define HCI_UART_RESET_ON_INIT 1 @@ -61,9 +64,6 @@ int stlc2500_init(int fd, bdaddr_t *bdaddr); int bgb2xx_init(int dd, bdaddr_t *bdaddr); int ath3k_init(int fd, int speed, int init_speed, char *bdaddr, struct termios *ti); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -int sprd_config_init(int fd, char *bdaddr, struct termios *ti); -#endif int ath3k_post(int fd, int pm); int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr); int intel_init(int fd, int init_speed, int *speed, struct termios *ti); diff --git a/tools/hciattach_ath3k.c b/tools/hciattach_ath3k.c old mode 100644 new mode 100755 diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c old mode 100644 new mode 100755 index af03538..81f38cb --- a/tools/hciattach_bcm43xx.c +++ b/tools/hciattach_bcm43xx.c @@ -43,12 +43,8 @@ #include "hciattach.h" #ifndef FIRMWARE_DIR -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define FIRMWARE_DIR "/usr/etc/bluetooth" -#else #define FIRMWARE_DIR "/etc/firmware" #endif -#endif #define FW_EXT ".hcd" diff --git a/tools/hciattach_intel.c b/tools/hciattach_intel.c old mode 100644 new mode 100755 diff --git a/tools/hciattach_qualcomm.c b/tools/hciattach_qualcomm.c old mode 100644 new mode 100755 diff --git a/tools/hciattach_sprd.c b/tools/hciattach_sprd.c deleted file mode 100644 index 6fd2954..0000000 --- a/tools/hciattach_sprd.c +++ /dev/null @@ -1,592 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include "hciattach.h" -#include - -#include "hciattach_sprd.h" - -//#include -//#define DBG -#ifdef DBG -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "pskey_bt", __VA_ARGS__) -#else -#define LOGD(fmt, arg...) fprintf(stderr, "%s:%d()" fmt "\n", __FILE__,__LINE__, ## arg) -#endif -typedef unsigned char UINT8; - -#define UINT32_TO_STREAM(p, u32) {*(p)++ = (UINT8)(u32); *(p)++ = (UINT8)((u32) >> 8); *(p)++ = (UINT8)((u32) >> 16); *(p)++ = (UINT8)((u32) >> 24);} -#define UINT24_TO_STREAM(p, u24) {*(p)++ = (UINT8)(u24); *(p)++ = (UINT8)((u24) >> 8); *(p)++ = (UINT8)((u24) >> 16);} -#define UINT16_TO_STREAM(p, u16) {*(p)++ = (UINT8)(u16); *(p)++ = (UINT8)((u16) >> 8);} -#define UINT8_TO_STREAM(p, u8) {*(p)++ = (UINT8)(u8);} -#define INT8_TO_STREAM(p, u8) {*(p)++ = (INT8)(u8);} - -#define PSKEY_PRELOAD_SIZE 0x04 -#define PSKEY_PREAMBLE_SIZE 0xA2 - - // for bt mac addr -#define BT_MAC_FILE_PATH "/csa/bluetooth/" -#define DATMISC_MAC_ADDR_PATH BT_MAC_FILE_PATH".bd_addr" -#define MAC_ADDR_BUF_LEN (strlen("FF:FF:FF:FF:FF:FF")) -#define MAC_ADDR_FILE_LEN 25 -#define MAC_ADDR_LEN 6 - -#define BD_ADDR_LEN 14 -#define BD_PREFIX "0002\n" - -#if 0 -#ifndef VENDOR_BTWRITE_PROC_NODE -#define VENDOR_BTWRITE_PROC_NODE "/proc/bluetooth/sleep/btwrite" -#endif -#endif - -#define MAX_BT_TMP_PSKEY_FILE_LEN 2048 - -typedef unsigned int UWORD32; -typedef unsigned short UWORD16; -typedef unsigned char UWORD8; - -#define down_bt_is_space(c) (((c) == '\n') || ((c) == ',') || ((c) == '\r') || ((c) == ' ') || ((c) == '{') || ((c) == '}')) -#define down_bt_is_comma(c) (((c) == ',')) -#define down_bt_is_endc(c) (((c) == '}')) // indicate end of data - -/* Macros to swap byte order */ -#define SWAP_BYTE_ORDER_WORD(val) ((((val) & 0x000000FF) << 24) + \ - (((val) & 0x0000FF00) << 8) + \ - (((val) & 0x00FF0000) >> 8) + \ - (((val) & 0xFF000000) >> 24)) -#define INLINE static __inline - -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN -#endif - - -// pskey file structure default value -static BT_PSKEY_CONFIG_T bt_para_setting={ - .pskey_cmd = 0x001C0101, - - .g_dbg_source_sink_syn_test_data = 0, - .g_sys_sleep_in_standby_supported = 0, - .g_sys_sleep_master_supported = 0, - .g_sys_sleep_slave_supported = 0, - - .default_ahb_clk = 26000000, - .device_class = 0x001F00, - .win_ext = 30, - - .g_aGainValue = {0x0000F600, 0x0000D000, 0x0000AA00, 0x00008400, 0x00004400, 0x00000A00}, - .g_aPowerValue = {0x0FC80000, 0x0FF80000, 0x0FDA0000, 0x0FCC0000, 0x0FFC0000}, - - .feature_set = {0xFF, 0xFF, 0x8D, 0xFE, 0x9B, 0x7F, 0x79, 0x83, 0xFF, 0xA7, 0xFF, 0x7F, 0x00, 0xE0, 0xF7, 0x3E}, - .device_addr = {0x6A, 0x6B, 0x8C, 0x8A, 0x8B, 0x8C}, - - .g_sys_sco_transmit_mode = 0, //true tramsmit by uart, otherwise by share memory - .g_sys_uart0_communication_supported = 1, //true use uart0, otherwise use uart1 for debug - .edr_tx_edr_delay = 5, - .edr_rx_edr_delay = 14, - - .g_wbs_nv_117 = 0x0031, - - .is_wdg_supported = 0, - - .share_memo_rx_base_addr = 0, - //.share_memo_tx_base_addr = 0, - .g_wbs_nv_118 = 0x0066, - .g_nbv_nv_117 = 0x1063, - - .share_memo_tx_packet_num_addr = 0, - .share_memo_tx_data_base_addr = 0, - - .g_PrintLevel = 0xFFFFFFFF, - - .share_memo_tx_block_length = 0, - .share_memo_rx_block_length = 0, - .share_memo_tx_water_mark = 0, - //.share_memo_tx_timeout_value = 0, - .g_nbv_nv_118 = 0x0E45, - - .uart_rx_watermark = 48, - .uart_flow_control_thld = 63, - .comp_id = 0, - .pcm_clk_divd = 0x26, - - - .reserved = {0} -}; - -extern int getPskeyFromFile(void *pData); -extern int bt_getPskeyFromFile(void *pData); - -static int create_mac_folder(void) -{ - DIR *dp; - int err; - - dp = opendir(BT_MAC_FILE_PATH); - if (dp == NULL) { - if (mkdir(BT_MAC_FILE_PATH, 0755) < 0) { - err = -errno; - LOGD("%s: mkdir: %s(%d)",__FUNCTION__, strerror(-err), -err); - } - return -1; - } - - closedir(dp); - return 0; -} - -static void mac_rand(char *btmac) -{ - int ran; - int i; - unsigned int seed; - struct timeval tv; - - memcpy(btmac, BD_PREFIX, 5); - i = gettimeofday(&tv, NULL); - - if (i < 0) { - LOGD("Fail to call gettimeofday()"); - seed = time(NULL); - } else - seed = (unsigned int)tv.tv_usec; - - for (i = 5; i < BD_ADDR_LEN; i++) { - if (i == 7) { - btmac[i] = '\n'; - continue; - } - ran = rand_r(&seed) % 16; - if (ran < 10) - ran += 0x30; - else - ran += 0x57; - btmac[i] = ran; - } - LOGD("Random number is\r\n"); - for (i = 0; i < BD_ADDR_LEN; i++) { - LOGD("%c", btmac[i]); - } - LOGD("\r\n"); -} - -static void write_btmac2file(char *btmac) -{ - int fd; - int ret; - fd = open(DATMISC_MAC_ADDR_PATH, O_CREAT|O_RDWR|O_TRUNC, S_IRUSR|S_IWUSR); - LOGD("write_btmac2file open file, fd=%d", fd); - if(fd >= 0) { - if(chmod(DATMISC_MAC_ADDR_PATH,0666) != -1){ - ret = write(fd, btmac, strlen(btmac)); - if (ret < strlen(btmac)) { - LOGD("Fail to write %s", DATMISC_MAC_ADDR_PATH); - close(fd); - return; - } - } - close(fd); - }else{ - LOGD("write bt mac to file failed!!"); - } -} - -uint8 ConvertHexToBin( - uint8 *hex_ptr, // in: the hexadecimal format string - uint16 length, // in: the length of hexadecimal string - uint8 *bin_ptr // out: pointer to the binary format string - ){ - uint8 *dest_ptr = bin_ptr; - uint32 i = 0; - uint8 ch; - - for(i=0; i= '0' && ch <= '9') - *dest_ptr =(uint8)((ch - '0') << 4); - // a - f - else if (ch >= 'a' && ch <= 'f') - *dest_ptr = (uint8)((ch - 'a' + 10) << 4); - // A - F - else if (ch >= 'A' && ch <= 'F') - *dest_ptr = (uint8)((ch -'A' + 10) << 4); - else{ - return 0; - } - - // the bit 1,2,3,4 - ch = hex_ptr[i+1]; - // digtial 0 - 9 - if (ch >= '0' && ch <= '9') - *dest_ptr |= (uint8)(ch - '0'); - // a - f - else if (ch >= 'a' && ch <= 'f') - *dest_ptr |= (uint8)(ch - 'a' + 10); - // A - F - else if (ch >= 'A' && ch <= 'F') - *dest_ptr |= (uint8)(ch -'A' + 10); - else{ - return 0; - } - - dest_ptr++; - } - - return 1; -} - -static int read_mac_address(char *file_name, uint8 *addr) { - char buf[MAC_ADDR_FILE_LEN] = {0}; - uint32 addr_t[MAC_ADDR_LEN] = {0}; - int i = 0; - - -#if 1 - int fd = open(file_name, O_RDONLY, 0666); - LOGD("%s read file: %s", __func__, file_name); - if (fd < 0) { - LOGD("%s open %s error reason: %s", __func__, file_name, strerror(errno)); - return -1; - } - if (read(fd, buf, BD_ADDR_LEN) < 0) { - LOGD("%s read %s error reason: %s", __func__, file_name, strerror(errno)); - goto done; - } - if (sscanf(buf, "%02X%02X\n%02X\n%02X%02X%02X", &addr_t[0], &addr_t[1], &addr_t[2], &addr_t[3], &addr_t[4], &addr_t[5]) < 0) { - LOGD("%s sscanf %s error reason: %s", __func__, file_name, strerror(errno)); - goto done; - } - - for (i = 0; i < MAC_ADDR_LEN; i++) { - addr[i] = addr_t[i] & 0xFF; - } - LOGD("%s %s addr: [%02X:%02X:%02X:%02X:%02X:%02X]", __func__, file_name, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); - -done: - close(fd); -#endif - return 0; -} - -static void mac_address_stream_compose(uint8 *addr) { - uint8 tmp, i, j; - for (i = 0, j = MAC_ADDR_LEN - 1; (i < MAC_ADDR_LEN / 2) && (i != j); i++, j--) { - tmp = addr[i]; - addr[i] = addr[j]; - addr[j] = tmp; - } -} - -#if 0 -/* - * random bluetooth mac address - */ -static void random_mac_addr(uint8 *addr) { - int fd, randseed, ret, mac_rd; - uint8 addr_t[MAC_ADDR_LEN] = {0}; - - LOGD("%s", __func__); - /* urandom seed build */ - fd = open("/dev/urandom", O_RDONLY); - if (fd < 0){ - LOGD("%s: open urandom fail", __func__); - } else { - ret = read(fd, &randseed, sizeof(randseed)); - LOGD("%s urandom:0x%08X", __func__, randseed); - close(fd); - } - - /* time seed build */ - if (fd < 0 || ret < 0) { - struct timeval tt; - if (gettimeofday(&tt, (struct timezone *)0) > 0) { - randseed = (unsigned int) tt.tv_usec; - } else { - randseed = (unsigned int) time(NULL); - } - LOGD("urandom fail, using system time for randseed"); - } - - LOGD("%s: randseed = %u",__func__, randseed); - srand(randseed); - mac_rd = rand(); - - addr_t[0] = 0x40; /* FOR */ - addr_t[1] = 0x45; /* SPRD */ - addr_t[2] = 0xDA; /* ADDR */ - addr_t[3] = (uint8)(mac_rd & 0xFF); - addr_t[4] = (uint8)((mac_rd >> 8) & 0xFF); - addr_t[5] = (uint8)((mac_rd >> 16) & 0xFF); - - memcpy(addr, addr_t, MAC_ADDR_LEN); - LOGD("%s: MAC ADDR: [%02X:%02X:%02X:%02X:%02X:%02X]",__func__, addr_t[0], addr_t[1], addr_t[2], addr_t[3], addr_t[4], addr_t[5]); -} -#endif -static void get_mac_address(uint8 *addr){ - int ret = -1; - uint8 addr_t[6] = {0}; - char bt_mac[BD_ADDR_LEN] = {0, }; - - LOGD("%s", __func__); - /* check misc mac file exist */ - ret = access(DATMISC_MAC_ADDR_PATH, F_OK); - if (ret != 0) { - LOGD("%s %s miss", __func__, DATMISC_MAC_ADDR_PATH); - - /* Try to make bt address file */ - create_mac_folder(); - - mac_rand(bt_mac); - LOGD("bt random mac=%s",bt_mac); - write_btmac2file(bt_mac); - - } - - /* read mac file */ - read_mac_address(DATMISC_MAC_ADDR_PATH, addr_t); - - /* compose mac stream */ - mac_address_stream_compose(addr_t); - - memcpy(addr, addr_t, MAC_ADDR_LEN); - -} - - -/* - * hci command preload stream, special order - */ -static void pskey_stream_compose(uint8 * buf, BT_PSKEY_CONFIG_T *bt_par) { - int i = 0; - uint8 *p = buf; - - LOGD("%s", __func__); - - UINT24_TO_STREAM(p, bt_par->pskey_cmd); - UINT8_TO_STREAM(p, (uint8)(PSKEY_PREAMBLE_SIZE & 0xFF)); - - UINT8_TO_STREAM(p, bt_par->g_dbg_source_sink_syn_test_data); - UINT8_TO_STREAM(p, bt_par->g_sys_sleep_in_standby_supported); - UINT8_TO_STREAM(p, bt_par->g_sys_sleep_master_supported); - UINT8_TO_STREAM(p, bt_par->g_sys_sleep_slave_supported); - - UINT32_TO_STREAM(p, bt_par->default_ahb_clk); - UINT32_TO_STREAM(p, bt_par->device_class); - UINT32_TO_STREAM(p, bt_par->win_ext); - - for (i = 0; i < 6; i++) { - UINT32_TO_STREAM(p, bt_par->g_aGainValue[i]); - } - for (i = 0; i < 5; i++) { - UINT32_TO_STREAM(p, bt_par->g_aPowerValue[i]); - } - - for (i = 0; i < 16; i++) { - UINT8_TO_STREAM(p, bt_par->feature_set[i]); - } - for (i = 0; i < 6; i++) { - UINT8_TO_STREAM(p, bt_par->device_addr[i]); - } - - UINT8_TO_STREAM(p, bt_par->g_sys_sco_transmit_mode); - UINT8_TO_STREAM(p, bt_par->g_sys_uart0_communication_supported); - UINT8_TO_STREAM(p, bt_par->edr_tx_edr_delay); - UINT8_TO_STREAM(p, bt_par->edr_rx_edr_delay); - - UINT16_TO_STREAM(p, bt_par->g_wbs_nv_117); - - UINT32_TO_STREAM(p, bt_par->is_wdg_supported); - - UINT32_TO_STREAM(p, bt_par->share_memo_rx_base_addr); - //UINT32_TO_STREAM(p, bt_par->share_memo_tx_base_addr); - UINT16_TO_STREAM(p, bt_par->g_wbs_nv_118); - UINT16_TO_STREAM(p, bt_par->g_nbv_nv_117); - - UINT32_TO_STREAM(p, bt_par->share_memo_tx_packet_num_addr); - UINT32_TO_STREAM(p, bt_par->share_memo_tx_data_base_addr); - - UINT32_TO_STREAM(p, bt_par->g_PrintLevel); - - UINT16_TO_STREAM(p, bt_par->share_memo_tx_block_length); - UINT16_TO_STREAM(p, bt_par->share_memo_rx_block_length); - UINT16_TO_STREAM(p, bt_par->share_memo_tx_water_mark); - //UINT16_TO_STREAM(p, bt_par->share_memo_tx_timeout_value); - UINT16_TO_STREAM(p, bt_par->g_nbv_nv_118); - - UINT16_TO_STREAM(p, bt_par->uart_rx_watermark); - UINT16_TO_STREAM(p, bt_par->uart_flow_control_thld); - UINT32_TO_STREAM(p, bt_par->comp_id); - UINT16_TO_STREAM(p, bt_par->pcm_clk_divd); - - - for (i = 0; i < 8; i++) { - UINT32_TO_STREAM(p, bt_par->reserved[i]); - } -} - -void sprd_get_pskey(BT_PSKEY_CONFIG_T * pskey_t) { - BT_PSKEY_CONFIG_T pskey; - uint8 buf[180] = {0}; - - LOGD("%s", __func__); - memset(&pskey, 0 , sizeof(BT_PSKEY_CONFIG_T)); - if (bt_getPskeyFromFile(&pskey) < 0 ) { - LOGD("%s bt_getPskeyFromFile failed", __func__); - memcpy(pskey_t, &bt_para_setting, sizeof(BT_PSKEY_CONFIG_T)); - return; - } - - memset(buf, 0, PSKEY_PRELOAD_SIZE + PSKEY_PREAMBLE_SIZE); - - /* get bluetooth mac address */ - get_mac_address(pskey.device_addr); - - /* compose pskey hci command pkt */ - pskey_stream_compose(buf, &pskey); - - memcpy(pskey_t, &pskey, sizeof(BT_PSKEY_CONFIG_T)); -} - -#define HCI_HDR_LEN 3 - -int sprd_config_init(int fd, char *bdaddr, struct termios *ti) -{ - int ret = 0,r=0; - unsigned char resp[30] = {0}; - BT_PSKEY_CONFIG_T bt_para_tmp; - uint8 data_tmp[30] = {'a'}; - static int index = 0; - uint8 *buf = NULL; - uint8 hci_len = 0; - uint8 is_expected_hci_evt = 0; -#if 0 - char buffer; - int btsleep_fd_sprd = -1; -#endif - LOGD("sprd_config_init"); - -#if 0 - uart_fd = open(UART_INFO_PATH, O_WRONLY); - if(uart_fd > 0) - { - buffer = '2'; - if (write(uart_fd, &buffer, 1) < 0) - { - LOGD("%s write(%s) failed: %s (%d) 2", __func__, - UART_INFO_PATH, strerror(errno),errno); - } - - close(uart_fd); - } -#endif - -#if 0 - btsleep_fd_sprd = open(VENDOR_BTWRITE_PROC_NODE, O_WRONLY); - if (btsleep_fd_sprd < 0) - { - LOGD("%s open(%s) for write failed: %s (%d)", __func__, - VENDOR_BTWRITE_PROC_NODE, strerror(errno), errno); - } - else - { - buffer = '1'; - if (write(btsleep_fd_sprd, &buffer, 1) < 0) - { - LOGD("%s write(%s) failed: %s (%d)", __func__, - VENDOR_BTWRITE_PROC_NODE, strerror(errno),errno); - } - } -#endif - - ret = bt_getPskeyFromFile(&bt_para_tmp); - if (ret < 0) { - LOGD("init_sprd_config bt_getPskeyFromFile failed\n"); - memcpy(&bt_para_tmp, &bt_para_setting, sizeof(BT_PSKEY_CONFIG_T)); - } - - buf = (uint8 *)malloc(PSKEY_PRELOAD_SIZE + PSKEY_PREAMBLE_SIZE); - if (buf == NULL) { - LOGD("%s alloc stream memory failed", __func__); - return -1; - } - memset(buf, 0, PSKEY_PRELOAD_SIZE + PSKEY_PREAMBLE_SIZE); - - /* get bluetooth mac address */ - get_mac_address(bt_para_tmp.device_addr); - - /* compose pskey hci command pkt */ - pskey_stream_compose(buf, &bt_para_tmp); - - ret = write(fd, buf, PSKEY_PRELOAD_SIZE + PSKEY_PREAMBLE_SIZE); - LOGD("write pskey ret = %d", ret); - - free(buf); - buf = NULL; - - if (ret < 0) { - LOGD("%s write pskey stream failed", __func__); - return -1; - } - - memset(data_tmp, 0xff, sizeof(data_tmp)); - while (1) { - r = read(fd, resp, 1); - - if (r <= 0) - return -1; - else{ - data_tmp[index] = resp[0]; - LOGD("recive from controller 0x%x", data_tmp[index]); - ++index; - } - - if (index >= 6) { - hci_len = data_tmp[2]+HCI_HDR_LEN; - - if ((data_tmp[0] == 0x04) && (data_tmp[1] == 0xe) && - (data_tmp[2] == 0xa) &&(data_tmp[3] == 0x1) && - (data_tmp[4] == 0xa0) &&(data_tmp[5] == 0xfc)) { - LOGD("read response ok \n"); - is_expected_hci_evt = 1; - } else { - LOGD("this is not what we expect HCI evt\n"); - is_expected_hci_evt = 0; - } - - if (index == hci_len) { - index = 0; - memset(data_tmp, 0x0, sizeof(data_tmp)); - - if(is_expected_hci_evt) - break; - } - } - } - return 0; -} diff --git a/tools/hciattach_sprd.h b/tools/hciattach_sprd.h deleted file mode 100644 index 6e59408..0000000 --- a/tools/hciattach_sprd.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef HCIATTACH_SPRD_H__ -#define HCIATTACH_SPRD_H__ - -#define MAC_ERROR "FF:FF:FF:FF:FF:FF" - -#define BT_MAC_FILE "/productinfo/btmac.txt" -//#define GET_BTMAC_ATCMD "AT+SNVM=0,401" -//#define GET_BTPSKEY_ATCMD "AT+SNVM=0,415" -//#define SET_BTMAC_ATCMD "AT+SNVM=1,401" -#define BT_RAND_MAC_LENGTH 17 - -// used to store BT pskey structure and default values -#define BT_PSKEY_STRUCT_FILE "/system/lib/modules/pskey_bt.txt" -//#define BT_PSKEY_FILE "/system/lib/modules/pskey_bt.txt" - - -typedef unsigned char uint8; -typedef unsigned int uint32; -typedef unsigned short uint16; - -#define BT_ADDRESS_SIZE 6 - - -typedef struct SPRD_BT_PSKEY_INFO_T{ - uint32 pskey_cmd; - - uint8 g_dbg_source_sink_syn_test_data; - uint8 g_sys_sleep_in_standby_supported; - uint8 g_sys_sleep_master_supported; - uint8 g_sys_sleep_slave_supported; - - uint32 default_ahb_clk; - uint32 device_class; - uint32 win_ext; - - uint32 g_aGainValue[6]; - uint32 g_aPowerValue[5]; - - uint8 feature_set[16]; - uint8 device_addr[6]; - - uint8 g_sys_sco_transmit_mode; //true tramsmit by uart, otherwise by share memory - uint8 g_sys_uart0_communication_supported; //true use uart0, otherwise use uart1 for debug - uint8 edr_tx_edr_delay; - uint8 edr_rx_edr_delay; - - uint16 g_wbs_nv_117; - - uint32 is_wdg_supported; - - uint32 share_memo_rx_base_addr; - - // uint32 share_memo_tx_base_addr; - uint16 g_wbs_nv_118; - uint16 g_nbv_nv_117; - - uint32 share_memo_tx_packet_num_addr; - uint32 share_memo_tx_data_base_addr; - - uint32 g_PrintLevel; - - uint16 share_memo_tx_block_length; - uint16 share_memo_rx_block_length; - uint16 share_memo_tx_water_mark; - - //uint16 share_memo_tx_timeout_value; - uint16 g_nbv_nv_118; - - uint16 uart_rx_watermark; - uint16 uart_flow_control_thld; - uint32 comp_id; - uint16 pcm_clk_divd; - - uint32 reserved[8]; -}BT_PSKEY_CONFIG_T; - - -#endif /* HCIATTACH_SPRD_H__ */ - - - - diff --git a/tools/hciattach_st.c b/tools/hciattach_st.c old mode 100644 new mode 100755 diff --git a/tools/hciattach_ti.c b/tools/hciattach_ti.c old mode 100644 new mode 100755 index b962677..828dd61 --- a/tools/hciattach_ti.c +++ b/tools/hciattach_ti.c @@ -55,13 +55,7 @@ #define TI_MANUFACTURER_ID 13 -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#ifdef __TI_PATCH__ -#define FIRMWARE_DIRECTORY1 "/mnt/mmc/" -#define FIRMWARE_DIRECTORY2 "/usr/etc/bluetooth/" -#else #define FIRMWARE_DIRECTORY "/lib/firmware/ti-connectivity/" -#endif #define ACTION_SEND_COMMAND 1 #define ACTION_WAIT_EVENT 2 @@ -203,24 +197,7 @@ static const char *get_firmware_name(const uint8_t *respond) if (version & 0x8000) maj_ver |= 0x0008; -/* TIZEN_FEATURE_BLUEZ_MODIFY */ -#ifdef __TI_PATCH__ - FILE *fp; - sprintf(firmware_file_name, FIRMWARE_DIRECTORY1 "TIInit_%d.%d.%d.bts", chip, maj_ver, min_ver); - - if ((fp = fopen(firmware_file_name, "r")) == NULL ) { - extern int firmware_path; - if (firmware_path) - sprintf(firmware_file_name, FIRMWARE_DIRECTORY2 "TIInit_edutm_%d.%d.%d.bts", chip, maj_ver, min_ver); - else - sprintf(firmware_file_name, FIRMWARE_DIRECTORY2 "TIInit_%d.%d.%d.bts", chip, maj_ver, min_ver); - } - else { - fclose(fp); - } -#else sprintf(firmware_file_name, FIRMWARE_DIRECTORY "TIInit_%d.%d.%d.bts", chip, maj_ver, min_ver); -#endif return firmware_file_name; } diff --git a/tools/hciattach_tialt.c b/tools/hciattach_tialt.c old mode 100644 new mode 100755 diff --git a/tools/hciconfig.1 b/tools/hciconfig.1 old mode 100644 new mode 100755 diff --git a/tools/hciconfig.c b/tools/hciconfig.c old mode 100644 new mode 100755 index babe69e..8a97cc4 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -93,14 +93,7 @@ static void print_pkt_type(struct hci_dev_info *di) static void print_link_policy(struct hci_dev_info *di) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *str; - str = hci_lptostr(di->link_policy); - printf("\tLink policy: %s\n", str); - bt_free(str); -#else printf("\tLink policy: %s\n", hci_lptostr(di->link_policy)); -#endif } static void print_link_mode(struct hci_dev_info *di) @@ -1158,7 +1151,7 @@ static void cmd_version(int ctl, int hdev, char *opt) } hciver = hci_vertostr(ver.hci_ver); - if (((di.type & 0x30) >> 4) == HCI_BREDR) + if (((di.type & 0x30) >> 4) == HCI_PRIMARY) lmpver = lmp_vertostr(ver.lmp_ver); else lmpver = pal_vertostr(ver.lmp_ver); @@ -1168,7 +1161,7 @@ static void cmd_version(int ctl, int hdev, char *opt) "\t%s Version: %s (0x%x) Subversion: 0x%x\n" "\tManufacturer: %s (%d)\n", hciver ? hciver : "n/a", ver.hci_ver, ver.hci_rev, - (((di.type & 0x30) >> 4) == HCI_BREDR) ? "LMP" : "PAL", + (((di.type & 0x30) >> 4) == HCI_PRIMARY) ? "LMP" : "PAL", lmpver ? lmpver : "n/a", ver.lmp_ver, ver.lmp_subver, bt_compidtostr(ver.manufacturer), ver.manufacturer); @@ -1909,7 +1902,7 @@ static void print_dev_info(int ctl, struct hci_dev_info *di) if (all && !hci_test_bit(HCI_RAW, &di->flags)) { print_dev_features(di, 0); - if (((di->type & 0x30) >> 4) == HCI_BREDR) { + if (((di->type & 0x30) >> 4) == HCI_PRIMARY) { print_pkt_type(di); print_link_policy(di); print_link_mode(di); diff --git a/tools/hcidump.1 b/tools/hcidump.1 old mode 100644 new mode 100755 diff --git a/tools/hcidump.c b/tools/hcidump.c old mode 100644 new mode 100755 index b460daa..af8f592 --- a/tools/hcidump.c +++ b/tools/hcidump.c @@ -59,27 +59,10 @@ enum { /* Default options */ static int snap_len = SNAP_LEN; static int mode = PARSE; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY static char *dump_file = NULL; -#endif static char *pppdump_file = NULL; static char *audio_file = NULL; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define DUMP_MAX_SIZE 10000000 /* 10MB */ -#define DUMP_MAX_COUNT 2 -#define NAME_MAX 255 - -struct dump_file { - char *filename; - int postfix_width; - unsigned int max_size; - int max_count; -}; - -struct dump_file df = {NULL, 1, DUMP_MAX_SIZE, DUMP_MAX_COUNT}; -#endif - struct hcidump_hdr { uint16_t len; uint8_t in; @@ -118,10 +101,6 @@ struct pktlog_hdr { } __attribute__ ((packed)); #define PKTLOG_HDR_SIZE (sizeof(struct pktlog_hdr)) -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int open_new_dumpfile(unsigned long flags); -#endif - static inline int read_n(int fd, char *buf, int len) { int t = 0, w; @@ -169,9 +148,6 @@ static int process_frames(int dev, int sock, int fd, unsigned long flags) char *buf; char ctrl[100]; int len, hdr_size = HCIDUMP_HDR_SIZE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - int written = 0; -#endif if (sock < 0) return -1; @@ -285,28 +261,10 @@ static int process_frames(int dev, int sock, int fd, unsigned long flags) dh->ts_usec = htobl(frm.ts.tv_usec); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - if (mode == WRITE && df.max_size != 0 && - written + frm.data_len + hdr_size > df.max_size) { - close(fd); - fd = open_new_dumpfile(flags); - if (fd < 0) - return -1; - written = 0; - } - - len = write_n(fd, buf, frm.data_len + hdr_size); - if (len < 0) { - perror("Write error"); - return -1; - } - written += len; -#else if (write_n(fd, buf, frm.data_len + hdr_size) < 0) { perror("Write error"); return -1; } -#endif break; default: @@ -441,10 +399,8 @@ static void read_dump(int fd) if (err < 0) goto failed; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY if (!err) goto done; -#endif frm.ptr = frm.data; frm.len = frm.data_len; @@ -560,38 +516,6 @@ static int open_file(char *file, int mode, unsigned long flags) return fd; } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static int open_new_dumpfile(unsigned long flags) -{ - char filename[NAME_MAX + 1]; - char new_filename[NAME_MAX + 1]; - int i; - - if (df.max_count <= 1) - return open_file(df.filename, WRITE, flags); - - for (i = df.max_count - 2; i >= 0; i--) { - if (i == 0) { - snprintf(filename, sizeof(filename), "%s", df.filename); - } else { - snprintf(filename, sizeof(filename), "%s.%0*d", - df.filename, df.postfix_width, i); - } - - if (access(filename, F_OK) < 0) - continue; - - snprintf(new_filename, sizeof(new_filename), "%s.%0*d", - df.filename, df.postfix_width, i + 1); - - if (rename(filename, new_filename) < 0) - perror("rename failed"); - } - - return open_file(df.filename, WRITE, flags); -} -#endif - static int open_socket(int dev, unsigned long flags) { struct sockaddr_hci addr; @@ -711,10 +635,6 @@ static void usage(void) " -D, --pppdump=file Extract PPP traffic\n" " -A, --audio=file Extract SCO audio data\n" " -Y, --novendor No vendor commands or events\n" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - " -s --dump-size=size Maximum save-dump's file size. The unit is million bytes. Use this with -w. (default: 1,000,000 bytes)\n" - " -c --dump-count=count Specified count's dump files will be generated at most. Use this with -w. (default: 4)\n" -#endif " -h, --help Give this help list\n" " -v, --version Give version information\n" " --usage Give a short usage message\n" @@ -741,10 +661,6 @@ static struct option main_options[] = { { "pppdump", 1, 0, 'D' }, { "audio", 1, 0, 'A' }, { "novendor", 0, 0, 'Y' }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "dump-size", 1, 0, 's' }, - { "dump-count", 1, 0, 'c' }, -#endif { "help", 0, 0, 'h' }, { "version", 0, 0, 'v' }, { 0 } @@ -760,15 +676,9 @@ int main(int argc, char *argv[]) int opt, pppdump_fd = -1, audio_fd = -1; uint16_t obex_port; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - while ((opt = getopt_long(argc, argv, - "i:l:p:m:w:r:taxXRC:H:O:P:S:D:A:Ys:c:hv", - main_options, NULL)) != -1) { -#else while ((opt = getopt_long(argc, argv, "i:l:p:m:w:r:taxXRC:H:O:P:S:D:A:Yhv", main_options, NULL)) != -1) { -#endif switch(opt) { case 'i': if (strcasecmp(optarg, "none") && strcasecmp(optarg, "system")) @@ -791,20 +701,12 @@ int main(int argc, char *argv[]) case 'w': mode = WRITE; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - df.filename = strdup(optarg); -#else dump_file = strdup(optarg); -#endif break; case 'r': mode = READ; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - df.filename = strdup(optarg); -#else dump_file = strdup(optarg); -#endif break; case 't': @@ -863,21 +765,6 @@ int main(int argc, char *argv[]) flags |= DUMP_NOVENDOR; break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case 's': - df.max_size = atoi(optarg) * 1000000; - break; - - case 'c': - { - int i; - df.max_count = atoi(optarg); - for (i = df.max_count / 10; i; i /= 10) - df.postfix_width++; - break; - } -#endif - case 'v': printf("%s\n", VERSION); exit(0); @@ -920,24 +807,13 @@ int main(int argc, char *argv[]) flags |= DUMP_VERBOSE; init_parser(flags, filter, defpsm, defcompid, pppdump_fd, audio_fd); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - read_dump(open_file(df.filename, mode, flags)); -#else read_dump(open_file(dump_file, mode, flags)); -#endif break; case WRITE: flags |= DUMP_BTSNOOP; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - printf("Maximum size of one file : %u, Rotated file count : %d", - df.max_size, df.max_count); - process_frames(device, open_socket(device, flags), - open_file(df.filename, mode, flags), flags); -#else process_frames(device, open_socket(device, flags), open_file(dump_file, mode, flags), flags); -#endif break; } diff --git a/tools/hcieventmask.c b/tools/hcieventmask.c old mode 100644 new mode 100755 diff --git a/tools/hcisecfilter.c b/tools/hcisecfilter.c old mode 100644 new mode 100755 diff --git a/tools/hcitool.1 b/tools/hcitool.1 old mode 100644 new mode 100755 diff --git a/tools/hcitool.c b/tools/hcitool.c old mode 100644 new mode 100755 index 0b6f499..02c4ebe --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -1098,66 +1098,6 @@ static void cmd_epinq(int dev_id, int argc, char **argv) hci_close_dev(dd); } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -/* Send arbitrary ACL data */ -static struct option data_options[] = { - { "help", 0, 0, 'h' }, - { 0, 0, 0, 0 } -}; - -static const char *data_help = - "Usage:\n" - "\tcmd \n" - "Example:\n" - "\tcmd 0x0064 0x41 0x42 0x43 0x44\n"; - -static void cmd_data(int dev_id, int argc, char **argv) -{ - unsigned char buf[HCI_MAX_ACL_SIZE], *ptr = buf; - struct hci_filter flt; - int i, opt, len, dd; - uint16_t handle; - - for_each_opt(opt, data_options, NULL) { - switch (opt) { - default: - printf("%s", data_help); - return; - } - } - helper_arg(2, -1, &argc, &argv, data_help); - - if (dev_id < 0) - dev_id = hci_get_route(NULL); - - handle = atoi(argv[0]); - - for (i = 1, len = 0; i < argc && len < (int) sizeof(buf); i++, len++) - *ptr++ = (uint8_t) strtol(argv[i], NULL, 16); - - dd = hci_open_dev(dev_id); - if (dd < 0) { - perror("Device open failed"); - exit(EXIT_FAILURE); - } - - /* Setup filter */ - hci_filter_clear(&flt); - hci_filter_all_events(&flt); - if (setsockopt(dd, SOL_HCI, HCI_FILTER, &flt, sizeof(flt)) < 0) { - perror("HCI filter setup failed"); - exit(EXIT_FAILURE); - } - - if (hci_send_data(dd, handle, len, buf) < 0) { - perror("Send failed"); - exit(EXIT_FAILURE); - } - - hci_close_dev(dd); -} -#endif - /* Send arbitrary HCI commands */ static struct option cmd_options[] = { @@ -3448,9 +3388,6 @@ static struct { { "spinq", cmd_spinq, "Start periodic inquiry" }, { "epinq", cmd_epinq, "Exit periodic inquiry" }, { "cmd", cmd_cmd, "Submit arbitrary HCI commands" }, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - { "acl", cmd_data, "Submit arbitrary ACL data" }, -#endif { "con", cmd_con, "Display active connections" }, { "cc", cmd_cc, "Create connection to remote device" }, { "dc", cmd_dc, "Disconnect from remote device" }, diff --git a/tools/hex2hcd.c b/tools/hex2hcd.c old mode 100644 new mode 100755 diff --git a/tools/hid2hci.1 b/tools/hid2hci.1 old mode 100644 new mode 100755 diff --git a/tools/hid2hci.c b/tools/hid2hci.c old mode 100644 new mode 100755 diff --git a/tools/hid2hci.rules b/tools/hid2hci.rules old mode 100644 new mode 100755 diff --git a/tools/hwdb.c b/tools/hwdb.c old mode 100644 new mode 100755 diff --git a/tools/ibeacon.c b/tools/ibeacon.c old mode 100644 new mode 100755 index 9d48e66..6208e8a --- a/tools/ibeacon.c +++ b/tools/ibeacon.c @@ -149,7 +149,6 @@ static void adv_tx_power_callback(const void *data, uint8_t size, cmd.data[0] = 0x02; /* Field length */ cmd.data[1] = 0x01; /* Flags */ - cmd.data[2] = 0x02; /* LE General Discoverable Mode */ cmd.data[2] |= 0x04; /* BR/EDR Not Supported */ cmd.data[3] = 0x1a; /* Field length */ diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c old mode 100644 new mode 100755 diff --git a/tools/l2ping.1 b/tools/l2ping.1 old mode 100644 new mode 100755 diff --git a/tools/l2ping.c b/tools/l2ping.c old mode 100644 new mode 100755 diff --git a/tools/l2test.c b/tools/l2test.c old mode 100644 new mode 100755 index 2048820..1819423 --- a/tools/l2test.c +++ b/tools/l2test.c @@ -69,17 +69,9 @@ enum { LSENDRECV, CSENDRECV, INFOREQ, -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - CONFIGREQ, -#endif PAIRING, }; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ -#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ -#endif - static unsigned char *buf; /* Default mtu */ @@ -103,9 +95,6 @@ static long buffer_size = 2048; static bdaddr_t bdaddr; static unsigned short psm = 0; static unsigned short cid = 0; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static uint16_t dcid = 0x0000; -#endif /* Default number of frames to send (-1 = infinite) */ static int num_frames = -1; @@ -841,7 +830,7 @@ static void dump_mode(int sk) return; } - syslog(LOG_INFO, "Recevied %d bytes", len); + syslog(LOG_INFO, "Received %d bytes", len); hexdump(buf, len); } } @@ -1114,146 +1103,6 @@ static void multi_connect_mode(int argc, char *argv[]) } } -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -static void l2cap_add_conf_opt(void **ptr, uint8_t type, uint8_t len, unsigned long val) -{ - l2cap_conf_opt *opt = *ptr; - - printf("type 0x%2.2x len %u val 0x%lx \n", type, len, val); - opt->type = htobs(type); - opt->len = htobs(len); - - switch (opt->len) { - case 1: - *((uint8_t *) opt->val) = val; - break; - case 2: - bt_put_le16(val, opt->val); - break; - case 4: - bt_put_le32(val, opt->val); - break; - default: - memcpy(opt->val, (void *) val, len); - break; - } - - *ptr += L2CAP_CONF_OPT_SIZE + len; -} - -static int l2cap_build_conf_req(void *data) -{ - l2cap_conf_req *req = data; - l2cap_conf_rfc rfc; - void *ptr = req->data; - - req->dcid = htobs(dcid); - req->flags = htobs(0x0000); - - switch (rfcmode) { - case L2CAP_MODE_BASIC: - rfc.mode = htobs(L2CAP_MODE_BASIC); - rfc.txwin_size = htobs(0); - rfc.max_transmit = htobs(0); - rfc.retrans_timeout = htobs(0); - rfc.monitor_timeout = htobs(0); - rfc.max_pdu_size = htobs(0); - - l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc), - (unsigned long) &rfc); - - break; - - case L2CAP_MODE_ERTM: - rfc.mode = htobs(L2CAP_MODE_ERTM); - rfc.txwin_size = htobs(txwin_size); - rfc.max_transmit = htobs(max_transmit); - rfc.retrans_timeout = htobs(L2CAP_DEFAULT_RETRANS_TO); - rfc.monitor_timeout = htobs(L2CAP_DEFAULT_MONITOR_TO); - rfc.max_pdu_size = htobs(imtu); - - /* TODO: Enable FCS, FOC options if required */ - l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc), - (unsigned long) &rfc); - break; - - case L2CAP_MODE_STREAMING: - rfc.mode = htobs(L2CAP_MODE_STREAMING); - rfc.txwin_size = htobs(txwin_size); - rfc.max_transmit = htobs(max_transmit); - rfc.retrans_timeout = htobs(L2CAP_DEFAULT_RETRANS_TO); - rfc.monitor_timeout = htobs(L2CAP_DEFAULT_MONITOR_TO); - rfc.max_pdu_size = htobs(imtu); - - /* TODO: Enable FCS, FOC options if required */ - l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc), - (unsigned long) &rfc); - - break; - default: - return L2CAP_CONF_REQ_SIZE; - } - return ptr - data; -} - -static void config_request(char *svr) -{ - unsigned char buf[48]; - l2cap_cmd_hdr *cmd = (l2cap_cmd_hdr *) buf; - uint8_t *req_buf = (uint8_t *) (buf + L2CAP_CMD_HDR_SIZE); -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - uint16_t mtu; - uint32_t channels, mask = 0x0000; -#endif - struct sockaddr_l2 addr; -#ifndef TIZEN_FEATURE_BLUEZ_MODIFY - int sk, err; -#else - int sk; -#endif - int data_len = 0; - - sk = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_L2CAP); - if (sk < 0) { - perror("Can't create socket"); - return; - } - - memset(&addr, 0, sizeof(addr)); - addr.l2_family = AF_BLUETOOTH; - bacpy(&addr.l2_bdaddr, &bdaddr); - addr.l2_bdaddr_type = bdaddr_type; - - if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - perror("Can't bind socket"); - goto failed; - } - - memset(&addr, 0, sizeof(addr)); - addr.l2_family = AF_BLUETOOTH; - str2ba(svr, &addr.l2_bdaddr); - addr.l2_bdaddr_type = bdaddr_type; - - if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0 ) { - perror("Can't connect socket"); - goto failed; - } - - memset(buf, 0, sizeof(buf)); - cmd->code = L2CAP_CONF_REQ; - cmd->ident = 141; - data_len = l2cap_build_conf_req(req_buf); - cmd->len = htobs(data_len); - - if (send(sk, buf, L2CAP_CMD_HDR_SIZE + data_len, 0) < 0) { - perror("Can't send info request"); - goto failed; - } -failed: - close(sk); -} -#endif - static void info_request(char *svr) { unsigned char buf[48]; @@ -1465,9 +1314,6 @@ static void usage(void) "\t-c connect, disconnect, connect, ...\n" "\t-m multiple connects\n" "\t-p trigger dedicated bonding\n" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - "\t-o configuration request\n" -#endif "\t-z information request\n"); printf("Options:\n" @@ -1497,9 +1343,6 @@ static void usage(void) "\t[-M] become master\n" "\t[-T] enable timestamps\n" "\t[-V type] address type (help for list, default = bredr)\n" -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - "\t[-f DCID] destination CID\n" -#endif "\t[-e seq] initial sequence value (default = 0)\n"); } @@ -1510,13 +1353,8 @@ int main(int argc, char *argv[]) bacpy(&bdaddr, BDADDR_ANY); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - while ((opt = getopt(argc, argv, "a:b:cde:f:g:i:mnopqrstuwxyz" - "AB:C:D:EF:GH:I:J:K:L:MN:O:P:Q:RSTUV:W:X:Y:Z:")) != EOF) { -#else while ((opt = getopt(argc, argv, "a:b:cde:g:i:mnpqrstuwxyz" "AB:C:D:EF:GH:I:J:K:L:MN:O:P:Q:RSTUV:W:X:Y:Z:")) != EOF) { -#endif switch (opt) { case 'r': mode = RECV; @@ -1545,13 +1383,6 @@ int main(int argc, char *argv[]) need_addr = 1; break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case 'o': - mode = CONFIGREQ; - need_addr = 1; - break; -#endif - case 'n': mode = CONNECT; need_addr = 1; @@ -1729,13 +1560,6 @@ int main(int argc, char *argv[]) break; -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case 'f': - dcid = atoi(optarg); - printf("dcid %d", dcid); - break; -#endif - case 'e': seq_start = atoi(optarg); break; @@ -1845,12 +1669,6 @@ int main(int argc, char *argv[]) info_request(argv[optind]); exit(0); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - case CONFIGREQ: - config_request(argv[optind]); - exit(0); -#endif - case PAIRING: do_pairing(argv[optind]); exit(0); diff --git a/tools/magic.btsnoop b/tools/magic.btsnoop old mode 100644 new mode 100755 diff --git a/tools/mcaptest.c b/tools/mcaptest.c old mode 100644 new mode 100755 diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c old mode 100644 new mode 100755 index 494d436..d87d800 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -63,6 +63,7 @@ struct test_data { struct hciemu *hciemu; enum hciemu_type hciemu_type; int unmet_conditions; + int unmet_setup_conditions; }; static void mgmt_debug(const char *str, void *user_data) @@ -287,6 +288,27 @@ static void test_add_condition(struct test_data *data) tester_print("Test condition added, total %d", data->unmet_conditions); } +static void test_add_setup_condition(struct test_data *data) +{ + data->unmet_setup_conditions++; + + tester_print("Test setup condition added, total %d", + data->unmet_setup_conditions); +} + +static void test_setup_condition_complete(struct test_data *data) +{ + data->unmet_setup_conditions--; + + tester_print("Test setup condition complete, %d left", + data->unmet_setup_conditions); + + if (data->unmet_setup_conditions > 0) + return; + + tester_setup_complete(); +} + static void test_condition_complete(struct test_data *data) { data->unmet_conditions--; @@ -384,6 +406,12 @@ static void controller_setup(const void *test_data) tester_test_passed(); } +struct setup_mgmt_cmd { + uint8_t send_opcode; + const void *send_param; + uint16_t send_len; +}; + struct generic_data { const uint16_t *setup_settings; bool setup_nobredr; @@ -394,6 +422,7 @@ struct generic_data { uint16_t setup_send_opcode; const void *setup_send_param; uint16_t setup_send_len; + const struct setup_mgmt_cmd *setup_mgmt_cmd_arr; bool send_index_none; uint16_t send_opcode; const void *send_param; @@ -428,6 +457,7 @@ struct generic_data { bool just_works; bool client_enable_le; bool client_enable_sc; + bool client_enable_adv; bool expect_sc_key; bool force_power_off; bool addr_type_avail; @@ -1678,6 +1708,112 @@ static const struct generic_data set_adv_on_rejected_test_1 = { .expect_status = MGMT_STATUS_REJECTED, }; +static const uint8_t set_adv_set_appearance_param[2] = { 0x54, 0x65 }; + +static const uint8_t set_adv_scan_rsp_data_appear_1[] = { + 0x04, /* Scan rsp data len */ + 0x03, /* Local name data len */ + 0x19, /* Complete name */ + 0x54, 0x65, + /* padding */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data set_adv_on_appearance_test_1 = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_APPEARANCE, + .setup_send_param = set_adv_set_appearance_param, + .setup_send_len = sizeof(set_adv_set_appearance_param), + .send_opcode = MGMT_OP_SET_ADVERTISING, + .send_param = set_adv_on_param, + .expect_param = set_adv_settings_param_2, + .expect_len = sizeof(set_adv_settings_param_2), + .send_len = sizeof(set_adv_on_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_adv_scan_rsp_data_appear_1, + .expect_hci_len = sizeof(set_adv_scan_rsp_data_appear_1), +}; + +static const char set_adv_set_local_name_param[260] = { 'T', 'e', 's', 't', ' ', + 'n', 'a', 'm', 'e' }; + +static const uint8_t set_adv_scan_rsp_data_name_1[] = { + 0x0c, /* Scan rsp data len */ + 0x0b, /* Local name data len */ + 0x09, /* Complete name */ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ + 0x00, /* null */ + /* padding */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data set_adv_on_local_name_test_1 = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = set_adv_set_local_name_param, + .setup_send_len = sizeof(set_adv_set_local_name_param), + .send_opcode = MGMT_OP_SET_ADVERTISING, + .send_param = set_adv_on_param, + .expect_param = set_adv_settings_param_2, + .expect_len = sizeof(set_adv_settings_param_2), + .send_len = sizeof(set_adv_on_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_adv_scan_rsp_data_name_1, + .expect_hci_len = sizeof(set_adv_scan_rsp_data_name_1), +}; + +static const struct setup_mgmt_cmd set_advertising_mgmt_cmd_arr[] = { + { + .send_opcode = MGMT_OP_SET_APPEARANCE, + .send_param = set_adv_set_appearance_param, + .send_len = sizeof(set_adv_set_appearance_param), + }, + { + .send_opcode = MGMT_OP_SET_LOCAL_NAME, + .send_param = set_adv_set_local_name_param, + .send_len = sizeof(set_adv_set_local_name_param), + }, + { /* last element should always have opcode 0x00 */ + .send_opcode = 0x00, + .send_param = NULL, + .send_len = 0, + } +}; + +static const uint8_t set_adv_scan_rsp_data_name_and_appearance[] = { + 0x10, /* scan rsp data len */ + 0x03, /* appearance data len */ + 0x19, /* eir_appearance */ + 0x54, 0x65, /* appearance value */ + 0x0b, /* local name data len */ + 0x09, /* complete name */ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "test name" */ + 0x00, /* null */ + /* padding */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, +}; + + +static const struct generic_data set_adv_on_local_name_appear_test_1 = { + .setup_settings = settings_powered_le, + .setup_mgmt_cmd_arr = set_advertising_mgmt_cmd_arr, + .send_opcode = MGMT_OP_SET_ADVERTISING, + .send_param = set_adv_on_param, + .expect_param = set_adv_settings_param_2, + .expect_len = sizeof(set_adv_settings_param_2), + .send_len = sizeof(set_adv_on_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_adv_scan_rsp_data_name_and_appearance, + .expect_hci_len = sizeof(set_adv_scan_rsp_data_name_and_appearance), +}; + static const char set_bredr_off_param[] = { 0x00 }; static const char set_bredr_on_param[] = { 0x01 }; static const char set_bredr_invalid_param[] = { 0x02 }; @@ -1759,6 +1895,20 @@ static const char write_eir_local_name_hci_1[241] = { 0x00, 0x0a, 0x09, 'T', 'e', 's', 't', ' ', 'n', 'a', 'm', 'e', 0x02, 0x0a, 0x00, }; +static const struct mgmt_cp_set_local_name set_local_name_cp = { + .name = {'T', 'e', 's', 't', ' ', 'n', 'a', 'm', 'e'}, + .short_name = {'T', 'e', 's', 't'}, +}; + +static const struct mgmt_cp_set_local_name set_local_name_longer_cp = { + .name = {'T', 'e', 's', 't', ' ', 'n', 'a', 'm', 'e', '1', '2', '3'}, +}; + +static const struct mgmt_cp_set_local_name set_local_name_long_short_cp = { + .name = {'T', 'e', 's', 't', ' ', 'n', 'a', 'm', 'e', '1', '2', '3'}, + .short_name = {'T', 'e', 's', 't'}, +}; + static const struct generic_data set_local_name_test_1 = { .send_opcode = MGMT_OP_SET_LOCAL_NAME, .send_param = set_local_name_param, @@ -3090,6 +3240,96 @@ static const struct generic_data pair_device_le_sc_success_test_2 = { .verify_alt_ev_func = verify_ltk, }; +static bool lk_is_authenticated(const struct mgmt_link_key_info *lk) +{ + switch (lk->type) { + case 0x00: /* Combination Key */ + case 0x01: /* Local Unit Key */ + case 0x02: /* Remote Unit Key */ + case 0x03: /* Debug Combination Key */ + if (lk->pin_len == 16) + return true; + return false; + case 0x05: /* Authenticated Combination Key generated from P-192 */ + case 0x08: /* Authenticated Combination Key generated from P-256 */ + return true; + default: + return false; + } +} + +static bool lk_is_sc(const struct mgmt_link_key_info *lk) +{ + switch (lk->type) { + case 0x07: /* Unauthenticated Combination Key generated from P-256 */ + case 0x08: /* Authenticated Combination Key generated from P-256 */ + return true; + default: + return false; + } +} + +static bool verify_link_key(const void *param, uint16_t length) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + const struct mgmt_ev_new_link_key *ev = param; + + if (length != sizeof(struct mgmt_ev_new_link_key)) { + tester_warn("Invalid new Link Key length %u != %zu", length, + sizeof(struct mgmt_ev_new_link_key)); + return false; + } + + if (test->just_works && lk_is_authenticated(&ev->key)) { + tester_warn("Authenticated key for just-works"); + return false; + } + + if (!test->just_works && !lk_is_authenticated(&ev->key)) { + tester_warn("Unauthenticated key for MITM"); + return false; + } + + if (test->expect_sc_key && !lk_is_sc(&ev->key)) { + tester_warn("Non-LE SC key for SC pairing"); + return false; + } + + if (!test->expect_sc_key && lk_is_sc(&ev->key)) { + tester_warn("SC key for Non-SC pairing"); + return false; + } + + return true; +} + +static uint16_t settings_powered_le_sc_bondable[] = { + MGMT_OP_SET_LE, + MGMT_OP_SET_SSP, + MGMT_OP_SET_BONDABLE, + MGMT_OP_SET_SECURE_CONN, + MGMT_OP_SET_POWERED, 0 }; + +static const struct generic_data pair_device_le_sc_success_test_3 = { + .setup_settings = settings_powered_le_sc_bondable, + .send_opcode = MGMT_OP_PAIR_DEVICE, + .send_func = pair_device_send_param_func, + .addr_type_avail = true, + .addr_type = 0x01, + .client_enable_sc = true, + .client_enable_ssp = true, + .client_enable_adv = true, + .expect_sc_key = true, + .io_cap = 0x02, /* KeyboardOnly */ + .client_io_cap = 0x02, /* KeyboardOnly */ + .expect_status = MGMT_STATUS_SUCCESS, + .expect_func = pair_device_expect_param_func, + .expect_alt_ev = MGMT_EV_NEW_LINK_KEY, + .expect_alt_ev_len = 26, + .verify_alt_ev_func = verify_link_key, +}; + static uint16_t settings_powered_connectable_bondable[] = { MGMT_OP_SET_BONDABLE, MGMT_OP_SET_CONNECTABLE, @@ -3907,7 +4147,7 @@ static const struct generic_data read_adv_features_invalid_index_test = { }; static const uint8_t read_adv_features_rsp_1[] = { - 0x1f, 0x00, 0x00, 0x00, /* supported flags */ + 0x7f, 0x00, 0x00, 0x00, /* supported flags */ 0x1f, /* max_adv_data_len */ 0x1f, /* max_scan_rsp_len */ 0x05, /* max_instances */ @@ -3922,7 +4162,7 @@ static const struct generic_data read_adv_features_success_1 = { }; static const uint8_t read_adv_features_rsp_2[] = { - 0x1f, 0x00, 0x00, 0x00, /* supported flags */ + 0x7f, 0x00, 0x00, 0x00, /* supported flags */ 0x1f, /* max_adv_data_len */ 0x1f, /* max_scan_rsp_len */ 0x05, /* max_instances */ @@ -4771,6 +5011,210 @@ static const struct generic_data read_local_oob_success_sc_test = { .expect_hci_command = BT_HCI_CMD_READ_LOCAL_OOB_EXT_DATA, }; +static const char ext_ctrl_info1[] = { + 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ + 0x08, /* version */ + 0x3f, 0x00, /* manufacturer */ + 0xff, 0xbf, 0x00, 0x00, /* supported settings */ + 0x80, 0x00, 0x00, 0x00, /* current settings */ + 0x09, 0x00, /* eir length */ + 0x04, /* dev class length */ + 0x0d, /* dev class info */ + 0x00, /* minor */ + 0x00, /* major */ + 0x00, /* service classes */ + 0x01, /* complete name data length */ + 0x09, /* complete name flag */ + 0x01, /* short name data length */ + 0x08, /* short name flag */ +}; + +static const struct generic_data read_ext_ctrl_info1 = { + .send_opcode = MGMT_OP_READ_EXT_INFO, + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = ext_ctrl_info1, + .expect_len = sizeof(ext_ctrl_info1), +}; + +static const char set_dev_class1[] = { 0x03, 0xe0 }; + +static const struct setup_mgmt_cmd set_dev_class_cmd_arr1[] = { + { + .send_opcode = MGMT_OP_SET_DEV_CLASS, + .send_param = set_dev_class1, + .send_len = sizeof(set_dev_class1), + }, + { + .send_opcode = MGMT_OP_ADD_UUID, + .send_param = add_spp_uuid_param, + .send_len = sizeof(add_spp_uuid_param), + }, + { /* last element should always have opcode 0x00 */ + .send_opcode = 0x00, + .send_param = NULL, + .send_len = 0, + } +}; + +static const char ext_ctrl_info2[] = { + 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ + 0x08, /* version */ + 0x3f, 0x00, /* manufacturer */ + 0xff, 0xbf, 0x00, 0x00, /* supported settings */ + 0x81, 0x02, 0x00, 0x00, /* current settings */ + 0x0D, 0x00, /* eir length */ + 0x04, /* dev class length */ + 0x0d, /* dev class info */ + 0xe0, /* minor */ + 0x03, /* major */ + 0x00, /* service classes */ + 0x03, /* appearance length */ + 0x19, /* EIR_APPEARANCE */ + 0x00, /* Appearance value */ + 0x00, + 0x01, /* complete name data length */ + 0x09, /* complete name flag */ + 0x01, /* short name data length */ + 0x08, /* short name flag */ +}; + +static const struct generic_data read_ext_ctrl_info2 = { + .setup_settings = settings_powered_le, + .setup_mgmt_cmd_arr = set_dev_class_cmd_arr1, + .send_opcode = MGMT_OP_READ_EXT_INFO, + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = ext_ctrl_info2, + .expect_len = sizeof(ext_ctrl_info2), +}; + +static const char ext_ctrl_info3[] = { + 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ + 0x08, /* version */ + 0x3f, 0x00, /* manufacturer */ + 0xff, 0xbf, 0x00, 0x00, /* supported settings */ + 0x80, 0x02, 0x00, 0x00, /* current settings */ + 0x16, 0x00, /* eir length */ + 0x04, /* dev class length */ + 0x0d, /* dev class info */ + 0x00, /* minor */ + 0x00, /* major */ + 0x00, /* service classes */ + 0x03, /* appearance length */ + 0x19, /* EIR_APPEARANCE */ + 0x00, /* Appearance value */ + 0x00, + 0x0A, /* Local name length */ + 0x09, /* Complete name */ + 0x54, 0x65, 0x73, 0x74, + 0x20, 0x6E, 0x61, 0x6D, 0x65, /* "Test name" */ + 0x01, /* short name data length */ + 0x08, /* short name flag */ +}; + +static const struct generic_data read_ext_ctrl_info3 = { + .setup_settings = settings_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = set_local_name_param, + .setup_send_len = sizeof(set_local_name_param), + .send_opcode = MGMT_OP_READ_EXT_INFO, + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = ext_ctrl_info3, + .expect_len = sizeof(ext_ctrl_info3), +}; + +static const char ext_ctrl_info4[] = { + 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ + 0x08, /* version */ + 0x3f, 0x00, /* manufacturer */ + 0xff, 0xbf, 0x00, 0x00, /* supported settings */ + 0x80, 0x02, 0x00, 0x00, /* current settings */ + 0x1a, 0x00, /* eir length */ + 0x04, /* dev class length */ + 0x0d, /* dev class info */ + 0x00, /* minor */ + 0x00, /* major */ + 0x00, /* service classes */ + 0x03, /* appearance length */ + 0x19, /* EIR_APPEARANCE */ + 0x00, /* Appearance value */ + 0x00, + 0x0A, /* Complete Local name len */ + 0x09, /* Complete name */ + 0x54, 0x65, 0x73, 0x74, + 0x20, 0x6E, 0x61, 0x6D, 0x65, /* "Test name" */ + 0x05, /* Short Local name len */ + 0x08, /* Short name */ + 0x54, 0x65, 0x73, 0x74, /* "Test" */ +}; + +static const struct generic_data read_ext_ctrl_info4 = { + .setup_settings = settings_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = &set_local_name_cp, + .setup_send_len = sizeof(set_local_name_cp), + .send_opcode = MGMT_OP_READ_EXT_INFO, + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = ext_ctrl_info4, + .expect_len = sizeof(ext_ctrl_info4), +}; + +static const struct setup_mgmt_cmd set_dev_class_cmd_arr2[] = { + { + .send_opcode = MGMT_OP_SET_DEV_CLASS, + .send_param = set_dev_class1, + .send_len = sizeof(set_dev_class1), + }, + { + .send_opcode = MGMT_OP_ADD_UUID, + .send_param = add_spp_uuid_param, + .send_len = sizeof(add_spp_uuid_param), + }, + { + .send_opcode = MGMT_OP_SET_LOCAL_NAME, + .send_param = &set_local_name_cp, + .send_len = sizeof(set_local_name_cp), + }, + { /* last element should always have opcode 0x00 */ + .send_opcode = 0x00, + .send_param = NULL, + .send_len = 0, + } +}; + +static const char ext_ctrl_info5[] = { + 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ + 0x08, /* version */ + 0x3f, 0x00, /* manufacturer */ + 0xff, 0xbf, 0x00, 0x00, /* supported settings */ + 0x81, 0x02, 0x00, 0x00, /* current settings */ + 0x1a, 0x00, /* eir len */ + 0x04, /* dev class len */ + 0x0d, /* dev class info */ + 0xe0, /* minor */ + 0x03, /* major */ + 0x00, /* service classes */ + 0x03, /* appearance length */ + 0x19, /* EIR_APPEARANCE */ + 0x00, /* Appearance value */ + 0x00, + 0x0A, /* Complete Local name len */ + 0x09, /* Complete name */ + 0x54, 0x65, 0x73, 0x74, + 0x20, 0x6E, 0x61, 0x6D, 0x65, /* "Test name" */ + 0x05, /* Short Local name len */ + 0x08, /* Short name */ + 0x54, 0x65, 0x73, 0x74, /* "Test" */ +}; + +static const struct generic_data read_ext_ctrl_info5 = { + .setup_settings = settings_powered_le, + .setup_mgmt_cmd_arr = set_dev_class_cmd_arr2, + .send_opcode = MGMT_OP_READ_EXT_INFO, + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = ext_ctrl_info5, + .expect_len = sizeof(ext_ctrl_info5), +}; + static void client_cmd_complete(uint16_t opcode, uint8_t status, const void *param, uint8_t len, void *user_data) @@ -4808,11 +5252,12 @@ static void client_cmd_complete(uint16_t opcode, uint8_t status, static void setup_bthost(void) { struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; struct bthost *bthost; bthost = hciemu_client_get_host(data->hciemu); bthost_set_cmd_complete_cb(bthost, client_cmd_complete, data); - if (data->hciemu_type == HCIEMU_TYPE_LE) + if (data->hciemu_type == HCIEMU_TYPE_LE || test->client_enable_adv) bthost_set_adv_enable(bthost, 0x01); else bthost_write_scan_enable(bthost, 0x03); @@ -5752,6 +6197,35 @@ static void command_generic_callback(uint8_t status, uint16_t length, test_condition_complete(data); } +static void command_setup_hci_callback(uint16_t opcode, const void *param, + uint8_t length, void *user_data) +{ + struct test_data *data = user_data; + const struct generic_data *test = data->test_data; + const void *setup_expect_hci_param = test->setup_expect_hci_param; + uint8_t setup_expect_hci_len = test->setup_expect_hci_len; + + tester_print("HCI Command 0x%04x length %u", opcode, length); + + if (opcode != test->setup_expect_hci_command) + return; + + if (length != setup_expect_hci_len) { + tester_warn("Invalid parameter size for HCI command"); + tester_test_failed(); + return; + } + + if (memcmp(param, setup_expect_hci_param, length) != 0) { + tester_warn("Unexpected HCI command parameter value"); + tester_test_failed(); + return; + } + + hciemu_clear_master_post_command_hooks(data->hciemu); + test_setup_condition_complete(data); +} + static void command_hci_callback(uint16_t opcode, const void *param, uint8_t length, void *user_data) { @@ -5783,6 +6257,484 @@ static void command_hci_callback(uint16_t opcode, const void *param, test_condition_complete(data); } +static void setup_mgmt_cmd_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + if (status != MGMT_STATUS_SUCCESS) { + tester_setup_failed(); + return; + } + test_setup_condition_complete(user_data); +} + +static void setup_command_generic(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + const void *send_param = test->setup_send_param; + uint16_t send_len = test->setup_send_len; + size_t i = 0; + + if (test->setup_expect_hci_command) { + tester_print("Registering setup expected HCI command callback"); + tester_print("Setup expected HCI command 0x%04x", + test->setup_expect_hci_command); + hciemu_add_master_post_command_hook(data->hciemu, + command_setup_hci_callback, data); + test_add_setup_condition(data); + } + + if (test->setup_send_opcode) { + tester_print("Setup sending %s (0x%04x)", + mgmt_opstr(test->setup_send_opcode), + test->setup_send_opcode); + mgmt_send(data->mgmt, test->setup_send_opcode, data->mgmt_index, + send_len, send_param, + setup_mgmt_cmd_callback, + data, NULL); + test_add_setup_condition(data); + return; + } + + tester_print("Sending setup opcode array"); + for (; test->setup_mgmt_cmd_arr + i; ++i) { + const struct setup_mgmt_cmd *cmd = test->setup_mgmt_cmd_arr + i; + + if (cmd->send_opcode == 0x00) + break; + + tester_print("Setup sending %s (0x%04x)", + mgmt_opstr(cmd->send_opcode), + cmd->send_opcode); + + mgmt_send(data->mgmt, cmd->send_opcode, data->mgmt_index, + cmd->send_len, cmd->send_param, + setup_mgmt_cmd_callback, + data, NULL); + test_add_setup_condition(data); + } +} + +static const uint8_t add_advertising_param_empty[] = { + 0x01, /* adv instance */ + 0x00, 0x00, 0x00, 0x00, /* flags: none */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x00, /* scan rsp len */ +}; + +static const struct generic_data add_advertising_empty_scrsp = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = set_local_name_param, + .setup_send_len = sizeof(set_local_name_param), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_empty, + .send_len = sizeof(add_advertising_param_empty), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), +}; + +static const uint8_t add_advertising_param_scrsp_data_only_ok[] = { + 0x01, /* adv instance */ + 0x00, 0x00, 0x00, 0x00, /* flags: none */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x1f, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, +}; + +static const struct generic_data add_advertising_scrsp_data_only_ok = { + .setup_settings = settings_powered_le, + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_scrsp_data_only_ok, + .send_len = sizeof(add_advertising_param_scrsp_data_only_ok), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), +}; + +static const uint8_t add_advertising_param_scrsp_data_only_too_long[] = { + 0x01, /* adv instance */ + 0x00, 0x00, 0x00, 0x00, /* flags: none */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x20, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +static const struct generic_data add_advertising_scrsp_data_only_too_long = { + .setup_settings = settings_powered_le, + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_scrsp_data_only_too_long, + .send_len = sizeof(add_advertising_param_scrsp_data_only_too_long), + .expect_status = MGMT_STATUS_INVALID_PARAMS, + .expect_param = NULL, + .expect_len = 0, +}; + +static const uint8_t set_appearance_param[2] = { 0x54, 0x65 }; + +static const uint8_t add_advertising_param_scrsp_appear_data_ok[] = { + 0x01, /* adv instance */ + 0x20, 0x00, 0x00, 0x00, /* flags: appearance */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x1b, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data add_advertising_scrsp_appear_data_ok = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_APPEARANCE, + .setup_send_param = set_appearance_param, + .setup_send_len = sizeof(set_appearance_param), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_scrsp_appear_data_ok, + .send_len = sizeof(add_advertising_param_scrsp_appear_data_ok), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), +}; + +static const uint8_t add_advertising_param_scrsp_appear_data_too_long[] = { + 0x01, /* adv instance */ + 0x20, 0x00, 0x00, 0x00, /* flags: appearance */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x1c, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data add_advertising_scrsp_appear_data_too_long = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_APPEARANCE, + .setup_send_param = set_appearance_param, + .setup_send_len = sizeof(set_appearance_param), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_scrsp_appear_data_too_long, + .send_len = sizeof(add_advertising_param_scrsp_appear_data_too_long), + .expect_status = MGMT_STATUS_INVALID_PARAMS, + .expect_param = NULL, + .expect_len = 0, +}; + +static const uint8_t add_advertising_param_scrsp_appear_null[] = { + 0x01, /* adv instance */ + 0x20, 0x00, 0x00, 0x00, /* flags: appearance */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x01, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, +}; + +static const struct generic_data add_advertising_scrsp_appear_null = { + .setup_settings = settings_powered_le, + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_scrsp_appear_null, + .send_len = sizeof(add_advertising_param_scrsp_appear_null), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), +}; + +static const uint8_t add_advertising_empty_param[] = { + 0x01, /* adv instance */ + 0x40, 0x00, 0x00, 0x00, /* flags: local name*/ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x01, /* scan rsp len */ + /* scan rsp data: */ + 0x00, +}; + +static const uint8_t scan_rsp_data_empty[] = { + 0x01, /* scan rsp data len */ + 0x00, /* scan rsp data */ + /* placeholder data */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data add_advertising_no_name_set = { + .setup_settings = settings_powered_le, + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_empty_param, + .send_len = sizeof(add_advertising_empty_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = scan_rsp_data_empty, + .expect_hci_len = sizeof(scan_rsp_data_empty), +}; + +static const uint8_t add_advertising_param_name[] = { + 0x01, /* adv instance */ + 0x40, 0x00, 0x00, 0x00, /* flags: Add local name to scan_rsp */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x00, /* scan rsp len */ +}; + +static const uint8_t set_scan_rsp_data_name_fits_in_scrsp[] = { + 0x0c, /* Scan rsp data len */ + 0x0b, /* Local name data len */ + 0x09, /* Complete name */ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ + /* padding */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data add_advertising_name_fits_in_scrsp = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = &set_local_name_cp, + .setup_send_len = sizeof(set_local_name_cp), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_name, + .send_len = sizeof(add_advertising_param_name), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_scan_rsp_data_name_fits_in_scrsp, + .expect_hci_len = sizeof(set_scan_rsp_data_name_fits_in_scrsp), +}; + +static const uint8_t set_scan_rsp_data_shortened_name_fits[] = { + 0x0d, /* Scan rsp data len */ + 0x0c, /* Local name data len */ + 0x08, /* Short name */ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x31, + /* "Test name1" */ + /* padding */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data add_advertising_shortened_name_in_scrsp = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = &set_local_name_longer_cp, + .setup_send_len = sizeof(set_local_name_longer_cp), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_name, + .send_len = sizeof(add_advertising_param_name), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_scan_rsp_data_shortened_name_fits, + .expect_hci_len = sizeof(set_scan_rsp_data_shortened_name_fits), +}; + +static const uint8_t set_scan_rsp_data_short_name_fits[] = { + 0x07, /* Scan rsp data len */ + 0x06, /* Local name data len */ + 0x08, /* Short name */ + 0x54, 0x65, 0x73, 0x74, + /* "Test*/ + /* padding */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const struct generic_data add_advertising_short_name_in_scrsp = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = &set_local_name_long_short_cp, + .setup_send_len = sizeof(set_local_name_long_short_cp), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_name, + .send_len = sizeof(add_advertising_param_name), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_scan_rsp_data_short_name_fits, + .expect_hci_len = sizeof(set_scan_rsp_data_short_name_fits), +}; + +static const uint8_t add_advertising_param_name_data_ok[] = { + 0x01, /* adv instance */ + 0x40, 0x00, 0x00, 0x00, /* flags: local name */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x12, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +static const uint8_t set_scan_rsp_data_param_name_data_ok[] = { + 0x1e, /* Scan rsp data len */ + /* scan rsp data */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0b, /* Local name data len */ + 0x09, /* Complete name */ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x00, + /* "Test name" */ + /* padding */ + 0x00, +}; + +static const struct generic_data add_advertising_name_data_ok = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = &set_local_name_cp, + .setup_send_len = sizeof(set_local_name_cp), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_name_data_ok, + .send_len = sizeof(add_advertising_param_name_data_ok), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_scan_rsp_data_param_name_data_ok, + .expect_hci_len = sizeof(set_scan_rsp_data_param_name_data_ok), +}; + +static const uint8_t add_advertising_param_name_data_inv[] = { + 0x01, /* adv instance */ + 0x40, 0x00, 0x00, 0x00, /* flags: local name */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x14, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const struct generic_data add_advertising_name_data_inv = { + .setup_settings = settings_powered_le, + .setup_send_opcode = MGMT_OP_SET_LOCAL_NAME, + .setup_send_param = &set_local_name_cp, + .setup_send_len = sizeof(set_local_name_cp), + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_name_data_inv, + .send_len = sizeof(add_advertising_param_name_data_inv), + .expect_status = MGMT_STATUS_INVALID_PARAMS, + .expect_param = NULL, + .expect_len = 0, +}; + +static const uint8_t add_advertising_param_name_data_appear[] = { + 0x01, /* adv instance */ + 0x60, 0x00, 0x00, 0x00, /* flags: local name + appearance */ + 0x00, 0x00, /* duration: default */ + 0x00, 0x00, /* timeout: none */ + 0x00, /* adv data len */ + 0x0e, /* scan rsp len */ + /* adv data: */ + /* scan rsp data: */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, +}; + +static const struct setup_mgmt_cmd add_advertising_mgmt_cmd_arr[] = { + { + .send_opcode = MGMT_OP_SET_APPEARANCE, + .send_param = set_appearance_param, + .send_len = sizeof(set_appearance_param), + }, + { + .send_opcode = MGMT_OP_SET_LOCAL_NAME, + .send_param = &set_local_name_cp, + .send_len = sizeof(set_local_name_cp), + }, + { /* last element should always have opcode 0x00 */ + .send_opcode = 0x00, + .send_param = NULL, + .send_len = 0, + } +}; + +static const uint8_t set_scan_rsp_data_name_data_appear[] = { + 0x1e, /* Scan rsp data len */ + 0x03, /* appearance len */ + 0x19, /* EIR_APPEARANCE */ + 0x54, 0x65, /* appearance value */ + /* scan rsp data */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x0b, /* Local name data len */ + 0x09, /* Complete name */ + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x00, + /* "Test name" */ + /* padding */ + 0x00, +}; + +static const struct generic_data add_advertising_name_data_appear = { + .setup_settings = settings_powered_le, + .setup_mgmt_cmd_arr = add_advertising_mgmt_cmd_arr, + .send_opcode = MGMT_OP_ADD_ADVERTISING, + .send_param = add_advertising_param_name_data_appear, + .send_len = sizeof(add_advertising_param_name_data_appear), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = advertising_instance1_param, + .expect_len = sizeof(advertising_instance1_param), + .expect_hci_command = BT_HCI_CMD_LE_SET_SCAN_RSP_DATA, + .expect_hci_param = set_scan_rsp_data_name_data_appear, + .expect_hci_len = sizeof(set_scan_rsp_data_name_data_appear), +}; + +static const struct generic_data set_appearance_not_supported = { + .send_opcode = MGMT_OP_SET_APPEARANCE, + .send_param = set_appearance_param, + .send_len = sizeof(set_appearance_param), + .expect_status = MGMT_STATUS_NOT_SUPPORTED, + .expect_param = NULL, + .expect_len = 0, +}; + +static const struct generic_data set_appearance_success = { + .send_opcode = MGMT_OP_SET_APPEARANCE, + .send_param = set_appearance_param, + .send_len = sizeof(set_appearance_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = NULL, + .expect_len = 0, +}; + static bool power_off(uint16_t index) { int sk, err; @@ -6397,6 +7349,18 @@ int main(int argc, char *argv[]) &set_adv_on_rejected_test_1, NULL, test_command_generic); + test_bredrle("Set Advertising on - Appearance 1", + &set_adv_on_appearance_test_1, + setup_command_generic, test_command_generic); + + test_bredrle("Set Advertising on - Local name 1", + &set_adv_on_local_name_test_1, + setup_command_generic, test_command_generic); + + test_bredrle("Set Advertising on - Name + Appear 1", + &set_adv_on_local_name_appear_test_1, + setup_command_generic, test_command_generic); + test_bredrle("Set BR/EDR off - Success 1", &set_bredr_off_success_test_1, NULL, test_command_generic); @@ -6653,6 +7617,9 @@ int main(int argc, char *argv[]) test_le("Pair Device - LE SC Success 2", &pair_device_le_sc_success_test_2, NULL, test_command_generic); + test_bredrle("Pair Device - LE SC Success 3", + &pair_device_le_sc_success_test_3, + NULL, test_command_generic); test_bredrle("Pairing Acceptor - Legacy 1", &pairing_acceptor_legacy_1, NULL, @@ -6976,10 +7943,69 @@ int main(int argc, char *argv[]) setup_add_advertising, test_command_generic); + test_bredrle("Add Advertising - Success (Empty ScRsp)", + &add_advertising_empty_scrsp, + setup_command_generic, + test_command_generic); + + test_bredrle("Add Advertising - Success (ScRsp only)", + &add_advertising_scrsp_data_only_ok, + NULL, test_command_generic); + + test_bredrle("Add Advertising - Invalid Params (ScRsp too long)", + &add_advertising_scrsp_data_only_too_long, + NULL, test_command_generic); + + test_bredrle("Add Advertising - Success (ScRsp appear)", + &add_advertising_scrsp_appear_data_ok, + setup_command_generic, test_command_generic); + + test_bredrle("Add Advertising - Invalid Params (ScRsp appear long)", + &add_advertising_scrsp_appear_data_too_long, + setup_command_generic, test_command_generic); + + test_bredrle("Add Advertising - Success (Appear is null)", + &add_advertising_scrsp_appear_null, + NULL, test_command_generic); + + test_bredrle("Add Advertising - Success (Name is null)", + &add_advertising_no_name_set, + NULL, test_command_generic); + + test_bredrle("Add Advertising - Success (Complete name)", + &add_advertising_name_fits_in_scrsp, + setup_command_generic, + test_command_generic); + + test_bredrle("Add Advertising - Success (Shortened name)", + &add_advertising_shortened_name_in_scrsp, + setup_command_generic, + test_command_generic); + + test_bredrle("Add Advertising - Success (Short name)", + &add_advertising_short_name_in_scrsp, + setup_command_generic, + test_command_generic); + + test_bredrle("Add Advertising - Success (Name + data)", + &add_advertising_name_data_ok, + setup_command_generic, + test_command_generic); + + test_bredrle("Add Advertising - Invalid Params (Name + data)", + &add_advertising_name_data_inv, + setup_command_generic, + test_command_generic); + + test_bredrle("Add Advertising - Success (Name+data+appear)", + &add_advertising_name_data_appear, + setup_command_generic, + test_command_generic); test_bredrle("Remove Advertising - Invalid Params 1", &remove_advertising_fail_1, NULL, test_command_generic); + test_bredrle("Remove Advertising - Success 1", &remove_advertising_success_1, setup_add_advertising, @@ -7005,6 +8031,41 @@ int main(int argc, char *argv[]) setup_add_advertising_duration, test_command_generic, 3); + test_bredr("Set appearance - BR/EDR only", + &set_appearance_not_supported, + NULL, + test_command_generic); + + test_bredrle("Set appearance - BR/EDR LE", + &set_appearance_success, + NULL, + test_command_generic); + + test_le("Set appearance - LE only", + &set_appearance_success, + NULL, + test_command_generic); + + test_bredrle("Read Ext Controller Info 1", + &read_ext_ctrl_info1, + NULL, test_command_generic); + + test_bredrle("Read Ext Controller Info 2", + &read_ext_ctrl_info2, + setup_command_generic, test_command_generic); + + test_bredrle("Read Ext Controller Info 3", + &read_ext_ctrl_info3, + setup_command_generic, test_command_generic); + + test_bredrle("Read Ext Controller Info 4", + &read_ext_ctrl_info4, + setup_command_generic, test_command_generic); + + test_bredrle("Read Ext Controller Info 5", + &read_ext_ctrl_info5, + setup_command_generic, test_command_generic); + test_bredrle("Read Local OOB Data - Not powered", &read_local_oob_not_powered_test, NULL, test_command_generic); diff --git a/tools/mpris-proxy.c b/tools/mpris-proxy.c old mode 100644 new mode 100755 diff --git a/tools/nokfw.c b/tools/nokfw.c old mode 100644 new mode 100755 diff --git a/tools/obex-client-tool.c b/tools/obex-client-tool.c old mode 100644 new mode 100755 diff --git a/tools/obex-server-tool.c b/tools/obex-server-tool.c old mode 100644 new mode 100755 diff --git a/tools/obexctl.c b/tools/obexctl.c old mode 100644 new mode 100755 diff --git a/tools/oobtest.c b/tools/oobtest.c old mode 100644 new mode 100755 diff --git a/tools/parse_companies.pl b/tools/parse_companies.pl deleted file mode 100644 index 6dc358e..0000000 --- a/tools/parse_companies.pl +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/perl - -# parse companies from -# https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers - -use strict; -# use URI::Encode qw(uri_decode); - -my %known_entities = ( - 'nbsp' => ' ', - 'eacute' => 'é', - 'auml' => 'ä', -); - -# better to use URI::Encode if you have it -sub uri_decode { - my $name = $_[0]; - foreach my $entity (keys %known_entities) { - my $to = $known_entities{$entity}; - $name =~ s/&$entity;/$to/g; - } - foreach my $entity (map { lc $_ } $name =~ /&([^;]+);/g) { - if ($entity ne 'amp') { - print "Unable to convert &$entity;, giving up\n"; - exit 1; - } - } - $name =~ s/&/&/ig; - $name =~ s/ / /ig; - return $name; -} - -# never parse HTML with regex! -# except when you should - -my $identifier; -my $next_is_name = 0; - -while (<>) { - s/\xe2\x80\x8b//g; # kill zero width space - - # grab identifier (in hex) - if (/\ should be company name - } elsif ($next_is_name && m|\(.*)\|) { - my $name = uri_decode($1); - $name =~ s/^\s+//g; # kill leading - $name =~ s/\s+$//g; # and trailing space - my $id = hex($identifier); - if ($id != 65535) { - print "\tcase $id:\n"; - print "\t\treturn \"$name\";\n"; - } - $next_is_name = 0; - } -} diff --git a/tools/parser/amp.c b/tools/parser/amp.c old mode 100644 new mode 100755 diff --git a/tools/parser/att.c b/tools/parser/att.c old mode 100644 new mode 100755 diff --git a/tools/parser/avctp.c b/tools/parser/avctp.c old mode 100644 new mode 100755 diff --git a/tools/parser/avdtp.c b/tools/parser/avdtp.c old mode 100644 new mode 100755 diff --git a/tools/parser/avrcp.c b/tools/parser/avrcp.c old mode 100644 new mode 100755 diff --git a/tools/parser/bnep.c b/tools/parser/bnep.c old mode 100644 new mode 100755 diff --git a/tools/parser/bpa.c b/tools/parser/bpa.c old mode 100644 new mode 100755 diff --git a/tools/parser/capi.c b/tools/parser/capi.c old mode 100644 new mode 100755 diff --git a/tools/parser/cmtp.c b/tools/parser/cmtp.c old mode 100644 new mode 100755 diff --git a/tools/parser/csr.c b/tools/parser/csr.c old mode 100644 new mode 100755 diff --git a/tools/parser/ericsson.c b/tools/parser/ericsson.c old mode 100644 new mode 100755 diff --git a/tools/parser/hci.c b/tools/parser/hci.c old mode 100644 new mode 100755 diff --git a/tools/parser/hcrp.c b/tools/parser/hcrp.c old mode 100644 new mode 100755 diff --git a/tools/parser/hidp.c b/tools/parser/hidp.c old mode 100644 new mode 100755 diff --git a/tools/parser/l2cap.c b/tools/parser/l2cap.c old mode 100644 new mode 100755 diff --git a/tools/parser/l2cap.h b/tools/parser/l2cap.h old mode 100644 new mode 100755 index 6bd5b2f..788aef0 --- a/tools/parser/l2cap.h +++ b/tools/parser/l2cap.h @@ -179,18 +179,6 @@ typedef struct { } __attribute__ ((packed)) l2cap_conf_opt; #define L2CAP_CONF_OPT_SIZE 2 -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY -typedef struct { - uint8_t mode; - uint8_t txwin_size; - uint8_t max_transmit; - uint16_t retrans_timeout; - uint16_t monitor_timeout; - uint16_t max_pdu_size; -} __attribute__ ((packed)) l2cap_conf_rfc ; -#define L2CAP_CONF_RFC_SIZE 9 -#endif - #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 #define L2CAP_CONF_QOS 0x03 diff --git a/tools/parser/lmp.c b/tools/parser/lmp.c old mode 100644 new mode 100755 diff --git a/tools/parser/obex.c b/tools/parser/obex.c old mode 100644 new mode 100755 diff --git a/tools/parser/parser.c b/tools/parser/parser.c old mode 100644 new mode 100755 diff --git a/tools/parser/parser.h b/tools/parser/parser.h old mode 100644 new mode 100755 diff --git a/tools/parser/ppp.c b/tools/parser/ppp.c old mode 100644 new mode 100755 diff --git a/tools/parser/rfcomm.c b/tools/parser/rfcomm.c old mode 100644 new mode 100755 diff --git a/tools/parser/rfcomm.h b/tools/parser/rfcomm.h old mode 100644 new mode 100755 diff --git a/tools/parser/sap.c b/tools/parser/sap.c old mode 100644 new mode 100755 diff --git a/tools/parser/sdp.c b/tools/parser/sdp.c old mode 100644 new mode 100755 diff --git a/tools/parser/sdp.h b/tools/parser/sdp.h old mode 100644 new mode 100755 diff --git a/tools/parser/smp.c b/tools/parser/smp.c old mode 100644 new mode 100755 diff --git a/tools/parser/tcpip.c b/tools/parser/tcpip.c old mode 100644 new mode 100755 diff --git a/tools/pskey_get.c b/tools/pskey_get.c deleted file mode 100644 index db4d228..0000000 --- a/tools/pskey_get.c +++ /dev/null @@ -1,384 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#define LOG_TAG "pskey" -// #include "cutils/log.h" - -#include "hciattach_sprd.h" -//#include "bt_vendor_sprd.h" -#define BT_PSKEY_TRACE_BUF_SIZE 256 -#define MAX_BOARD_TYPE_LEN 32 - -#define _FILE_PARSE_DEBUG_ -#define CMD_ITEM_TABLE(ITEM, MEM_OFFSET, TYPE) { ITEM, (unsigned int)( &( ((BT_PSKEY_CONFIG_T *)(0))->MEM_OFFSET )), TYPE } -#define ALOGI(fmt, arg...) fprintf(stderr, "%s:%d()" fmt "\n", __FILE__,__LINE__, ## arg) -#define ALOGE(fmt, arg...) fprintf(stderr, "%s:%d()" fmt "\n", __FILE__,__LINE__, ## arg) - -#define PSKEY_PATH "/usr/lib/firmware/scx35_pikeavivaltove_3M_MARLIN_connectivity_configure.ini" - -typedef struct -{ - char item[64]; - uint32 par[32]; - int num; -}cmd_par; - -typedef struct -{ - char *item; - unsigned int mem_offset; - int type; -}cmd_par_table; - -static cmd_par_table g_pskey_table[] = -{ - CMD_ITEM_TABLE("pskey_cmd", pskey_cmd, 4), - - CMD_ITEM_TABLE("g_dbg_source_sink_syn_test_data", g_dbg_source_sink_syn_test_data, 1), - CMD_ITEM_TABLE("g_sys_sleep_in_standby_supported", g_sys_sleep_in_standby_supported, 1), - CMD_ITEM_TABLE("g_sys_sleep_master_supported", g_sys_sleep_master_supported, 1), - CMD_ITEM_TABLE("g_sys_sleep_slave_supported", g_sys_sleep_slave_supported, 1), - - CMD_ITEM_TABLE("default_ahb_clk", default_ahb_clk, 4), - CMD_ITEM_TABLE("device_class", device_class, 4), - CMD_ITEM_TABLE("win_ext", win_ext, 4), - - CMD_ITEM_TABLE("g_aGainValue", g_aGainValue, 4), - CMD_ITEM_TABLE("g_aPowerValue", g_aPowerValue, 4), - - CMD_ITEM_TABLE("feature_set", feature_set, 1), - CMD_ITEM_TABLE("device_addr", device_addr, 1), - - CMD_ITEM_TABLE("g_sys_sco_transmit_mode", g_sys_sco_transmit_mode, 1), //true tramsmit by uart, otherwise by share memory - CMD_ITEM_TABLE("g_sys_uart0_communication_supported", g_sys_uart0_communication_supported, 1), //true use uart0, otherwise use uart1 for debug - CMD_ITEM_TABLE("edr_tx_edr_delay", edr_tx_edr_delay, 1), - CMD_ITEM_TABLE("edr_rx_edr_delay", edr_rx_edr_delay, 1), - - CMD_ITEM_TABLE("g_wbs_nv_117", g_wbs_nv_117, 2), - - - CMD_ITEM_TABLE("is_wdg_supported", is_wdg_supported, 4), - - CMD_ITEM_TABLE("share_memo_rx_base_addr", share_memo_rx_base_addr, 4), - //CMD_ITEM_TABLE("share_memo_tx_base_addr", share_memo_tx_base_addr, 4), - - CMD_ITEM_TABLE("g_wbs_nv_118", g_wbs_nv_118, 2), - CMD_ITEM_TABLE("g_nbv_nv_117", g_nbv_nv_117, 2), - - - CMD_ITEM_TABLE("share_memo_tx_packet_num_addr", share_memo_tx_packet_num_addr, 4), - CMD_ITEM_TABLE("share_memo_tx_data_base_addr", share_memo_tx_data_base_addr, 4), - - CMD_ITEM_TABLE("g_PrintLevel", g_PrintLevel, 4), - - CMD_ITEM_TABLE("share_memo_tx_block_length", share_memo_tx_block_length, 2), - CMD_ITEM_TABLE("share_memo_rx_block_length", share_memo_rx_block_length, 2), - CMD_ITEM_TABLE("share_memo_tx_water_mark", share_memo_tx_water_mark, 2), - //CMD_ITEM_TABLE("share_memo_tx_timeout_value", share_memo_tx_timeout_value, 2), - CMD_ITEM_TABLE("g_nbv_nv_118", g_nbv_nv_118, 2), - - CMD_ITEM_TABLE("uart_rx_watermark", uart_rx_watermark, 2), - CMD_ITEM_TABLE("uart_flow_control_thld", uart_flow_control_thld, 2), - CMD_ITEM_TABLE("comp_id", comp_id, 4), - CMD_ITEM_TABLE("pcm_clk_divd", pcm_clk_divd, 2), - - - CMD_ITEM_TABLE("bt_reserved", reserved, 4) -}; - -static int bt_getFileSize(char *file) -{ - struct stat temp; - stat(file, &temp); - return temp.st_size; -} - -static int bt_find_type(char key) -{ - if( (key >= 'a' && key <= 'w') || (key >= 'y' && key <= 'z') || (key >= 'A' && key <= 'W') || (key >= 'Y' && key <= 'Z') || ('_' == key) ) - return 1; - if( (key >= '0' && key <= '9') || ('-' == key) ) - return 2; - if( ('x' == key) || ('X' == key) || ('.' == key) ) - return 3; - if( (key == '\0') || ('\r' == key) || ('\n' == key) || ('#' == key) ) - return 4; - return 0; -} - -static void bt_getCmdOneline(unsigned char *str, cmd_par *cmd) -{ - int i, j, bufType, cType, flag; - char tmp[BT_PSKEY_TRACE_BUF_SIZE]; - char c; - bufType = -1; - cType = 0; - flag = 0; - memset( cmd, 0, sizeof(cmd_par) ); - for(i = 0, j = 0; ; i++) - { - c = str[i]; - cType = bt_find_type(c); - if( (1 == cType) || ( 2 == cType) || (3 == cType) ) - { - tmp[j] = c; - j++; - if(-1 == bufType) - { - if(2 == cType) - bufType = 2; - else - bufType = 1; - } - else if(2 == bufType) - { - if(1 == cType) - bufType = 1; - } - continue; - } - if(-1 != bufType) - { - tmp[j] = '\0'; - - if((1 == bufType) && (0 == flag) ) - { - strcpy(cmd->item, tmp); - flag = 1; - } - else - { - /* compatible with HEX */ - if (tmp[0] == '0' && (tmp[1] == 'x' || tmp[1] == 'X')) { - cmd->par[cmd->num] = strtoul(tmp, 0, 16) & 0xFFFFFFFF; - cmd->num++; - } else { - cmd->par[cmd->num] = strtoul(tmp, 0, 10) & 0xFFFFFFFF; - cmd->num++; - } - } - bufType = -1; - j = 0; - } - if(0 == cType ) - continue; - if(4 == cType) - return; - } - return; -} - -static int bt_getDataFromCmd(cmd_par_table *pTable, cmd_par *cmd, void *pData) -{ - int i; - unsigned char *p; - if( (1 != pTable->type) && (2 != pTable->type) && (4 != pTable->type) ) - return -1; - p = (unsigned char *)(pData) + pTable->mem_offset; -#ifdef _FILE_PARSE_DEBUG_ - char tmp[BT_PSKEY_TRACE_BUF_SIZE] = {0}; - char string[16] = {0}; - sprintf(tmp, "###[pskey]%s, offset:%d, num:%d, value: ", pTable->item, pTable->mem_offset, cmd->num); - for(i=0; inum; i++) - { - memset(string, 0, 16); - sprintf(string, "0x%x, ", cmd->par[i] ); - strcat(tmp, string); - } - ALOGI("%s\n", tmp); -#endif - for(i = 0; i < cmd->num; i++) - { - if(1 == pTable->type) - *((unsigned char *)p + i) = (unsigned char)(cmd->par[i]); - else if(2 == pTable->type) - *((unsigned short *)p + i) = (unsigned short)(cmd->par[i]); - else if(4 == pTable->type) - *( (unsigned int *)p + i) = (unsigned int)(cmd->par[i]); - else - ALOGE("%s, type err\n", __func__); - } - return 0; -} - -static cmd_par_table *bt_cmd_table_match(cmd_par *cmd) -{ - int i; - cmd_par_table *pTable = NULL; - int len = sizeof(g_pskey_table) / sizeof(cmd_par_table); - if(NULL == cmd->item) - return NULL; - for(i = 0; i < len; i++) - { - if(NULL == g_pskey_table[i].item) - continue; - if( 0 != strcmp( g_pskey_table[i].item, cmd->item ) ) - continue; - pTable = &g_pskey_table[i]; - break; - } - return pTable; -} - - -static int bt_getDataFromBuf(void *pData, unsigned char *pBuf, int file_len) -{ - int i, p; - cmd_par cmd; - cmd_par_table *pTable = NULL; - if((NULL == pBuf) || (0 == file_len) || (NULL == pData) ) - return -1; - for(i = 0, p = 0; i < file_len; i++) - { - if( ('\n' == *(pBuf + i)) || ( '\r' == *(pBuf + i)) || ( '\0' == *(pBuf + i) ) ) - { - if(5 <= (i - p) ) - { - bt_getCmdOneline((pBuf + p), &cmd); - pTable = bt_cmd_table_match(&cmd); - if(NULL != pTable) - { - bt_getDataFromCmd(pTable, &cmd, pData); - } - } - p = i + 1; - } - - } - return 0; -} - -static int bt_dumpPskey(BT_PSKEY_CONFIG_T *p) -{ - ALOGI("pskey_cmd: 0x%08X", p->pskey_cmd); - - ALOGI("g_dbg_source_sink_syn_test_data: 0x%02X", p->g_dbg_source_sink_syn_test_data); - ALOGI("g_sys_sleep_in_standby_supported: 0x%02X", p->g_sys_sleep_in_standby_supported); - ALOGI("g_sys_sleep_master_supported: 0x%02X", p->g_sys_sleep_master_supported); - ALOGI("g_sys_sleep_slave_supported: 0x%02X", p->g_sys_sleep_slave_supported); - - ALOGI("default_ahb_clk: %d", p->default_ahb_clk); - ALOGI("device_class: 0x%08X", p->device_class); - ALOGI("win_ext: 0x%08X", p->win_ext); - - ALOGI("g_aGainValue: 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X", p->g_aGainValue[0], p->g_aGainValue[1], p->g_aGainValue[2], p->g_aGainValue[3], p->g_aGainValue[4], p->g_aGainValue[5]); - ALOGI("g_aPowerValue: 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X", p->g_aPowerValue[0], p->g_aPowerValue[1], p->g_aPowerValue[2], p->g_aPowerValue[3], p->g_aPowerValue[4]); - - - ALOGI("feature_set(0~7): 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X", p->feature_set[0], p->feature_set[1], p->feature_set[2], - p->feature_set[3], p->feature_set[4], p->feature_set[5], p->feature_set[6], p->feature_set[7]); - ALOGI("feature_set(8~15): 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X", p->feature_set[8], p->feature_set[9], p->feature_set[10], - p->feature_set[11], p->feature_set[12], p->feature_set[13], p->feature_set[14], p->feature_set[15]); - ALOGI("device_addr: 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X", p->device_addr[0], p->device_addr[1], p->device_addr[2], p->device_addr[3], p->device_addr[4], p->device_addr[5]); - - ALOGI("g_sys_sco_transmit_mode: 0x%02X", p->g_sys_sco_transmit_mode); - ALOGI("g_sys_uart0_communication_supported: 0x%02X", p->g_sys_uart0_communication_supported); - ALOGI("edr_tx_edr_delay: %d", p->edr_tx_edr_delay); - ALOGI("edr_rx_edr_delay: %d", p->edr_rx_edr_delay); - - ALOGI("g_wbs_nv_117 : 0x%04X", p->g_wbs_nv_117 ); - - ALOGI("is_wdg_supported: 0x%08X", p->is_wdg_supported); - - ALOGI("share_memo_rx_base_addr: 0x%08X", p->share_memo_rx_base_addr); - //ALOGI("share_memo_tx_base_addr: 0x%08X", p->share_memo_tx_base_addr); - ALOGI("g_wbs_nv_118 : 0x%04X", p->g_wbs_nv_118 ); - ALOGI("g_nbv_nv_117 : 0x%04X", p->g_nbv_nv_117 ); - - - ALOGI("share_memo_tx_packet_num_addr: 0x%08X", p->share_memo_tx_packet_num_addr); - ALOGI("share_memo_tx_data_base_addr: 0x%08X", p->share_memo_tx_data_base_addr); - - ALOGI("g_PrintLevel: 0x%08X", p->g_PrintLevel); - - ALOGI("share_memo_tx_block_length: 0x%04X", p->share_memo_tx_block_length); - ALOGI("share_memo_rx_block_length: 0x%04X", p->share_memo_rx_block_length); - ALOGI("share_memo_tx_water_mark: 0x%04X", p->share_memo_tx_water_mark); - //ALOGI("share_memo_tx_timeout_value: 0x%04X", p->share_memo_tx_timeout_value); - ALOGI("g_nbv_nv_118 : 0x%04X", p->g_nbv_nv_118 ); - - ALOGI("uart_rx_watermark: %d", p->uart_rx_watermark); - ALOGI("uart_flow_control_thld: %d", p->uart_flow_control_thld); - ALOGI("comp_id: 0x%08X", p->comp_id); - ALOGI("pcm_clk_divd : 0x%04X", p->pcm_clk_divd ); - - - ALOGI("reserved(0~7): 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X", p->reserved[0], p->reserved[1], p->reserved[2], - p->reserved[3], p->reserved[4], p->reserved[5], p->reserved[6], p->reserved[7]); - return 0; -} -#if 0 -static int bt_get_config_ver(unsigned char *pBuf, int len) -{ - int i, p; - cmd_par cmd; - int ret = -1; - for(i = 0, p = 0; i < len; i++) - { - if( ('\n' == *(pBuf + i)) || ( '\r' == *(pBuf + i)) || ( '\0' == *(pBuf + i) ) ) - { - if(5 <= (i - p) ) - { - bt_getCmdOneline((pBuf + p), &cmd); - if( 0 == strcmp(cmd.item, "version") ) - { - ret = cmd.par[0]; - break; - } - memset(&cmd, 0, sizeof(cmd_par) ); - } - p = i + 1; - } - - } - return ret; -} -#endif -int bt_getPskeyFromFile(void *pData) -{ - int ret = -1; - int fd; - unsigned char *pBuf = NULL; - int len; - - ALOGI("begin to bt_getPskeyFromFile"); - fd = open(PSKEY_PATH, O_RDONLY, 0644); - if(-1 != fd) - { - len = bt_getFileSize(PSKEY_PATH); - pBuf = (unsigned char *)malloc(len); - ret = read(fd, pBuf, len); - if(-1 == ret) - { - ALOGE("%s read %s ret:%d\n", __FUNCTION__, PSKEY_PATH, ret); - free(pBuf); - close(fd); - return -1; - } - close(fd); - } - else - { - ALOGE("%s open %s ret:%d\n", __FUNCTION__, PSKEY_PATH, fd); - return -1; - } - - ret = bt_getDataFromBuf(pData, pBuf, len); - if(-1 == ret) - { - free(pBuf); - return -1; - } - ALOGI("begin to dumpPskey"); - bt_dumpPskey((BT_PSKEY_CONFIG_T *)pData); - free(pBuf); - return 0; -} - - diff --git a/tools/rctest.1 b/tools/rctest.1 old mode 100644 new mode 100755 diff --git a/tools/rctest.c b/tools/rctest.c old mode 100644 new mode 100755 diff --git a/tools/rfcomm-tester.c b/tools/rfcomm-tester.c old mode 100644 new mode 100755 diff --git a/tools/rfcomm.1 b/tools/rfcomm.1 old mode 100644 new mode 100755 diff --git a/tools/rfcomm.c b/tools/rfcomm.c old mode 100644 new mode 100755 diff --git a/tools/sco-tester.c b/tools/sco-tester.c old mode 100644 new mode 100755 diff --git a/tools/scotest.c b/tools/scotest.c old mode 100644 new mode 100755 index 596e403..f894c24 --- a/tools/scotest.c +++ b/tools/scotest.c @@ -265,7 +265,7 @@ static void dump_mode(int sk) syslog(LOG_INFO,"Receiving ..."); while ((len = read(sk, buf, data_size)) > 0) - syslog(LOG_INFO, "Recevied %d bytes", len); + syslog(LOG_INFO, "Received %d bytes", len); } static void recv_mode(int sk) diff --git a/tools/sdptool.1 b/tools/sdptool.1 old mode 100644 new mode 100755 diff --git a/tools/sdptool.c b/tools/sdptool.c old mode 100644 new mode 100755 index 0881c6f..b1cbcfd --- a/tools/sdptool.c +++ b/tools/sdptool.c @@ -1219,11 +1219,7 @@ static int add_sp(sdp_session_t *session, svc_info_t *si) sdp_set_service_classes(&record, svclass_id); sdp_uuid16_create(&profile.uuid, SERIAL_PORT_PROFILE_ID); -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - profile.version = 0x0102; -#else profile.version = 0x0100; -#endif profiles = sdp_list_append(0, &profile); sdp_set_profile_descs(&record, profiles); diff --git a/tools/seq2bseq.c b/tools/seq2bseq.c old mode 100644 new mode 100755 diff --git a/tools/smp-tester.c b/tools/smp-tester.c old mode 100644 new mode 100755 index d24c9b2..90b091e --- a/tools/smp-tester.c +++ b/tools/smp-tester.c @@ -593,7 +593,7 @@ static bool verify_random(const uint8_t rnd[16]) data->ra_type, data->ra, confirm)) return false; - if (memcmp(data->pcnf, confirm, sizeof(data->pcnf) != 0)) { + if (memcmp(data->pcnf, confirm, sizeof(data->pcnf)) != 0) { tester_warn("Confirmation values don't match"); return false; } diff --git a/tools/test-runner.c b/tools/test-runner.c old mode 100644 new mode 100755 index b4587ff..9b54426 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -5,18 +5,18 @@ * Copyright (C) 2012-2014 Intel Corporation. All rights reserved. * * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -544,11 +544,7 @@ static const char *test_table[] = { static void run_command(char *cmdname, char *home) { -#ifdef TIZEN_FEATURE_BLUEZ_MODIFY - char *argv[10], *envp[3]; -#else char *argv[9], *envp[3]; -#endif int pos = 0, idx = 0; int serial_fd; pid_t pid, dbus_pid, daemon_pid; diff --git a/tools/ubcsp.c b/tools/ubcsp.c old mode 100644 new mode 100755 diff --git a/tools/ubcsp.h b/tools/ubcsp.h old mode 100644 new mode 100755 diff --git a/tools/update_compids.sh b/tools/update_compids.sh deleted file mode 100644 index 95c961d..0000000 --- a/tools/update_compids.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# Download the list of company IDs from bluetooth.org and generate a diff which -# can be applied to source tree to update bt_compidtostr(). Usage: -# -# 1) ./tools/update_compids.sh | git apply -p0 -# 2) Inspect changes to make sure they are sane -# 3) git commit -m "lib: Update list of company identifiers" lib/bluetooth.c -# -# Requires html2text: http://www.mbayer.de/html2text/ -# -set -e -u - -tmpdir=$(mktemp -d) -trap "rm -rf $tmpdir" EXIT - -mkdir $tmpdir/lib -cp lib/bluetooth.c $tmpdir/lib/bluetooth.c.orig -cp lib/bluetooth.c $tmpdir/lib/bluetooth.c - -cd $tmpdir - -path=en-us/specification/assigned-numbers/company-identifiers -# Use "iconv -c" to strip unwanted unicode characters -# Fixups: -# - strip tags of type "checkbox" because html2text generates UTF-8 for -# them in some distros even when using -ascii (e.g. Fedora) -# - replace " " (non-breaking space) with whitespace manually, because -# some versions incorrectly convert it into "\xC2\xA0" -curl https://www.bluetooth.org/$path | iconv -c -f utf8 -t ascii | \ - sed '//dev/null - -# Some versions of html2text do not replace & (e.g. Fedora) -sed -i 's/&/\&/g' identifiers.txt - -sed -n '/^const char \*bt_compidtostr(int compid)/,/^}/p' \ - lib/bluetooth.c > old.c - -echo -e 'const char *bt_compidtostr(int compid)\n{\n\tswitch (compid) {' > new.c -cat identifiers.txt | - perl -ne 'm/^(\d+)\s+0x[0-9a-f]+\s+(.*)/i && - print "\tcase $1:\n\t\treturn \"$2\";\n"' >> new.c -if ! grep -q "return \"" new.c; then - echo "ERROR: could not parse company IDs from bluetooth.org" >&2 - exit 1 -fi -if [ -n "$(tr -d '[:print:]\t\n' < new.c)" ]; then - echo -n "ERROR: invalid non-ASCII characters found while parsing" >&2 - echo -n " company IDs. Please identify offending sequence and fix" >&2 - echo " tools/update_compids.sh accordingly." >&2 - exit 1 -fi -echo -e '\tcase 65535:\n\t\treturn "internal use";' >> new.c -echo -e '\tdefault:\n\t\treturn "not assigned";\n\t}\n}' >> new.c - -diff -Naur old.c new.c | patch -sp0 lib/bluetooth.c -diff -Naur lib/bluetooth.c.orig lib/bluetooth.c diff --git a/tools/userchan-tester.c b/tools/userchan-tester.c old mode 100644 new mode 100755 diff --git a/tools/valgrind.supp b/tools/valgrind.supp deleted file mode 100644 index 9efb6f1..0000000 --- a/tools/valgrind.supp +++ /dev/null @@ -1,27 +0,0 @@ -{ - ecb_bind - Memcheck:Param - socketcall.bind(my_addr.sa_data) - fun:bind - fun:ecb_aes_setup -} -{ - cmac_bind - Memcheck:Param - socketcall.bind(my_addr.sa_data) - fun:bind - fun:cmac_aes_setup -} -{ - logging_open - Memcheck:Param - socketcall.bind(my_addr.rc_bdaddr) - fun:bind - fun:logging_open -} -{ - bind - Memcheck:Param - socketcall.bind(my_addr.rc_channel) - fun:bind -} diff --git a/unit/test-avctp.c b/unit/test-avctp.c old mode 100644 new mode 100755 diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c old mode 100644 new mode 100755 diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c old mode 100644 new mode 100755 diff --git a/unit/test-crc.c b/unit/test-crc.c old mode 100644 new mode 100755 diff --git a/unit/test-crypto.c b/unit/test-crypto.c old mode 100644 new mode 100755 index 5fb1c64..bc37abb --- a/unit/test-crypto.c +++ b/unit/test-crypto.c @@ -34,10 +34,54 @@ static struct bt_crypto *crypto; +static void print_debug(const char *str, void *user_data) +{ + tester_debug("%s", str); +} + +static void test_h6(gconstpointer data) +{ + const uint8_t w[16] = { + 0x9b, 0x7d, 0x39, 0x0a, 0xa6, 0x10, 0x10, 0x34, + 0x05, 0xad, 0xc8, 0x57, 0xa3, 0x34, 0x02, 0xec }; + const uint8_t m[4] = { 0x72, 0x62, 0x65, 0x6c }; + const uint8_t exp[16] = { + 0x99, 0x63, 0xb1, 0x80, 0xe2, 0xa9, 0xd3, 0xe8, + 0x1c, 0xc9, 0x6d, 0xe7, 0x02, 0xe1, 0x9a, 0x2d }; + uint8_t res[16]; + + tester_debug("W:"); + util_hexdump(' ', w, 16, print_debug, NULL); + + tester_debug("M:"); + util_hexdump(' ', m, 4, print_debug, NULL); + + if (!bt_crypto_h6(crypto, w, m, res)) { + tester_test_failed(); + return; + } + + tester_debug("Expected:"); + util_hexdump(' ', exp, 16, print_debug, NULL); + + tester_debug("Result:"); + util_hexdump(' ', res, 16, print_debug, NULL); + + + if (memcmp(res, exp, 16)) { + tester_test_failed(); + return; + } + + tester_test_passed(); +} + struct test_data { const uint8_t *msg; uint16_t msg_len; const uint8_t *t; + const uint8_t *key; + uint32_t cnt; }; static const uint8_t key[] = { @@ -54,7 +98,8 @@ static const uint8_t t_msg_1[] = { static const struct test_data test_data_1 = { .msg = msg_1, .msg_len = 0, - .t = t_msg_1 + .t = t_msg_1, + .key = key, }; static const uint8_t msg_2[] = { @@ -70,7 +115,8 @@ static const uint8_t t_msg_2[] = { static const struct test_data test_data_2 = { .msg = msg_2, .msg_len = 16, - .t = t_msg_2 + .t = t_msg_2, + .key = key, }; static const uint8_t msg_3[] = { @@ -87,7 +133,8 @@ static const uint8_t t_msg_3[12] = { static const struct test_data test_data_3 = { .msg = msg_3, .msg_len = 40, - .t = t_msg_3 + .t = t_msg_3, + .key = key, }; static const uint8_t msg_4[] = { @@ -106,13 +153,31 @@ static const uint8_t t_msg_4[12] = { static const struct test_data test_data_4 = { .msg = msg_4, .msg_len = 64, - .t = t_msg_4 + .t = t_msg_4, + .key = key, }; -static void print_debug(const char *str, void *user_data) -{ - tester_debug("%s", str); -} +static const uint8_t msg_5[] = { + 0xd2, 0x12, 0x00, 0x13, 0x37 +}; + +static const uint8_t key_5[] = { + 0x50, 0x5E, 0x42, 0xDF, 0x96, 0x91, 0xEC, 0x72, 0xD3, 0x1F, + 0xCD, 0xFB, 0xEB, 0x64, 0x1B, 0x61 +}; + +static const uint8_t t_msg_5[] = { + 0x01, 0x00, 0x00, 0x00, 0xF1, 0x87, 0x1E, 0x93, 0x3C, 0x90, + 0x0F, 0xf2 +}; + +static const struct test_data test_data_5 = { + .msg = msg_5, + .msg_len = sizeof(msg_5), + .t = t_msg_5, + .cnt = 1, + .key = key_5, +}; static bool result_compare(const uint8_t exp[12], uint8_t res[12]) { @@ -130,7 +195,7 @@ static void test_sign(gconstpointer data) const struct test_data *d = data; memset(t, 0, 12); - if (!bt_crypto_sign_att(crypto, key, d->msg, d->msg_len, 0, t)) + if (!bt_crypto_sign_att(crypto, d->key, d->msg, d->msg_len, d->cnt, t)) g_assert(true); tester_debug("Result T:"); @@ -153,10 +218,13 @@ int main(int argc, char *argv[]) tester_init(&argc, &argv); + tester_add("/crypto/h6", NULL, NULL, test_h6, NULL); + tester_add("/crypto/sign_att_1", &test_data_1, NULL, test_sign, NULL); tester_add("/crypto/sign_att_2", &test_data_2, NULL, test_sign, NULL); tester_add("/crypto/sign_att_3", &test_data_3, NULL, test_sign, NULL); tester_add("/crypto/sign_att_4", &test_data_4, NULL, test_sign, NULL); + tester_add("/crypto/sign_att_5", &test_data_5, NULL, test_sign, NULL); exit_status = tester_run(); diff --git a/unit/test-ecc.c b/unit/test-ecc.c old mode 100644 new mode 100755 diff --git a/unit/test-eir.c b/unit/test-eir.c old mode 100644 new mode 100755 diff --git a/unit/test-gatt.c b/unit/test-gatt.c old mode 100644 new mode 100755 index 326a32c..c7a8fa5 --- a/unit/test-gatt.c +++ b/unit/test-gatt.c @@ -209,7 +209,7 @@ struct context { #define PRIMARY_DISC_SMALL_DB \ raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \ - raw_pdu(0x11, 0x06, 0x10, 0xF0, 0x17, 0xF0, 0x00, 0x18, \ + raw_pdu(0x11, 0x06, 0x10, 0xF0, 0x18, 0xF0, 0x00, 0x18, \ 0xFF, 0xFF, 0xFF, 0xFF, 0x0a, 0x18) #define PRIMARY_DISC_LARGE_DB_1 \ @@ -223,7 +223,7 @@ struct context { 0x60, 0x00, 0x6B, 0x00, 0x0B, 0xA0), \ raw_pdu(0x10, 0x6C, 0x00, 0xff, 0xff, 0x00, 0x28), \ raw_pdu(0x11, 0x06, 0x70, 0x00, 0x76, 0x00, 0x0B, 0xA0, \ - 0x80, 0x00, 0x85, 0x00, 0x0B, 0xA0), \ + 0x80, 0x00, 0x86, 0x00, 0x0B, 0xA0), \ raw_pdu(0x10, 0x86, 0x00, 0xff, 0xff, 0x00, 0x28), \ raw_pdu(0x11, 0x14, 0x90, 0x00, 0x96, 0x00, \ 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, \ @@ -244,29 +244,33 @@ struct context { raw_pdu(0x01, 0x10, 0x11, 0x00, 0x0a) #define INCLUDE_DISC_SMALL_DB \ - raw_pdu(0x08, 0x10, 0xf0, 0x17, 0xf0, 0x02, 0x28), \ + raw_pdu(0x08, 0x10, 0xf0, 0x18, 0xf0, 0x02, 0x28), \ raw_pdu(0x09, 0x08, 0x11, 0xf0, 0x01, 0x00, 0x0f, 0x00, \ 0x0a, 0x18), \ - raw_pdu(0x08, 0x12, 0xf0, 0x17, 0xf0, 0x02, 0x28), \ + raw_pdu(0x08, 0x12, 0xf0, 0x18, 0xf0, 0x02, 0x28), \ raw_pdu(0x01, 0x08, 0x12, 0xf0, 0x0a), \ raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x02, 0x28), \ raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a) #define CHARACTERISTIC_DISC_SMALL_DB \ - raw_pdu(0x08, 0x10, 0xf0, 0x17, 0xf0, 0x03, 0x28), \ + raw_pdu(0x08, 0x10, 0xf0, 0x18, 0xf0, 0x03, 0x28), \ raw_pdu(0x09, 0x07, 0x12, 0xf0, 0x02, 0x13, 0xf0, 0x00, \ 0x2a), \ - raw_pdu(0x08, 0x13, 0xf0, 0x17, 0xf0, 0x03, 0x28), \ - raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x02, 0x15, 0xf0, 0xef, \ + raw_pdu(0x08, 0x13, 0xf0, 0x18, 0xf0, 0x03, 0x28), \ + raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x82, 0x15, 0xf0, 0xef, \ 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x00, \ 0x00, 0x00, 0x00, 0x09, 0xB0, 0x00, 0x00), \ - raw_pdu(0x08, 0x15, 0xf0, 0x17, 0xf0, 0x03, 0x28), \ - raw_pdu(0x09, 0x07, 0x16, 0xf0, 0x02, 0x17, 0xf0, 0x01, \ + raw_pdu(0x08, 0x15, 0xf0, 0x18, 0xf0, 0x03, 0x28), \ + raw_pdu(0x09, 0x07, 0x17, 0xf0, 0x02, 0x18, 0xf0, 0x01, \ 0x2a), \ - raw_pdu(0x08, 0x17, 0xf0, 0x17, 0xf0, 0x03, 0x28), \ - raw_pdu(0x01, 0x08, 0x17, 0xf0, 0x0a), \ + raw_pdu(0x08, 0x18, 0xf0, 0x18, 0xf0, 0x03, 0x28), \ + raw_pdu(0x01, 0x08, 0x18, 0xf0, 0x0a), \ + raw_pdu(0x04, 0x16, 0xf0, 0x16, 0xf0), \ + raw_pdu(0x05, 0x01, 0x16, 0xf0, 0x00, 0x29), \ + raw_pdu(0x0a, 0x16, 0xf0), \ + raw_pdu(0x0b, 0x01, 0x00), \ raw_pdu(0x08, 0x01, 0x00, 0x10, 0x00, 0x03, 0x28), \ - raw_pdu(0x09, 0x07, 0x02, 0x00, 0x32, 0x03, 0x00, 0x29, \ + raw_pdu(0x09, 0x07, 0x02, 0x00, 0xb2, 0x03, 0x00, 0x29, \ 0x2a), \ raw_pdu(0x08, 0x03, 0x00, 0x10, 0x00, 0x03, 0x28), \ raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a) @@ -524,9 +528,9 @@ static bool matching_char_data(struct gatt_db_attribute *a, bt_uuid_t a_uuid, b_uuid; gatt_db_attribute_get_char_data(a, &a_handle, &a_value_handle, - &a_properties, &a_uuid); + &a_properties, NULL, &a_uuid); gatt_db_attribute_get_char_data(b, &b_handle, &b_value_handle, - &b_properties, &b_uuid); + &b_properties, NULL, &b_uuid); return a_handle == b_handle && a_value_handle == b_value_handle && a_properties == b_properties && @@ -1554,20 +1558,27 @@ static struct gatt_db *make_test_spec_small_db(void) BT_ATT_PERM_WRITE, BT_GATT_CHRC_PROP_READ | BT_GATT_CHRC_PROP_NOTIFY | - BT_GATT_CHRC_PROP_INDICATE, + BT_GATT_CHRC_PROP_INDICATE | + BT_GATT_CHRC_PROP_EXT_PROP, "BlueZ"), DESCRIPTOR(GATT_CLIENT_CHARAC_CFG_UUID, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, 0x00, 0x00), DESCRIPTOR_STR(GATT_CHARAC_USER_DESC_UUID, BT_ATT_PERM_READ, "Manufacturer Name"), - PRIMARY_SERVICE(0xF010, GAP_UUID, 8), + DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01, + 0x00), + + PRIMARY_SERVICE(0xF010, GAP_UUID, 9), INCLUDE(0x0001), CHARACTERISTIC_STR(GATT_CHARAC_DEVICE_NAME, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ, "BlueZ Unit Tester"), CHARACTERISTIC(0000B009-0000-0000-0123-456789abcdef, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, - BT_GATT_CHRC_PROP_READ, 0x09), + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_EXT_PROP, 0x09), + DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01, + 0x00), CHARACTERISTIC(GATT_CHARAC_APPEARANCE, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ, 0x00, 0x00), PRIMARY_SERVICE(0xFFFF, DEVICE_INFORMATION_UUID, 1), @@ -1607,15 +1618,18 @@ static struct gatt_db *make_test_spec_small_db(void) static struct gatt_db *make_test_spec_large_db_1(void) { const struct att_handle_spec specs[] = { - PRIMARY_SERVICE(0x0080, "a00b", 6), + PRIMARY_SERVICE(0x0080, "a00b", 7), CHARACTERISTIC(0xb008, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, BT_GATT_CHRC_PROP_READ | - BT_GATT_CHRC_PROP_WRITE, + BT_GATT_CHRC_PROP_WRITE | + BT_GATT_CHRC_PROP_EXT_PROP, 0x08), DESCRIPTOR(0xb015, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, 0x01), DESCRIPTOR(0xb016, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, 0x02), DESCRIPTOR(0xb017, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE | BT_ATT_PERM_ENCRYPT, 0x03), + DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01, + 0x00), SECONDARY_SERVICE(0x0001, "a00d", 6), INCLUDE(0x0080), @@ -2400,6 +2414,14 @@ int main(int argc, char *argv[]) 0x18), raw_pdu(0x01, 0x06, 0x08, 0x00, 0x0a)); + define_test_att("/TP/GAD/CL/BV-02-C-1-alternative", + test_search_primary, &uuid_16, + NULL, + MTU_EXCHANGE_CLIENT_PDUS, + raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x00, + 0x18), + raw_pdu(0x07, 0x01, 0x00, 0xFF, 0xFF)); + define_test_att("/TP/GAD/CL/BV-02-C-2", test_search_primary, &uuid_128, NULL, MTU_EXCHANGE_CLIENT_PDUS, @@ -2419,7 +2441,7 @@ int main(int argc, char *argv[]) raw_pdu(0x03, 0x00, 0x02), raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x00, 0x18), - raw_pdu(0x07, 0x10, 0xf0, 0x17, 0xf0), + raw_pdu(0x07, 0x10, 0xf0, 0x18, 0xf0), raw_pdu(0x06, 0x18, 0xf0, 0xff, 0xff, 0x00, 0x28, 0x00, 0x18), raw_pdu(0x01, 0x06, 0x18, 0xf0, 0x0a)); @@ -2431,7 +2453,7 @@ int main(int argc, char *argv[]) 0xa0), raw_pdu(0x07, 0x30, 0x00, 0x32, 0x00, 0x50, 0x00, 0x52, 0x00, 0x60, 0x00, 0x6b, 0x00, 0x70, 0x00, 0x76, - 0x00, 0x80, 0x00, 0x85, 0x00), + 0x00, 0x80, 0x00, 0x86, 0x00), raw_pdu(0x06, 0x86, 0x00, 0xff, 0xff, 0x00, 0x28, 0x0b, 0xa0), raw_pdu(0x01, 0x06, 0x86, 0x00, 0x0a)); @@ -2507,7 +2529,7 @@ int main(int argc, char *argv[]) ts_large_db_1, NULL, raw_pdu(0x03, 0x00, 0x02), raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x02, 0x28), - raw_pdu(0x09, 0x08, 0x02, 0x00, 0x80, 0x00, 0x85, 0x00, + raw_pdu(0x09, 0x08, 0x02, 0x00, 0x80, 0x00, 0x86, 0x00, 0x0b, 0xa0, 0x21, 0x00, 0x01, 0x00, 0x06, 0x00, 0x0d, 0xa0), raw_pdu(0x08, 0x22, 0x00, 0xff, 0xff, 0x02, 0x28), @@ -2533,25 +2555,25 @@ int main(int argc, char *argv[]) define_test_server("/TP/GAD/SR/BV-04-C/small/1", test_server, ts_small_db, NULL, raw_pdu(0x03, 0x00, 0x02), - raw_pdu(0x08, 0x10, 0xf0, 0x17, 0xf0, 0x03, 0x28), + raw_pdu(0x08, 0x10, 0xf0, 0x18, 0xf0, 0x03, 0x28), raw_pdu(0x09, 0x07, 0x12, 0xf0, 0x02, 0x13, 0xf0, 0x00, 0x2a), - raw_pdu(0x08, 0x13, 0xf0, 0x17, 0xf0, 0x03, 0x28), - raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x02, 0x15, 0xf0, 0xef, + raw_pdu(0x08, 0x13, 0xf0, 0x18, 0xf0, 0x03, 0x28), + raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x82, 0x15, 0xf0, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00), - raw_pdu(0x08, 0x15, 0xf0, 0x17, 0xf0, 0x03, 0x28), - raw_pdu(0x09, 0x07, 0x16, 0xf0, 0x02, 0x17, 0xf0, 0x01, + raw_pdu(0x08, 0x15, 0xf0, 0x18, 0xf0, 0x03, 0x28), + raw_pdu(0x09, 0x07, 0x17, 0xf0, 0x02, 0x18, 0xf0, 0x01, 0x2a), - raw_pdu(0x08, 0x17, 0xf0, 0x17, 0xf0, 0x03, 0x28), - raw_pdu(0x01, 0x08, 0x17, 0xf0, 0x0a)); + raw_pdu(0x08, 0x18, 0xf0, 0x18, 0xf0, 0x03, 0x28), + raw_pdu(0x01, 0x08, 0x18, 0xf0, 0x0a)); define_test_server("/TP/GAD/SR/BV-04-C/small/2", test_server, ts_small_db, NULL, raw_pdu(0x03, 0x00, 0x02), raw_pdu(0x08, 0x01, 0x00, 0x0f, 0x00, 0x03, 0x28), - raw_pdu(0x09, 0x07, 0x02, 0x00, 0x32, 0x03, 0x00, 0x29, + raw_pdu(0x09, 0x07, 0x02, 0x00, 0xb2, 0x03, 0x00, 0x29, 0x2a), raw_pdu(0x08, 0x03, 0x00, 0x0f, 0x00, 0x03, 0x28), raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a)); @@ -2590,21 +2612,21 @@ int main(int argc, char *argv[]) raw_pdu(0x09, 0x07, 0x12, 0xf0, 0x02, 0x13, 0xf0, 0x00, 0x2a), raw_pdu(0x08, 0x13, 0xf0, 0x17, 0xf0, 0x03, 0x28), - raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x02, 0x15, 0xf0, 0xef, + raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x82, 0x15, 0xf0, 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x00, 0x00, 0x00, 0x00, 0x09, 0xb0, 0x00, 0x00), - raw_pdu(0x08, 0x15, 0xf0, 0x17, 0xf0, 0x03, 0x28), - raw_pdu(0x09, 0x07, 0x16, 0xf0, 0x02, 0x17, 0xf0, 0x01, + raw_pdu(0x08, 0x15, 0xf0, 0x18, 0xf0, 0x03, 0x28), + raw_pdu(0x09, 0x07, 0x17, 0xf0, 0x02, 0x18, 0xf0, 0x01, 0x2a), - raw_pdu(0x08, 0x17, 0xf0, 0x17, 0xf0, 0x03, 0x28), - raw_pdu(0x01, 0x08, 0x17, 0xf0, 0x0a)); + raw_pdu(0x08, 0x18, 0xf0, 0x18, 0xf0, 0x03, 0x28), + raw_pdu(0x01, 0x08, 0x18, 0xf0, 0x0a)); define_test_server("/TP/GAD/SR/BV-05-C/small/2", test_server, ts_small_db, NULL, raw_pdu(0x03, 0x00, 0x02), raw_pdu(0x08, 0x01, 0x00, 0x0f, 0x00, 0x03, 0x28), - raw_pdu(0x09, 0x07, 0x02, 0x00, 0x32, 0x03, 0x00, 0x29, + raw_pdu(0x09, 0x07, 0x02, 0x00, 0xb2, 0x03, 0x00, 0x29, 0x2a), raw_pdu(0x08, 0x03, 0x00, 0x0f, 0x00, 0x03, 0x28), raw_pdu(0x01, 0x08, 0x03, 0x00, 0x0a)); @@ -2798,7 +2820,7 @@ int main(int argc, char *argv[]) 0x00), raw_pdu(0x09, 0x03, 0x15, 0xF0, 0x09), raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x01, 0x2a), - raw_pdu(0x09, 0x04, 0x17, 0xF0, 0x00, 0x00)); + raw_pdu(0x09, 0x04, 0x18, 0xF0, 0x00, 0x00)); define_test_server("/TP/GAR/SR/BV-03-C/large-1", test_server, ts_large_db_1, NULL, @@ -2892,14 +2914,14 @@ int main(int argc, char *argv[]) define_test_client("/TP/GAR/CL/BV-04-C", test_client, service_db_1, &test_long_read_1, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x0d, 0x01, 0x02, 0x03)); + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x0b, 0x01, 0x02, 0x03)); define_test_client("/TP/GAR/CL/BV-04-C/512B", test_client, service_db_1, &test_long_read_2, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x0d, 0xff, 0xff, 0xff, 0xff, + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -3014,46 +3036,46 @@ int main(int argc, char *argv[]) define_test_client("/TP/GAR/CL/BI-12-C", test_client, service_db_1, &test_long_read_3, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x03, 0x00, 0x02)); + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x02)); define_test_client("/TP/GAR/CL/BI-13-C", test_client, service_db_1, &test_long_read_4, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x03, 0x00, 0x07)); + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x07)); define_test_client("/TP/GAR/CL/BI-14-C", test_client, service_db_1, &test_long_read_5, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x00, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x00, 0x00, 0x01)); + raw_pdu(0x0a, 0x00, 0x00), + raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01)); define_test_client("/TP/GAR/CL/BI-15-C", test_client, service_db_1, &test_long_read_6, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x03, 0x00, 0x08)); + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x08)); define_test_client("/TP/GAR/CL/BI-16-C", test_client, service_db_1, &test_long_read_7, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x03, 0x00, 0x05)); + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05)); define_test_client("/TP/GAR/CL/BI-16-C/auto", test_client, service_db_1, &test_long_read_1, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x03, 0x00, 0x05), - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05), + raw_pdu(0x0a, 0x03, 0x00), raw_pdu(0x0d, 0x01, 0x02, 0x03)); define_test_client("/TP/GAR/CL/BI-17-C", test_client, service_db_1, &test_long_read_8, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x03, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x03, 0x00, 0x0c)); + raw_pdu(0x0a, 0x03, 0x00), + raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x0c)); define_test_client("/TP/GAR/CL/BI-18-C", test_client, service_db_1, &test_multiple_read_2, @@ -3299,14 +3321,14 @@ int main(int argc, char *argv[]) define_test_client("/TP/GAR/CL/BV-07-C", test_client, service_db_1, &test_long_read_9, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x0d, 0x01, 0x02, 0x03)); + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x0b, 0x01, 0x02, 0x03)); define_test_client("/TP/GAR/CL/BV-07-C/512B", test_client, service_db_1, &test_long_read_10, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x0d, 0xff, 0xff, 0xff, 0xff, + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x0b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, @@ -3415,46 +3437,46 @@ int main(int argc, char *argv[]) define_test_client("/TP/GAR/CL/BI-28-C", test_client, service_db_1, &test_long_read_11, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x04, 0x00, 0x02)); + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x02)); define_test_client("/TP/GAR/CL/BI-29-C", test_client, service_db_1, &test_long_read_12, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x04, 0x00, 0x07)); + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x07)); define_test_client("/TP/GAR/CL/BI-30-C", test_client, service_db_1, &test_long_read_5, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x00, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x00, 0x00, 0x01)); + raw_pdu(0x0a, 0x00, 0x00), + raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01)); define_test_client("/TP/GAR/CL/BI-31-C", test_client, service_db_1, &test_long_read_13, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x04, 0x00, 0x08)); + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x08)); define_test_client("/TP/GAR/CL/BI-32-C", test_client, service_db_1, &test_long_read_14, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x04, 0x00, 0x05)); + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05)); define_test_client("/TP/GAR/CL/BI-32-C/auto", test_client, service_db_1, &test_long_read_9, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x04, 0x00, 0x05), - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x0d, 0x01, 0x02, 0x03)); + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05), + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x0b, 0x01, 0x02, 0x03)); define_test_client("/TP/GAR/CL/BI-33-C", test_client, service_db_1, &test_long_read_15, SERVICE_DATA_1_PDUS, - raw_pdu(0x0c, 0x04, 0x00, 0x00, 0x00), - raw_pdu(0x01, 0x0c, 0x04, 0x00, 0x0c)); + raw_pdu(0x0a, 0x04, 0x00), + raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x0c)); define_test_client("/TP/GAR/CL/BI-34-C", test_client, service_db_1, &test_read_12, @@ -3852,8 +3874,8 @@ int main(int argc, char *argv[]) raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff), - raw_pdu(0x16, 0x03, 0x00, 0x3f, 0x00, 0xff), - raw_pdu(0x17, 0x03, 0x00, 0x3f, 0x00, 0xff), + raw_pdu(0x16, 0x03, 0x00, 0x12, 0x00, 0xff), + raw_pdu(0x17, 0x03, 0x00, 0x12, 0x00, 0xff), raw_pdu(0x18, 0x01), raw_pdu(0x19)); @@ -3866,8 +3888,8 @@ int main(int argc, char *argv[]) raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff), - raw_pdu(0x16, 0x82, 0x00, 0x3f, 0x00, 0xff), - raw_pdu(0x17, 0x82, 0x00, 0x3f, 0x00, 0xff), + raw_pdu(0x16, 0x82, 0x00, 0x12, 0x00, 0xff), + raw_pdu(0x17, 0x82, 0x00, 0x12, 0x00, 0xff), raw_pdu(0x18, 0x01), raw_pdu(0x19)); @@ -3996,12 +4018,12 @@ int main(int argc, char *argv[]) raw_pdu(0x03, 0x00, 0x02), raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), - raw_pdu(0x16, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), - raw_pdu(0x17, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), + raw_pdu(0x16, 0x72, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), + raw_pdu(0x17, 0x72, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), raw_pdu(0x16, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), raw_pdu(0x17, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), - raw_pdu(0x16, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), - raw_pdu(0x17, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), + raw_pdu(0x16, 0x72, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), + raw_pdu(0x17, 0x72, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), raw_pdu(0x18, 0x01), raw_pdu(0x19)); @@ -4374,8 +4396,8 @@ int main(int argc, char *argv[]) raw_pdu(0x17, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff), - raw_pdu(0x16, 0x04, 0x00, 0x3f, 0x00, 0xff), - raw_pdu(0x17, 0x04, 0x00, 0x3f, 0x00, 0xff), + raw_pdu(0x16, 0x04, 0x00, 0x12, 0x00, 0xff), + raw_pdu(0x17, 0x04, 0x00, 0x12, 0x00, 0xff), raw_pdu(0x18, 0x01), raw_pdu(0x19)); @@ -4388,8 +4410,8 @@ int main(int argc, char *argv[]) raw_pdu(0x17, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff), - raw_pdu(0x16, 0x83, 0x00, 0x3f, 0x00, 0xff), - raw_pdu(0x17, 0x83, 0x00, 0x3f, 0x00, 0xff), + raw_pdu(0x16, 0x83, 0x00, 0x12, 0x00, 0xff), + raw_pdu(0x17, 0x83, 0x00, 0x12, 0x00, 0xff), raw_pdu(0x18, 0x01), raw_pdu(0x19)); @@ -4425,5 +4447,19 @@ int main(int argc, char *argv[]) 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff), raw_pdu(0x01, 0x16, 0x04, 0x00, 0x03)); + define_test_server("/robustness/no-reliable-characteristic", + test_server, ts_large_db_1, NULL, + raw_pdu(0x03, 0x00, 0x02), + raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), + raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), + raw_pdu(0x16, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), + raw_pdu(0x17, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03), + raw_pdu(0x16, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), + raw_pdu(0x17, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), + raw_pdu(0x16, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), + raw_pdu(0x17, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06), + raw_pdu(0x18, 0x01), + raw_pdu(0x01, 0x18, 0x25, 0x00, 0x06)); + return tester_run(); } diff --git a/unit/test-gattrib.c b/unit/test-gattrib.c old mode 100644 new mode 100755 diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c old mode 100644 new mode 100755 diff --git a/unit/test-gobex-apparam.c b/unit/test-gobex-apparam.c old mode 100644 new mode 100755 diff --git a/unit/test-gobex-header.c b/unit/test-gobex-header.c old mode 100644 new mode 100755 diff --git a/unit/test-gobex-packet.c b/unit/test-gobex-packet.c old mode 100644 new mode 100755 diff --git a/unit/test-gobex-transfer.c b/unit/test-gobex-transfer.c old mode 100644 new mode 100755 diff --git a/unit/test-gobex.c b/unit/test-gobex.c old mode 100644 new mode 100755 diff --git a/unit/test-hfp.c b/unit/test-hfp.c old mode 100644 new mode 100755 diff --git a/unit/test-hog.c b/unit/test-hog.c old mode 100644 new mode 100755 diff --git a/unit/test-lib.c b/unit/test-lib.c old mode 100644 new mode 100755 diff --git a/unit/test-mgmt.c b/unit/test-mgmt.c old mode 100644 new mode 100755 diff --git a/unit/test-queue.c b/unit/test-queue.c old mode 100644 new mode 100755 diff --git a/unit/test-ringbuf.c b/unit/test-ringbuf.c old mode 100644 new mode 100755 diff --git a/unit/test-sdp.c b/unit/test-sdp.c old mode 100644 new mode 100755 diff --git a/unit/test-textfile.c b/unit/test-textfile.c old mode 100644 new mode 100755 diff --git a/unit/test-uhid.c b/unit/test-uhid.c old mode 100644 new mode 100755 diff --git a/unit/test-uuid.c b/unit/test-uuid.c old mode 100644 new mode 100755 diff --git a/unit/util.c b/unit/util.c old mode 100644 new mode 100755 diff --git a/unit/util.h b/unit/util.h old mode 100644 new mode 100755