From a48d8b4639f36e6fc2d7e87cac92e178674caaa1 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 8 Mar 2002 21:10:06 +0000 Subject: Initial revision --- AUTHORS | 6 + COPYING | 304 +++ ChangeLog | 18 + INSTALL | 0 Makefile.am | 5 + Makefile.in | 339 ++++ NEWS | 0 README | 33 + aclocal.m4 | 3428 ++++++++++++++++++++++++++++++++ config.guess | 951 +++++++++ config.sub | 955 +++++++++ configure | 5455 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 21 + conftest | Bin 0 -> 6518 bytes conftest.c | 1 + include/Makefile.am | 9 + include/Makefile.in | 194 ++ include/bluetooth.h | 111 ++ include/hci.h | 768 ++++++++ include/hci_lib.h | 115 ++ include/hci_uart.h | 45 + include/hci_vhci.h | 35 + include/l2cap.h | 200 ++ include/sco.h | 65 + install-sh | 251 +++ ltmain.sh | 4946 ++++++++++++++++++++++++++++++++++++++++++++++ missing | 198 ++ mkinstalldirs | 40 + src/Makefile.am | 10 + src/Makefile.in | 353 ++++ src/bluetooth.c | 164 ++ src/hci.c | 624 ++++++ 32 files changed, 19644 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 aclocal.m4 create mode 100755 config.guess create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.in create mode 100755 conftest create mode 100644 conftest.c create mode 100644 include/Makefile.am create mode 100644 include/Makefile.in create mode 100644 include/bluetooth.h create mode 100644 include/hci.h create mode 100644 include/hci_lib.h create mode 100644 include/hci_uart.h create mode 100644 include/hci_vhci.h create mode 100644 include/l2cap.h create mode 100644 include/sco.h create mode 100755 install-sh create mode 100644 ltmain.sh create mode 100755 missing create mode 100755 mkinstalldirs create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/bluetooth.c create mode 100644 src/hci.c diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..7cd84ba8 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +Maxim Krasnyansky + Original author. + Primary maintainer. + +Marcel Holtmann + Various patches, fixes and other contributions. diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..357e7469 --- /dev/null +++ b/COPYING @@ -0,0 +1,304 @@ + + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, + OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE + USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. + + ------------------------------------------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..a5569bdb --- /dev/null +++ b/ChangeLog @@ -0,0 +1,18 @@ +ver 2.0-pre7: + Bluetooth libraries and header files is now a separate package. + +ver 2.0-pre6: + API cleanup and additions. + +ver 2.0-pre4: + HCI filter enhancements. + +ver 2.0-pre3: + Cleanup. + +ver 2.0-pre2: + Additional HCI library functions. + Documentation update. + +ver 2.0-pre1: + Minor fixes and improvements. diff --git a/INSTALL b/INSTALL new file mode 100644 index 00000000..e69de29b diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..64e1a183 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,5 @@ +# +# $Id$ +# + +SUBDIRS = include src diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 00000000..e541f40d --- /dev/null +++ b/Makefile.in @@ -0,0 +1,339 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# +# $Id$ +# + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +EXEEXT = @EXEEXT@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +SUBDIRS = include src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ +Makefile.in NEWS aclocal.m4 config.guess config.sub configure \ +configure.in install-sh ltmain.sh missing mkinstalldirs + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): configure.in + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" != "." || dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-tags distclean-generic clean-am + -rm -f libtool + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: install-data-recursive uninstall-data-recursive \ +install-exec-recursive uninstall-exec-recursive installdirs-recursive \ +uninstalldirs-recursive all-recursive check-recursive \ +installcheck-recursive info-recursive dvi-recursive \ +mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# 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/NEWS b/NEWS new file mode 100644 index 00000000..e69de29b diff --git a/README b/README new file mode 100644 index 00000000..6638febb --- /dev/null +++ b/README @@ -0,0 +1,33 @@ +BlueZ - Bluetooth protocol stack for Linux +Copyright (C) 2000-2001 Qualcomm Incorporated + +Written 2000,2001 by Maxim Krasnyansky + +Bluetooth Libraries + +1. Compilation and Installation. + +In order to compile Bluetooth libraries you need following software packages: + - Linux kernel 2.4.X source code + - GCC compiler + +To configure run: + ./configure + +Configure automatically searches for all required components and packages. + +To compile and install run: + make install + +2.0 Information + +Mailing lists: + bluez-users@lists.sourceforge.net - BlueZ general questions and discussions + bluez-devel@lists.sourceforge.net - BlueZ development + bluez-commit@lists.sourceforge.net - BlueZ commits to the CVS repository + bluez-announce@lists.sourceforge.net - BlueZ announcements + +For additional information about the project visit BlueZ web site: + http://bluez.sf.net + +Maxim Krasnyansky diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 00000000..d5ac3659 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,3428 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p5 + +dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Do all the work for Automake. 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. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN([AM_MISSING_PROG], +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- + +# serial 46 AC_PROG_LIBTOOL +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +]) + +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +_LT_AC_PROG_ECHO_BACKSLASH +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_RESTORE]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one + AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, + [AC_TRY_LINK([], + [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); + DllMain (0, 0, 0);], + [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) + + case $host/$CC in + *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) + # old mingw systems require "-dll" to link a DLL, while more recent ones + # require "-mdll" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -mdll" + AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, + [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) + CFLAGS="$SAVE_CFLAGS" ;; + *-*-cygwin* | *-*-pw32*) + # cygwin systems need to pass --dll to the linker, and not link + # crt.o which will require a WinMain@16 definition. + lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; + esac + ;; + ]) +esac + +_LT_AC_LTCONFIG_HACK + +]) + +# _LT_AC_CHECK_DLFCN +# -------------------- +AC_DEFUN(_LT_AC_CHECK_DLFCN, +[AC_CHECK_HEADERS(dlfcn.h) +])# _LT_AC_CHECK_DLFCN + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +[symcode='[BCDEGRST]'] + +# Regexp to match symbols that can be accessed directly from C. +[sympat='\([_A-Za-z][_A-Za-z0-9]*\)'] + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Define system-specific variables. +case $host_os in +aix*) + [symcode='[BCDT]'] + ;; +cygwin* | mingw* | pw32*) + [symcode='[ABCDGISTW]'] + ;; +hpux*) # Its linker distinguishes data from code symbols + lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + ;; +irix*) + [symcode='[BCDEGRST]'] + ;; +solaris* | sysv5*) + [symcode='[BDT]'] + ;; +sysv4) + [symcode='[DFNSTU]'] + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + [symcode='[ABCDGISTW]'] +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. +[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"] + + # Check to see that the pipe works correctly. + pipe_works=no + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +[lt_preloaded_symbols[] =] +{ +EOF + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if AC_TRY_EVAL(ac_link) && test -s conftest; then + pipe_works=yes + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AC_FD_CC + fi + else + echo "cannot find nm_test_var in $nlist" >&AC_FD_CC + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC + fi + else + echo "$progname: failed program was:" >&AC_FD_CC + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" +if test -z "$lt_cv_sys_global_symbol_pipe"; then + global_symbol_to_cdecl= +else + global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" +fi +if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + +# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR +# --------------------------------- +AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], +[# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac +fi +])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn;t interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +AC_DIVERT_POP +])# _LT_AC_PROG_ECHO_BACKSLASH + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ------------------------------------------------------------------ +AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF, +[if test "$cross_compiling" = yes; then : + [$4] +else + AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + +# AC_LIBTOOL_DLOPEN_SELF +# ------------------- +AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF, +[if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + cygwin* | mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + *) + AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen", + [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load", + [AC_CHECK_LIB(svld, dlopen, + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB(dld, shl_load, + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + +AC_DEFUN([_LT_AC_LTCONFIG_HACK], +[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" +need_locks="$enable_libtool_lock" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case $host_os in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" +fi + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="[$]2" + +AC_MSG_CHECKING([for objdir]) +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +AC_MSG_RESULT($objdir) + + +AC_ARG_WITH(pic, +[ --with-pic try to use only PIC/non-PIC objects [default=use both]], +pic_mode="$withval", pic_mode=default) +test -z "$pic_mode" && pic_mode=default + +# We assume here that the value for lt_cv_prog_cc_pic will not be cached +# in isolation, and that seeing it set (from the cache) indicates that +# the associated values are set (in the cache) correctly too. +AC_MSG_CHECKING([for $compiler option to produce PIC]) +AC_CACHE_VAL(lt_cv_prog_cc_pic, +[ lt_cv_prog_cc_pic= + lt_cv_prog_cc_shlib= + lt_cv_prog_cc_wl= + lt_cv_prog_cc_static= + lt_cv_prog_cc_no_builtin= + lt_cv_prog_cc_can_build_shared=$can_build_shared + + if test "$GCC" = yes; then + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-static' + + case $host_os in + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # we not sure about C++ programs. + lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_cv_prog_cc_pic='-fno-common' + ;; + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_cv_prog_cc_pic=-Kconform_pic + fi + ;; + *) + lt_cv_prog_cc_pic='-fPIC' + ;; + esac + else + # PORTME Check for PIC flags for the system compiler. + case $host_os in + aix3* | aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better lt_cv_prog_cc_static that works with the bundled CC? + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" + lt_cv_prog_cc_pic='+Z' + ;; + + irix5* | irix6*) + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + + newsos6) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + ;; + + sco3.2v5*) + lt_cv_prog_cc_pic='-Kpic' + lt_cv_prog_cc_static='-dn' + lt_cv_prog_cc_shlib='-belf' + ;; + + solaris*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + ;; + + sunos4*) + lt_cv_prog_cc_pic='-PIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + if test "x$host_vendor" = xsni; then + lt_cv_prog_cc_wl='-LD' + else + lt_cv_prog_cc_wl='-Wl,' + fi + ;; + + uts4*) + lt_cv_prog_cc_pic='-pic' + lt_cv_prog_cc_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_cv_prog_cc_pic='-Kconform_pic' + lt_cv_prog_cc_static='-Bstatic' + fi + ;; + + *) + lt_cv_prog_cc_can_build_shared=no + ;; + esac + fi +]) +if test -z "$lt_cv_prog_cc_pic"; then + AC_MSG_RESULT([none]) +else + AC_MSG_RESULT([$lt_cv_prog_cc_pic]) + + # Check to make sure the pic_flag actually works. + AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) + AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" + AC_TRY_COMPILE([], [], [dnl + case $host_os in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then + # they create non-PIC objects. So, if there were any warnings, we + # assume that PIC is not supported. + if test -s conftest.err; then + lt_cv_prog_cc_pic_works=no + else + lt_cv_prog_cc_pic_works=yes + fi + ;; + *) + lt_cv_prog_cc_pic_works=yes + ;; + esac + ], [dnl + lt_cv_prog_cc_pic_works=no + ]) + CFLAGS="$save_CFLAGS" + ]) + + if test "X$lt_cv_prog_cc_pic_works" = Xno; then + lt_cv_prog_cc_pic= + lt_cv_prog_cc_can_build_shared=no + else + lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" + fi + + AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) +fi + +# Check for any special shared library compilation flags. +if test -n "$lt_cv_prog_cc_shlib"; then + AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | [egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]"] >/dev/null; then : + else + AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) + lt_cv_prog_cc_can_build_shared=no + fi +fi + +AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) +AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl + lt_cv_prog_cc_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" + AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) + LDFLAGS="$save_LDFLAGS" +]) + +# Belt *and* braces to stop my trousers falling down: +test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= +AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) + +pic_flag="$lt_cv_prog_cc_pic" +special_shlib_compile_flags="$lt_cv_prog_cc_shlib" +wl="$lt_cv_prog_cc_wl" +link_static_flag="$lt_cv_prog_cc_static" +no_builtin_flag="$lt_cv_prog_cc_no_builtin" +can_build_shared="$lt_cv_prog_cc_can_build_shared" + + +# Check to see if options -o and -c are simultaneously supported by compiler +AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) +AC_CACHE_VAL([lt_cv_compiler_c_o], [ +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest +echo "int some_variable = 0;" > conftest.$ac_ext +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" +compiler_c_o=no +if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + lt_cv_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi +else + # Append any errors to the config.log. + cat out/conftest.err 1>&AC_FD_CC + lt_cv_compiler_c_o=no +fi +CFLAGS="$save_CFLAGS" +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null +]) +compiler_c_o=$lt_cv_compiler_c_o +AC_MSG_RESULT([$compiler_c_o]) + +if test x"$compiler_c_o" = x"yes"; then + # Check to see if we can write to a .lo + AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) + AC_CACHE_VAL([lt_cv_compiler_o_lo], [ + lt_cv_compiler_o_lo=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -c -o conftest.lo" + AC_TRY_COMPILE([], [int some_variable = 0;], [dnl + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + lt_cv_compiler_o_lo=no + else + lt_cv_compiler_o_lo=yes + fi + ]) + CFLAGS="$save_CFLAGS" + ]) + compiler_o_lo=$lt_cv_compiler_o_lo + AC_MSG_RESULT([$compiler_o_lo]) +else + compiler_o_lo=no +fi + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi + +if test "$GCC" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) + echo "int some_variable = 0;" > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" + compiler_rtti_exceptions=no + AC_TRY_COMPILE([], [int some_variable = 0;], [dnl + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + compiler_rtti_exceptions=no + else + compiler_rtti_exceptions=yes + fi + ]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT([$compiler_rtti_exceptions]) + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi +fi + +# See if the linker supports building shared libraries. +AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) + +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +old_archive_from_expsyms_cmds= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_into_libs=no +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +link_all_deplibs=unknown +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression of symbols to exclude +# it will be wrapped by ` (' and `)$', so one must not match beginning or +# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +# as well as any symbol that contains `d'. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_" +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +# platforms (ab)use it in PIC code, but their linkers get confused if +# the symbol is explicitly referenced. Since portable code cannot +# rely on this symbol name, it's probably fine to never include it in +# preloaded symbol tables. +extract_expsyms_cmds= + +case $host_os in +cygwin* | mingw* | pw32* ) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX, the GNU linker is very broken + # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ + sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ + test -f $output_objdir/impgen.exe || (cd $output_objdir && \ + if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ + else $CC -o impgen impgen.c ; fi)~ + $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' + + old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' + + # cygwin and mingw dlls have different entry points and sets of symbols + # to exclude. + # FIXME: what about values for MSVC? + dll_entry=__cygwin_dll_entry@12 + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ + case $host_os in + mingw*) + # mingw values + dll_entry=_DllMainCRTStartup@12 + dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ + ;; + esac + + # mingw and cygwin differ, and it's simplest to just exclude the union + # of the two symbol sets. + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one (in ltdll.c) + if test "x$lt_cv_need_dllmain" = "xyes"; then + ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " + ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ + test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' + else + ltdll_obj= + ltdll_cmds= + fi + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left be newer dlltools. + export_symbols_cmds="$ltdll_cmds"' + $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ + [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols' + + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \[$]# in + 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ + '"$ltdll_cmds"' + $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ + $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw* | pw32*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + fi +else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + # 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_libdir_separator=':' + if test "$GCC" = yes; then + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + shared_flag='-shared' + else + if test "$host_cpu" = ia64; then + shared_flag='-G' + else + shared_flag='${wl}-bM:SRE' + fi + hardcode_direct=yes + fi + + 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 + # 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 run time linking. + aix_use_runtimelinking=no + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then + aix_use_runtimelinking=yes + break + fi + done + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + # It seems that -bexpall can do strange things, so it is better to + # generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + allow_undefined_flag=' -Wl,-G' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-znodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + # Warning - without using the other run time loading flags, -berok will + # link without error, but may produce a broken library. + allow_undefined_flag='${wl}-berok' + # This is a bit strange, but is similar to how AIX traditionally builds + # it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + ;; + + darwin* | rhapsody*) + allow_undefined_flag='-undefined suppress' + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' + # We need to add '_' to the symbols in $export_symbols first + #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' + hardcode_direct=yes + hardcode_shlibpath_var=no + whole_archive_flag_spec='-all_load $convenience' + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case $host_os in + hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + #Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z defs' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + [solaris2.[0-5] | solaris2.[0-5].*]) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + if test "x$host_vendor" = xsno; then + archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes # is this really true??? + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5uw7* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi +AC_MSG_RESULT([$ld_shlibs]) +test "$ld_shlibs" = no && can_build_shared=no + +# Check hardcoding attributes. +AC_MSG_CHECKING([how to hardcode library paths into programs]) +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +AC_MSG_RESULT([$hardcode_action]) + +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +# PORTME Fill in your ld.so characteristics +AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4* | aix5*) + version_type=linux + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + [ aix4 | aix4.[01] | aix4.[01].*)] + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so instead of + # lib.a to let people know that these are not typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major' + fi + shlibpath_var=LIBPATH + deplibs_check_method=pass_all + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | [$Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\'']`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $GCC,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + ;; + yes,mingw*) + library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + ;; + *) + library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' + soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + *) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + need_version=no + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +# Report the final consequences. +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +AC_LIBTOOL_DLOPEN_SELF + +if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], + [$rm conftest* + echo 'static int dummy;' > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile); then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_cv_prog_cc_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi]) + AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) + ;; + esac +fi +need_lc=${lt_cv_archive_cmds_need_lc-yes} + +# The second clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + : +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + +if test -f "$ltmain"; then + trap "$rm \"${ofile}T\"; exit 1" 1 2 15 + $rm -f "${ofile}T" + + echo creating $ofile + + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS \ + AR AR_FLAGS CC LD LN_S NM SHELL \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ + postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + + case $var in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + cat <<__EOF__ > "${ofile}T" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$need_lc + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# The default C compiler. +CC=$lt_CC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_pic_flag +pic_mode=$pic_mode + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_compiler_c_o + +# Can we write directly to a .lo ? +compiler_o_lo=$lt_compiler_o_lo + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_global_symbol_to_cdecl + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + case $host_os in + aix3*) + cat <<\EOF >> "${ofile}T" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + case $host_os in + cygwin* | mingw* | pw32* | os2*) + cat <<'EOF' >> "${ofile}T" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# */ +# +# #include /* for printf() */ +# #include /* for open(), lseek(), read() */ +# #include /* for O_RDONLY, O_BINARY */ +# #include /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) + + mv -f "${ofile}T" "$ofile" || \ + (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") + chmod +x "$ofile" +fi + +])# _LT_AC_LTCONFIG_HACK + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case $enableval in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case $enableval in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case $enableval in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + +# AC_LIBTOOL_PICMODE - implement the --with-pic flag +# Usage: AC_LIBTOOL_PICMODE[(MODE)] +# Where MODE is either `yes' or `no'. If omitted, it defaults to +# `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default)]) + + +# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +]) + + +# AC_PATH_MAGIC - find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl +AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) + else + MAGIC_CMD=: + fi +fi +]) + + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + [re_direlt='/[^/][^/]*/\.\./'] + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +]) + +# AC_PROG_LD_GNU - +AC_DEFUN([AC_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + lt_cv_prog_gnu_ld=yes +else + lt_cv_prog_gnu_ld=no +fi]) +with_gnu_ld=$lt_cv_prog_gnu_ld +]) + +# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], +[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, +[lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" +]) + +# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], +[AC_CACHE_CHECK([how to recognise dependant libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# ['file_magic [regex]'] -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'] + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* | pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[012]) + lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + +freebsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + [lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'] + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20*|hpux11*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'] + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + +irix5* | irix6*) + case $host_os in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"] + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;] + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] + else + [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'] + fi + ;; + +newos6*) + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +[sysv5uw[78]* | sysv4*uw2*)] + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'] + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + [lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"] + lt_cv_file_magic_test_file=/lib/libc.so + ;; + esac + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +]) + + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/${ac_tool_prefix}nm + if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + lt_cv_path_NM="$tmp_nm -B" + break + elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + lt_cv_path_NM="$tmp_nm -p" + break + else + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +AC_MSG_RESULT([$NM]) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-convenience to the +# configure arguments. Note that LIBLTDL and INCLTDL are not +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not +# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed +# with '${top_builddir}/' and INCLTDL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-install to the configure +# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is +# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed +# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed +# with '${top_srcdir}/' (note the single quotes!). If your package is +# not flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + diff --git a/config.guess b/config.guess new file mode 100755 index 00000000..2960d6e0 --- /dev/null +++ b/config.guess @@ -0,0 +1,951 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +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 + +trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <dummy.s + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + 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 0 ;; + NILE:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + 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 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /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 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >dummy.c + int main (argc, argv) int argc; char **argv; { + #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-cc} dummy.c -o dummy \ + && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${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 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${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=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) + sed 's/^ //' << EOF >dummy.c + #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 + (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` + rm -f dummy.c dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + 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-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. + ld_help_string=`ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + ${CC-cc} dummy.s -o dummy 2>/dev/null + if test "$?" = 0 ; then + ./dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f dummy.s dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >dummy.c < +main(argc, argv) + int argc; + char *argv[]; +{ +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + fi ;; +# 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. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + 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 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i?86:UnixWare:*:*) + if /bin/uname -X 2>/dev/null >/dev/null ; then + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + fi + echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} + exit 0 ;; + pc:*:*:*) + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *: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 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 +rm -f dummy.c dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/config.sub b/config.sub new file mode 100755 index 00000000..00bea6e6 --- /dev/null +++ b/config.sub @@ -0,0 +1,955 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# 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. + +# 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. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +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 + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + 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) + os= + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -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/'` + ;; + -sco*) + os=-sco3.2v2 + 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*) + 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 + ;; +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. + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ + | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ + | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ + | mipstx39 | mipstx39el \ + | sparc | sparclet | sparclite | sparc64 | v850) + basic_machine=$basic_machine-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[34567]86) + 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. + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ + | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ + | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ + | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mipstx39-* | mipstx39el-* \ + | f301-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + 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 | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + 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 + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-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 + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + os=-mvs + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + 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 + ;; + 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 + ;; + np1) + basic_machine=np1-gould + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | k6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | k6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + 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 + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + 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 + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + 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. + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + *) + 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. + -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* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -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|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -xenix) + os=-xenix + ;; + -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 + *-acorn) + os=-riscix1.2 + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-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 + ;; + f301-fujitsu) + os=-uxpv + ;; + *) + 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 + ;; + -aix*) + vendor=ibm + ;; + -hpux*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os diff --git a/configure b/configure new file mode 100755 index 00000000..1306bc69 --- /dev/null +++ b/configure @@ -0,0 +1,5455 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_default_prefix=/usr +ac_help="$ac_help + --enable-shared[=PKGS] build shared libraries [default=yes]" +ac_help="$ac_help + --enable-static[=PKGS] build static libraries [default=yes]" +ac_help="$ac_help + --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" +ac_help="$ac_help + --with-gnu-ld assume the C compiler uses GNU ld [default=no]" + +# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac +fi + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + +ac_help="$ac_help + --disable-libtool-lock avoid locking (might break parallel builds)" +ac_help="$ac_help + --with-pic try to use only PIC/non-PIC objects [default=use both]" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$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" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # 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 << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --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 +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file= + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +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 + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# 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" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:727: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:780: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +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" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:837: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=bluez-libs + +VERSION=2.0 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:883: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:896: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:909: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:922: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:935: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + + + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:957: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:987: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_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 $# -gt 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 + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1038: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1070: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 1081 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1112: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1117: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1145: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1179: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# 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 +# 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" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1218: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:1271: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:1304: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1333: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} +case $enableval in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_shared=yes +fi + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} +case $enableval in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_static=yes +fi + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} +case $enableval in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=yes +fi + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:1488: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1509: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 +echo "configure:1538: checking for ld used by GCC" >&5 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 +echo "configure:1568: checking for GNU ld" >&5 +else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 +echo "configure:1571: checking for non-GNU ld" >&5 +fi +if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$lt_cv_path_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } +echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 +echo "configure:1606: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 &5; then + lt_cv_prog_gnu_ld=yes +else + lt_cv_prog_gnu_ld=no +fi +fi + +echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +with_gnu_ld=$lt_cv_prog_gnu_ld + + +echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 +echo "configure:1623: checking for $LD option to reload object files" >&5 +if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + lt_cv_ld_reload_flag='-r' +fi + +echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" + +echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 +echo "configure:1635: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/${ac_tool_prefix}nm + if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then + lt_cv_path_NM="$tmp_nm -B" + break + elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + lt_cv_path_NM="$tmp_nm -p" + break + else + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi + +NM="$lt_cv_path_NM" +echo "$ac_t""$NM" 1>&6 + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1673: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 +echo "configure:1694: checking how to recognise dependant libraries" >&5 +if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&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 egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* | pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.012) + lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + +freebsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20*|hpux11*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + +irix5* | irix6*) + case $host_os in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv5uw[78]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + esac + ;; +esac + +fi + +echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method + +echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:1867: checking for object suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if { (eval echo configure:1873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1893: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 +echo "configure:1934: checking command to parse $NM output" >&5 +if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + ;; +irix*) + symcode='[BCDEGRST]' + ;; +solaris* | sysv5*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[ABCDGISTW]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. +lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + rm -f conftest* + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo configure:2013: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if { (eval echo configure:2064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + pipe_works=yes + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" +if test -z "$lt_cv_sys_global_symbol_pipe"; then + global_symbol_to_cdecl= +else + global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" +fi +if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then + echo "$ac_t""failed" 1>&6 +else + echo "$ac_t""ok" 1>&6 +fi + +for ac_hdr in dlfcn.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2110: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 +echo "configure:2155: checking for ${ac_tool_prefix}file" >&5 +if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case $MAGIC_CMD in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$ac_t""$MAGIC_CMD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo $ac_n "checking for file""... $ac_c" 1>&6 +echo "configure:2217: checking for file" >&5 +if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case $MAGIC_CMD in + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$ac_t""$MAGIC_CMD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2288: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2320: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + +# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2355: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_STRIP"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2387: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="strip" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + STRIP=":" +fi +fi + + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + : +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 2436 "configure"' > conftest.$ac_ext + if { (eval echo configure:2437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 +echo "configure:2458: checking whether the C compiler needs -belf" >&5 +if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + lt_cv_cc_needs_belf=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + lt_cv_cc_needs_belf=no +fi +rm -f conftest* + ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +fi + +echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + + +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" +need_locks="$enable_libtool_lock" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case $host_os in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" +fi + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="$2" + +echo $ac_n "checking for objdir""... $ac_c" 1>&6 +echo "configure:2591: checking for objdir" >&5 +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +echo "$ac_t""$objdir" 1>&6 + + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi + +test -z "$pic_mode" && pic_mode=default + +# We assume here that the value for lt_cv_prog_cc_pic will not be cached +# in isolation, and that seeing it set (from the cache) indicates that +# the associated values are set (in the cache) correctly too. +echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 +echo "configure:2618: checking for $compiler option to produce PIC" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + lt_cv_prog_cc_pic= + lt_cv_prog_cc_shlib= + lt_cv_prog_cc_wl= + lt_cv_prog_cc_static= + lt_cv_prog_cc_no_builtin= + lt_cv_prog_cc_can_build_shared=$can_build_shared + + if test "$GCC" = yes; then + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-static' + + case $host_os in + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # we not sure about C++ programs. + lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_cv_prog_cc_pic='-fno-common' + ;; + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_cv_prog_cc_pic=-Kconform_pic + fi + ;; + *) + lt_cv_prog_cc_pic='-fPIC' + ;; + esac + else + # PORTME Check for PIC flags for the system compiler. + case $host_os in + aix3* | aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + else + lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better lt_cv_prog_cc_static that works with the bundled CC? + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" + lt_cv_prog_cc_pic='+Z' + ;; + + irix5* | irix6*) + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + + newsos6) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + lt_cv_prog_cc_wl='-Wl,' + lt_cv_prog_cc_static='-non_shared' + ;; + + sco3.2v5*) + lt_cv_prog_cc_pic='-Kpic' + lt_cv_prog_cc_static='-dn' + lt_cv_prog_cc_shlib='-belf' + ;; + + solaris*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Wl,' + ;; + + sunos4*) + lt_cv_prog_cc_pic='-PIC' + lt_cv_prog_cc_static='-Bstatic' + lt_cv_prog_cc_wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + lt_cv_prog_cc_pic='-KPIC' + lt_cv_prog_cc_static='-Bstatic' + if test "x$host_vendor" = xsni; then + lt_cv_prog_cc_wl='-LD' + else + lt_cv_prog_cc_wl='-Wl,' + fi + ;; + + uts4*) + lt_cv_prog_cc_pic='-pic' + lt_cv_prog_cc_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_cv_prog_cc_pic='-Kconform_pic' + lt_cv_prog_cc_static='-Bstatic' + fi + ;; + + *) + lt_cv_prog_cc_can_build_shared=no + ;; + esac + fi + +fi + +if test -z "$lt_cv_prog_cc_pic"; then + echo "$ac_t""none" 1>&6 +else + echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6 + + # Check to make sure the pic_flag actually works. + echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 +echo "configure:2770: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 + if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + case $host_os in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then + # they create non-PIC objects. So, if there were any warnings, we + # assume that PIC is not supported. + if test -s conftest.err; then + lt_cv_prog_cc_pic_works=no + else + lt_cv_prog_cc_pic_works=yes + fi + ;; + *) + lt_cv_prog_cc_pic_works=yes + ;; + esac + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + lt_cv_prog_cc_pic_works=no + +fi +rm -f conftest* + CFLAGS="$save_CFLAGS" + +fi + + + if test "X$lt_cv_prog_cc_pic_works" = Xno; then + lt_cv_prog_cc_pic= + lt_cv_prog_cc_can_build_shared=no + else + lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" + fi + + echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6 +fi + +# Check for any special shared library compilation flags. +if test -n "$lt_cv_prog_cc_shlib"; then + echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2 + if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : + else + echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 + lt_cv_prog_cc_can_build_shared=no + fi +fi + +echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 +echo "configure:2836: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + lt_cv_prog_cc_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + lt_cv_prog_cc_static_works=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + LDFLAGS="$save_LDFLAGS" + +fi + + +# Belt *and* braces to stop my trousers falling down: +test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= +echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6 + +pic_flag="$lt_cv_prog_cc_pic" +special_shlib_compile_flags="$lt_cv_prog_cc_shlib" +wl="$lt_cv_prog_cc_wl" +link_static_flag="$lt_cv_prog_cc_static" +no_builtin_flag="$lt_cv_prog_cc_no_builtin" +can_build_shared="$lt_cv_prog_cc_can_build_shared" + + +# Check to see if options -o and -c are simultaneously supported by compiler +echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 +echo "configure:2878: checking if $compiler supports -c -o file.$ac_objext" >&5 +if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest +echo "int some_variable = 0;" > conftest.$ac_ext +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" +compiler_c_o=no +if { (eval echo configure:2897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + lt_cv_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi +else + # Append any errors to the config.log. + cat out/conftest.err 1>&5 + lt_cv_compiler_c_o=no +fi +CFLAGS="$save_CFLAGS" +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null + +fi + +compiler_c_o=$lt_cv_compiler_c_o +echo "$ac_t""$compiler_c_o" 1>&6 + +if test x"$compiler_c_o" = x"yes"; then + # Check to see if we can write to a .lo + echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6 +echo "configure:2926: checking if $compiler supports -c -o file.lo" >&5 + if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + lt_cv_compiler_o_lo=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -c -o conftest.lo" + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + lt_cv_compiler_o_lo=no + else + lt_cv_compiler_o_lo=yes + fi + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + CFLAGS="$save_CFLAGS" + +fi + + compiler_o_lo=$lt_cv_compiler_o_lo + echo "$ac_t""$compiler_o_lo" 1>&6 +else + compiler_o_lo=no +fi + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 +echo "configure:2972: checking if we can lock with hard links" >&5 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$ac_t""$hard_links" 1>&6 + if test "$hard_links" = no; then + echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2 + need_locks=warn + fi +else + need_locks=no +fi + +if test "$GCC" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 +echo "configure:2991: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + echo "int some_variable = 0;" > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" + compiler_rtti_exceptions=no + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + compiler_rtti_exceptions=no + else + compiler_rtti_exceptions=yes + fi + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + CFLAGS="$save_CFLAGS" + echo "$ac_t""$compiler_rtti_exceptions" 1>&6 + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi +fi + +# See if the linker supports building shared libraries. +echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 +echo "configure:3031: checking whether the linker ($LD) supports shared libraries" >&5 + +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +old_archive_from_expsyms_cmds= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_into_libs=no +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +link_all_deplibs=unknown +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression of symbols to exclude +# it will be wrapped by ` (' and `)$', so one must not match beginning or +# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +# as well as any symbol that contains `d'. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_" +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +# platforms (ab)use it in PIC code, but their linkers get confused if +# the symbol is explicitly referenced. Since portable code cannot +# rely on this symbol name, it's probably fine to never include it in +# preloaded symbol tables. +extract_expsyms_cmds= + +case $host_os in +cygwin* | mingw* | pw32* ) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX, the GNU linker is very broken + # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ + sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ + test -f $output_objdir/impgen.exe || (cd $output_objdir && \ + if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ + else $CC -o impgen impgen.c ; fi)~ + $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' + + old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' + + # cygwin and mingw dlls have different entry points and sets of symbols + # to exclude. + # FIXME: what about values for MSVC? + dll_entry=__cygwin_dll_entry@12 + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ + case $host_os in + mingw*) + # mingw values + dll_entry=_DllMainCRTStartup@12 + dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ + ;; + esac + + # mingw and cygwin differ, and it's simplest to just exclude the union + # of the two symbol sets. + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one (in ltdll.c) + if test "x$lt_cv_need_dllmain" = "xyes"; then + ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " + ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ + test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' + else + ltdll_obj= + ltdll_cmds= + fi + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left be newer dlltools. + export_symbols_cmds="$ltdll_cmds"' + $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is. + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname-def; + else + echo EXPORTS > $output_objdir/$soname-def; + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ + '"$ltdll_cmds"' + $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ + $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw* | pw32*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + fi +else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + # 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_libdir_separator=':' + if test "$GCC" = yes; then + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + shared_flag='-shared' + else + if test "$host_cpu" = ia64; then + shared_flag='-G' + else + shared_flag='${wl}-bM:SRE' + fi + hardcode_direct=yes + fi + + 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 + # 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 run time linking. + aix_use_runtimelinking=no + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then + aix_use_runtimelinking=yes + break + fi + done + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + # It seems that -bexpall can do strange things, so it is better to + # generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' + allow_undefined_flag=' -Wl,-G' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-znodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' + # Warning - without using the other run time loading flags, -berok will + # link without error, but may produce a broken library. + allow_undefined_flag='${wl}-berok' + # This is a bit strange, but is similar to how AIX traditionally builds + # it's shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + ;; + + darwin* | rhapsody*) + allow_undefined_flag='-undefined suppress' + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' + # We need to add '_' to the symbols in $export_symbols first + #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' + hardcode_direct=yes + hardcode_shlibpath_var=no + whole_archive_flag_spec='-all_load $convenience' + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case $host_os in + hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + #Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z defs' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + if test "x$host_vendor" = xsno; then + archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes # is this really true??? + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5uw7* | unixware7*) + no_undefined_flag='${wl}-z ${wl}text' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi +echo "$ac_t""$ld_shlibs" 1>&6 +test "$ld_shlibs" = no && can_build_shared=no + +# Check hardcoding attributes. +echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 +echo "configure:3647: checking how to hardcode library paths into programs" >&5 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$ac_t""$hardcode_action" 1>&6 + +striplib= +old_striplib= +echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 +echo "configure:3675: checking whether stripping libraries is possible" >&5 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +# PORTME Fill in your ld.so characteristics +echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 +echo "configure:3689: checking dynamic linker characteristics" >&5 +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4* | aix5*) + version_type=linux + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so instead of + # lib.a to let people know that these are not typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major' + fi + shlibpath_var=LIBPATH + deplibs_check_method=pass_all + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $GCC,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + ;; + yes,mingw*) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' + ;; + *) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' + soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + *) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + need_version=no + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$ac_t""$dynamic_linker" 1>&6 +test "$dynamic_linker" = no && can_build_shared=no + +# Report the final consequences. +echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 +echo "configure:4075: checking if libtool supports shared libraries" >&5 +echo "$ac_t""$can_build_shared" 1>&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + cygwin* | mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + *) + echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "configure:4114: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen""... $ac_c" 1>&6 +echo "configure:4152: checking for dlopen" >&5 +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlopen(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +dlopen(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_dlopen=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dlopen=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load""... $ac_c" 1>&6 +echo "configure:4198: checking for shl_load" >&5 +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shl_load(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +shl_load(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_shl_load=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shl_load=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 +echo "configure:4244: checking for dlopen in -lsvld" >&5 +ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsvld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "configure:4282: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 +echo "configure:4354: checking whether a program can dlopen itself" >&5 +if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo configure:4425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi + +echo "$ac_t""$lt_cv_dlopen_self" 1>&6 + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 +echo "configure:4448: checking whether a statically linked program can dlopen itself" >&5 +if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); +} +EOF + if { (eval echo configure:4519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi + +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&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 + + +if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 +echo "configure:4568: checking whether -lc should be explicitly linked in" >&5 + if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + $rm conftest* + echo 'static int dummy;' > conftest.$ac_ext + + if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_cv_prog_cc_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo configure:4588: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi +fi + + echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6 + ;; + esac +fi +need_lc=${lt_cv_archive_cmds_need_lc-yes} + +# The second clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + : +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" +fi + +if test -f "$ltmain"; then + trap "$rm \"${ofile}T\"; exit 1" 1 2 15 + $rm -f "${ofile}T" + + echo creating $ofile + + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS \ + AR AR_FLAGS CC LD LN_S NM SHELL \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ + postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + + case $var in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + cat <<__EOF__ > "${ofile}T" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$need_lc + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# The default C compiler. +CC=$lt_CC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_pic_flag +pic_mode=$pic_mode + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_compiler_c_o + +# Can we write directly to a .lo ? +compiler_o_lo=$lt_compiler_o_lo + +# Must we lock files when doing compilation ? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_global_symbol_to_cdecl + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + case $host_os in + aix3*) + cat <<\EOF >> "${ofile}T" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + case $host_os in + cygwin* | mingw* | pw32* | os2*) + cat <<'EOF' >> "${ofile}T" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# */ +# +# #include /* for printf() */ +# #include /* for open(), lseek(), read() */ +# #include /* for O_RDONLY, O_BINARY */ +# #include /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) + + mv -f "${ofile}T" "$ofile" || \ + (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") + chmod +x "$ofile" +fi + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + +#AC_CHECK_TOOL(LD, ld, ld) +#AC_CHECK_TOOL(AR, ar, ar) + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile include/Makefile src/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@LD@%$LD%g +s%@AR@%$AR%g +s%@CC@%$CC%g +s%@RANLIB@%$RANLIB%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@LN_S@%$LN_S%g +s%@OBJEXT@%$OBJEXT%g +s%@EXEEXT@%$EXEEXT%g +s%@ECHO@%$ECHO%g +s%@STRIP@%$STRIP%g +s%@CPP@%$CPP%g +s%@LIBTOOL@%$LIBTOOL%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 00000000..442f19ff --- /dev/null +++ b/configure.in @@ -0,0 +1,21 @@ +dnl +dnl $Id$ +dnl +dnl Process this file with autoconf to produce a configure script. +dnl +AC_INIT() +AM_INIT_AUTOMAKE(bluez-libs, 2.0) + +AC_PREFIX_DEFAULT(/usr) + +AC_SUBST(LD) +AC_SUBST(AR) + +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_INSTALL +AC_PROG_LIBTOOL +#AC_CHECK_TOOL(LD, ld, ld) +#AC_CHECK_TOOL(AR, ar, ar) + +AC_OUTPUT(Makefile include/Makefile src/Makefile) diff --git a/conftest b/conftest new file mode 100755 index 00000000..0a5bb3d5 Binary files /dev/null and b/conftest differ diff --git a/conftest.c b/conftest.c new file mode 100644 index 00000000..cb8c7a57 --- /dev/null +++ b/conftest.c @@ -0,0 +1 @@ +static int dummy; diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 00000000..dceb3447 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,9 @@ +# +# $Id$ +# + +hdrdir = $(prefix)/include/bluetooth + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(hdrdir) + $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 00000000..5a8de87a --- /dev/null +++ b/include/Makefile.in @@ -0,0 +1,194 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# +# $Id$ +# + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +EXEEXT = @EXEEXT@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +hdrdir = $(prefix)/include/bluetooth +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = include + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(hdrdir) + $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) + +# 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/include/bluetooth.h b/include/bluetooth.h new file mode 100644 index 00000000..441e1d3a --- /dev/null +++ b/include/bluetooth.h @@ -0,0 +1,111 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __BLUETOOTH_H +#define __BLUETOOTH_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#ifndef AF_BLUETOOTH +#define AF_BLUETOOTH 31 +#define PF_BLUETOOTH AF_BLUETOOTH +#endif + +#define BTPROTO_L2CAP 0 +#define BTPROTO_HCI 1 +#define BTPROTO_SCO 2 +#define BTPROTO_RFCOMM 3 + +#define SOL_HCI 0 +#define SOL_L2CAP 6 +#define SOL_SCO 17 +#define SOL_RFCOMM 18 + +/* Connection and socket states */ +enum { + BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */ + BT_OPEN, + BT_BOUND, + BT_LISTEN, + BT_CONNECT, + BT_CONNECT2, + BT_CONFIG, + BT_DISCONN, + BT_CLOSED +}; + +/* Byte order conversions */ +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define htobs(d) (d) +#define htobl(d) (d) +#define btohs(d) (d) +#define btohl(d) (d) +#elif __BYTE_ORDER == __BIG_ENDIAN +#define htobs(d) bswap_16(d) +#define htobl(d) bswap_32(d) +#define btohs(d) bswap_16(d) +#define btohl(d) bswap_32(d) +#else +#error "Unknown byte order" +#endif + +/* BD Address */ +typedef struct { + uint8_t b[6]; +} __attribute__((packed)) bdaddr_t; + +#define BDADDR_ANY ((bdaddr_t *)"\000\000\000\000\000") + +/* Copy, swap, convert BD Address */ +static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) +{ + return memcmp(ba1, ba2, sizeof(bdaddr_t)); +} +static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) +{ + memcpy(dst, src, sizeof(bdaddr_t)); +} + +void baswap(bdaddr_t *dst, bdaddr_t *src); +bdaddr_t *strtoba(char *str); +char *batostr(bdaddr_t *ba); +int ba2str(bdaddr_t *ba, char *str); +int str2ba(char *str, bdaddr_t *ba); + +int bterr(uint16_t code); + +#ifdef __cplusplus +} +#endif + +#endif /* __BLUETOOTH_H */ diff --git a/include/hci.h b/include/hci.h new file mode 100644 index 00000000..3f98ab1d --- /dev/null +++ b/include/hci.h @@ -0,0 +1,768 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_H +#define __HCI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define HCI_MAX_DEV 4 + +#define HCI_MAX_ACL_SIZE 1024 +#define HCI_MAX_SCO_SIZE 255 +#define HCI_MAX_EVENT_SIZE 260 +#define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) + +/* HCI dev events */ +#define HCI_DEV_REG 1 +#define HCI_DEV_UNREG 2 +#define HCI_DEV_UP 3 +#define HCI_DEV_DOWN 4 + +/* HCI device types */ +#define HCI_VHCI 0 +#define HCI_USB 1 +#define HCI_PCCARD 2 +#define HCI_UART 3 +#define HCI_RS232 4 + +/* HCI device flags */ +enum { + HCI_UP, + HCI_INIT, + HCI_RUNNING, + + HCI_PSCAN, + HCI_ISCAN, + HCI_AUTH, + HCI_ENCRYPT, + HCI_INQUIRY, + + HCI_RAW +}; + +/* HCI ioctl defines */ +#define HCIDEVUP _IOW('H', 201, int) +#define HCIDEVDOWN _IOW('H', 202, int) +#define HCIDEVRESET _IOW('H', 203, int) +#define HCIDEVRESTAT _IOW('H', 204, int) + +#define HCIGETDEVLIST _IOR('H', 210, int) +#define HCIGETDEVINFO _IOR('H', 211, int) +#define HCIGETCONNLIST _IOR('H', 212, int) +#define HCIGETCONNINFO _IOR('H', 213, int) + +#define HCISETRAW _IOW('H', 220, int) +#define HCISETSCAN _IOW('H', 221, int) +#define HCISETAUTH _IOW('H', 222, int) +#define HCISETENCRYPT _IOW('H', 223, int) +#define HCISETPTYPE _IOW('H', 224, int) +#define HCISETLINKPOL _IOW('H', 225, int) +#define HCISETLINKMODE _IOW('H', 226, int) + +#define HCIINQUIRY _IOR('H', 240, int) + +/* HCI timeouts */ + +#define HCI_CONN_TIMEOUT (HZ * 40) +#define HCI_DISCONN_TIMEOUT (HZ * 2) +#define HCI_CONN_IDLE_TIMEOUT (HZ * 60) + +#ifndef __NO_HCI_DEFS + +/* HCI Packet types */ +#define HCI_COMMAND_PKT 0x01 +#define HCI_ACLDATA_PKT 0x02 +#define HCI_SCODATA_PKT 0x03 +#define HCI_EVENT_PKT 0x04 +#define HCI_UNKNOWN_PKT 0xff + +/* HCI Packet types */ +#define HCI_DM1 0x0008 +#define HCI_DM3 0x0400 +#define HCI_DM5 0x4000 +#define HCI_DH1 0x0010 +#define HCI_DH3 0x0800 +#define HCI_DH5 0x8000 + +#define HCI_HV1 0x0020 +#define HCI_HV2 0x0040 +#define HCI_HV3 0x0080 + +#define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) +#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) + +/* ACL flags */ +#define ACL_CONT 0x0001 +#define ACL_START 0x0002 +#define ACL_ACTIVE_BCAST 0x0010 +#define ACL_PICO_BCAST 0x0020 + +/* Baseband links */ +#define SCO_LINK 0x00 +#define ACL_LINK 0x01 + +/* LMP features */ +#define LMP_3SLOT 0x01 +#define LMP_5SLOT 0x02 +#define LMP_ENCRYPT 0x04 +#define LMP_SOFFSET 0x08 +#define LMP_TACCURACY 0x10 +#define LMP_RSWITCH 0x20 +#define LMP_HOLD 0x40 +#define LMP_SNIF 0x80 + +#define LMP_PARK 0x01 +#define LMP_RSSI 0x02 +#define LMP_QUALITY 0x04 +#define LMP_SCO 0x08 +#define LMP_HV2 0x10 +#define LMP_HV3 0x20 +#define LMP_ULAW 0x40 +#define LMP_ALAW 0x80 + +#define LMP_CVSD 0x01 +#define LMP_PSCHEME 0x02 +#define LMP_PCONTROL 0x04 + +/* Link policies */ +#define HCI_LP_RSWITCH 0x0001 +#define HCI_LP_HOLD 0x0002 +#define HCI_LP_SNIFF 0x0004 +#define HCI_LP_PARK 0x0008 + +/* Link mode */ +#define HCI_LM_ACCEPT 0x8000 +#define HCI_LM_MASTER 0x0001 +#define HCI_LM_AUTH 0x0002 +#define HCI_LM_ENCRYPT 0x0004 +#define HCI_LM_TRUSTED 0x0008 + +/* ----- HCI Commands ----- */ +/* OGF & OCF values */ + +/* Informational Parameters */ +#define OGF_INFO_PARAM 0x04 + +#define OCF_READ_LOCAL_VERSION 0x0001 +typedef struct { + uint8_t status; + uint8_t hci_ver; + uint16_t hci_rev; + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) read_local_version_rp; +#define READ_LOCAL_VERSION_RP_SIZE 9 + +#define OCF_READ_LOCAL_FEATURES 0x0003 +typedef struct { + uint8_t status; + uint8_t features[8]; +} __attribute__ ((packed)) read_local_features_rp; + +#define OCF_READ_BUFFER_SIZE 0x0005 +typedef struct { + uint8_t status; + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) read_buffer_size_rp; + +#define OCF_READ_BD_ADDR 0x0009 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) read_bd_addr_rp; + +/* Host Controller and Baseband */ +#define OGF_HOST_CTL 0x03 +#define OCF_RESET 0x0003 +#define OCF_READ_AUTH_ENABLE 0x001F +#define OCF_WRITE_AUTH_ENABLE 0x0020 + #define AUTH_DISABLED 0x00 + #define AUTH_ENABLED 0x01 + +#define OCF_READ_ENCRYPT_MODE 0x0021 +#define OCF_WRITE_ENCRYPT_MODE 0x0022 + #define ENCRYPT_DISABLED 0x00 + #define ENCRYPT_P2P 0x01 + #define ENCRYPT_BOTH 0x02 + +#define OCF_WRITE_CA_TIMEOUT 0x0016 +#define OCF_WRITE_PG_TIMEOUT 0x0018 + +#define OCF_WRITE_SCAN_ENABLE 0x001A + #define SCAN_DISABLED 0x00 + #define SCAN_INQUIRY 0x01 + #define SCAN_PAGE 0x02 + +#define OCF_SET_EVENT_FLT 0x0005 +typedef struct { + uint8_t flt_type; + uint8_t cond_type; + uint8_t condition[0]; +} __attribute__ ((packed)) set_event_flt_cp; +#define SET_EVENT_FLT_CP_SIZE 2 + +/* Filter types */ +#define FLT_CLEAR_ALL 0x00 +#define FLT_INQ_RESULT 0x01 +#define FLT_CONN_SETUP 0x02 + +/* CONN_SETUP Condition types */ +#define CONN_SETUP_ALLOW_ALL 0x00 +#define CONN_SETUP_ALLOW_CLASS 0x01 +#define CONN_SETUP_ALLOW_BDADDR 0x02 + +/* CONN_SETUP Conditions */ +#define CONN_SETUP_AUTO_OFF 0x01 +#define CONN_SETUP_AUTO_ON 0x02 + +#define OCF_CHANGE_LOCAL_NAME 0x0013 +typedef struct { + uint8_t name[248]; +} __attribute__ ((packed)) change_local_name_cp; +#define CHANGE_LOCAL_NAME_CP_SIZE 248 + +#define OCF_READ_LOCAL_NAME 0x0014 +typedef struct { + uint8_t status; + uint8_t name[248]; +} __attribute__ ((packed)) read_local_name_rp; +#define READ_LOCAL_NAME_RP_SIZE 249 + +#define OCF_READ_CLASS_OF_DEV 0x0023 +typedef struct { + uint8_t status; + uint8_t dev_class[3]; +} __attribute__ ((packed)) read_class_of_dev_rp; +#define READ_CLASS_OF_DEV_RP_SIZE 4 + +#define OCF_WRITE_CLASS_OF_DEV 0x0024 +typedef struct { + uint8_t dev_class[3]; +} __attribute__ ((packed)) write_class_of_dev_cp; +#define WRITE_CLASS_OF_DEV_CP_SIZE 3 + +#define OCF_HOST_BUFFER_SIZE 0x0033 +typedef struct { + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) host_buffer_size_cp; +#define HOST_BUFFER_SIZE_CP_SIZE 7 + +/* Link Control */ +#define OGF_LINK_CTL 0x01 +#define OCF_CREATE_CONN 0x0005 +typedef struct { + bdaddr_t bdaddr; + uint16_t pkt_type; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; + uint16_t clock_offset; + uint8_t role_switch; +} __attribute__ ((packed)) create_conn_cp; +#define CREATE_CONN_CP_SIZE 13 + +#define OCF_ACCEPT_CONN_REQ 0x0009 +typedef struct { + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) accept_conn_req_cp; +#define ACCEPT_CONN_REQ_CP_SIZE 7 + +#define OCF_REJECT_CONN_REQ 0x000a +typedef struct { + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) reject_conn_req_cp; +#define REJECT_CONN_REQ_CP_SIZE 7 + +#define OCF_DISCONNECT 0x0006 +typedef struct { + uint16_t handle; + uint8_t reason; +} __attribute__ ((packed)) disconnect_cp; +#define DISCONNECT_CP_SIZE 3 + +#define OCF_ADD_SCO 0x0007 +typedef struct { + uint16_t handle; + uint16_t pkt_type; +} __attribute__ ((packed)) add_sco_cp; +#define ADD_SCO_CP_SIZE 4 + +#define OCF_INQUIRY 0x0001 +typedef struct { + uint8_t lap[3]; + uint8_t lenght; + uint8_t num_rsp; +} __attribute__ ((packed)) inquiry_cp; +#define INQUIRY_CP_SIZE 5 + +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) status_bdaddr_rp; +#define STATUS_BDADDR_RP_SIZE 7 + +#define OCF_LINK_KEY_REPLY 0x000B +#define OCF_LINK_KEY_NEG_REPLY 0x000C +typedef struct { + bdaddr_t bdaddr; + uint8_t link_key[16]; +} __attribute__ ((packed)) link_key_reply_cp; +#define LINK_KEY_REPLY_CP_SIZE 22 + +#define OCF_PIN_CODE_REPLY 0x000D +#define OCF_PIN_CODE_NEG_REPLY 0x000E +typedef struct { + bdaddr_t bdaddr; + uint8_t pin_len; + uint8_t pin_code[16]; +} __attribute__ ((packed)) pin_code_reply_cp; +#define PIN_CODE_REPLY_CP_SIZE 23 + +#define OCF_SET_CONN_PTYPE 0x000F +typedef struct { + uint16_t handle; + uint16_t pkt_type; +} __attribute__ ((packed)) set_conn_ptype_cp; +#define SET_CONN_PKT_TYPE_CP_SIZE 4 + +#define OCF_AUTH_REQUESTED 0x0011 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) auth_requested_cp; +#define AUTH_REQUESTED_CP_SIZE 2 + +#define OCF_SET_CONN_ENCRYPT 0x0013 +typedef struct { + uint16_t handle; + uint8_t encrypt; +} __attribute__ ((packed)) set_conn_encrypt_cp; +#define SET_CONN_ENCRYPT_CP_SIZE 3 + +#define OCF_REMOTE_NAME_REQ 0x0019 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; + uint16_t clock_offset; +} __attribute__ ((packed)) remote_name_req_cp; +#define REMOTE_NAME_REQ_CP_SIZE 10 + +#define OCF_READ_REMOTE_FEATURES 0x001B +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_remote_features_cp; +#define READ_REMOTE_FEATURES_CP_SIZE 2 + +#define OCF_READ_REMOTE_VERSION 0x001D +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_remote_version_cp; +#define READ_REMOTE_VERSION_CP_SIZE 2 + +/* Link Policy */ +#define OGF_LINK_POLICY 0x02 +#define OCF_ROLE_DISCOVERY 0x0009 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) role_discovery_cp; +#define ROLE_DISCOVERY_CP_SIZE 2 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t role; +} __attribute__ ((packed)) role_discovery_rp; +#define ROLE_DISCOVERY_RP_SIZE 4 + +#define OCF_READ_LINK_POLICY 0x000C +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_link_policy_cp; +#define READ_LINK_POLICY_CP_SIZE 2 +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t policy; +} __attribute__ ((packed)) read_link_policy_rp; +#define READ_LINK_POLICY_RP_SIZE 5 + +#define OCF_SWITCH_ROLE 0x000B +typedef struct { + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) switch_role_cp; +#define SWITCH_ROLE_CP_SIZE 7 + +#define OCF_WRITE_LINK_POLICY 0x000D +typedef struct { + uint16_t handle; + uint16_t policy; +} __attribute__ ((packed)) write_link_policy_cp; +#define WRITE_LINK_POLICY_CP_SIZE 4 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) write_link_policy_rp; +#define WRITE_LINK_POLICY_RP_SIZE 3 + +/* Status params */ +#define OGF_STATUS_PARAM 0x05 + +/* ---- HCI Events ---- */ +#define EVT_INQUIRY_COMPLETE 0x01 + +#define EVT_INQUIRY_RESULT 0x02 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t pscan_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; +} __attribute__ ((packed)) inquiry_info; +#define INQUIRY_INFO_SIZE 14 + +#define EVT_CONN_COMPLETE 0x03 +typedef struct { + uint8_t status; + uint16_t handle; + bdaddr_t bdaddr; + uint8_t link_type; + uint8_t encr_mode; +} __attribute__ ((packed)) evt_conn_complete; +#define EVT_CONN_COMPLETE_SIZE 13 + +#define EVT_CONN_REQUEST 0x04 +typedef struct { + bdaddr_t bdaddr; + uint8_t dev_class[3]; + uint8_t link_type; +} __attribute__ ((packed)) evt_conn_request; +#define EVT_CONN_REQUEST_SIZE 10 + +#define EVT_DISCONN_COMPLETE 0x05 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t reason; +} __attribute__ ((packed)) evt_disconn_complete; +#define EVT_DISCONN_COMPLETE_SIZE 4 + +#define EVT_AUTH_COMPLETE 0x06 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) evt_auth_complete; +#define EVT_AUTH_COMPLETE_SIZE 3 + +#define EVT_REMOTE_NAME_REQ_COMPLETE 0x07 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; + uint8_t name[248]; +} __attribute__ ((packed)) evt_remote_name_req_complete; +#define EVT_REMOTE_NAME_REQ_COMPLETE_SIZE 255 + +#define EVT_ENCRYPT_CHANGE 0x08 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t encrypt; +} __attribute__ ((packed)) evt_encrypt_change; +#define EVT_ENCRYPT_CHANGE_SIZE 5 + +#define EVT_QOS_SETUP_COMPLETE 0x0D +typedef struct { + uint8_t service_type; + uint32_t token_rate; + uint32_t peak_bandwidth; + uint32_t latency; + uint32_t delay_variation; +} __attribute__ ((packed)) hci_qos; +typedef struct { + uint8_t status; + uint16_t handle; + hci_qos qos; +} __attribute__ ((packed)) evt_qos_setup_complete; +#define EVT_QOS_SETUP_COMPLETE_SIZE 20 + +#define EVT_CMD_COMPLETE 0x0e +typedef struct { + uint8_t ncmd; + uint16_t opcode; +} __attribute__ ((packed)) evt_cmd_complete; +#define EVT_CMD_COMPLETE_SIZE 3 + +#define EVT_CMD_STATUS 0x0f +typedef struct { + uint8_t status; + uint8_t ncmd; + uint16_t opcode; +} __attribute__ ((packed)) evt_cmd_status; +#define EVT_CMD_STATUS_SIZE 4 + +#define EVT_NUM_COMP_PKTS 0x13 +typedef struct { + uint8_t num_hndl; + /* variable lenght part */ +} __attribute__ ((packed)) evt_num_comp_pkts; +#define EVT_NUM_COMP_PKTS_SIZE 1 + +#define EVT_ROLE_CHANGE 0x12 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) evt_role_change; +#define EVT_ROLE_CHANGE_SIZE 1 + +#define EVT_PIN_CODE_REQ 0x16 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_pin_code_req; +#define EVT_PIN_CODE_REQ_SIZE 6 + +#define EVT_LINK_KEY_REQ 0x17 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_link_key_req; +#define EVT_LINK_KEY_REQ_SIZE 6 + +#define EVT_LINK_KEY_NOTIFY 0x18 +typedef struct { + bdaddr_t bdaddr; + uint8_t link_key[16]; + uint8_t key_type; +} __attribute__ ((packed)) evt_link_key_notify; +#define EVT_LINK_KEY_NOTIFY_SIZE 23 + +#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t features[8]; +} __attribute__ ((packed)) evt_read_remote_features_complete; +#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11 + +#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) evt_read_remote_version_complete; +#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8 + +/* Internal events generated by BlueZ stack */ +#define EVT_STACK_INTERNAL 0xfd +typedef struct { + uint16_t type; + uint8_t data[0]; +} __attribute__ ((packed)) evt_stack_internal; +#define EVT_STACK_INTERNAL_SIZE 2 + +#define EVT_SI_DEVICE 0x01 +typedef struct { + uint16_t event; + uint16_t dev_id; +} __attribute__ ((packed)) evt_si_device; +#define EVT_SI_DEVICE_SIZE 4 + +#define EVT_SI_SECURITY 0x02 +typedef struct { + uint16_t event; + uint16_t proto; + uint16_t subproto; + uint8_t incomming; +} __attribute__ ((packed)) evt_si_security; + +/* -------- HCI Packet structures -------- */ +#define HCI_TYPE_LEN 1 + +typedef struct { + uint16_t opcode; /* OCF & OGF */ + uint8_t plen; +} __attribute__ ((packed)) hci_command_hdr; +#define HCI_COMMAND_HDR_SIZE 3 + +typedef struct { + uint8_t evt; + uint8_t plen; +} __attribute__ ((packed)) hci_event_hdr; +#define HCI_EVENT_HDR_SIZE 2 + +typedef struct { + uint16_t handle; /* Handle & Flags(PB, BC) */ + uint16_t dlen; +} __attribute__ ((packed)) hci_acl_hdr; +#define HCI_ACL_HDR_SIZE 4 + +typedef struct { + uint16_t handle; + uint8_t dlen; +} __attribute__ ((packed)) hci_sco_hdr; +#define HCI_SCO_HDR_SIZE 3 + +/* Command opcode pack/unpack */ +#define cmd_opcode_pack(ogf, ocf) (uint16_t)((ocf & 0x03ff)|(ogf << 10)) +#define cmd_opcode_ogf(op) (op >> 10) +#define cmd_opcode_ocf(op) (op & 0x03ff) + +/* ACL handle and flags pack/unpack */ +#define acl_handle_pack(h, f) (uint16_t)((h & 0x0fff)|(f << 12)) +#define acl_handle(h) (h & 0x0fff) +#define acl_flags(h) (h >> 12) + +#endif /* _NO_HCI_DEFS */ + +/* HCI Socket options */ +#define HCI_DATA_DIR 1 +#define HCI_FILTER 2 +#define HCI_TIME_STAMP 3 + +/* HCI CMSG flags */ +#define HCI_CMSG_DIR 0x0001 +#define HCI_CMSG_TSTAMP 0x0002 + +struct sockaddr_hci { + sa_family_t hci_family; + unsigned short hci_dev; +}; +#define HCI_DEV_NONE 0xffff + +struct hci_filter { + uint32_t type_mask; + uint32_t event_mask[2]; + uint16_t opcode; +}; + +#define HCI_FLT_TYPE_BITS 31 +#define HCI_FLT_EVENT_BITS 63 +#define HCI_FLT_OGF_BITS 63 +#define HCI_FLT_OCF_BITS 127 + +/* Ioctl requests structures */ +struct hci_dev_stats { + uint32_t err_rx; + uint32_t err_tx; + uint32_t cmd_tx; + uint32_t evt_rx; + uint32_t acl_tx; + uint32_t acl_rx; + uint32_t sco_tx; + uint32_t sco_rx; + uint32_t byte_rx; + uint32_t byte_tx; +}; + +struct hci_dev_info { + uint16_t dev_id; + char name[8]; + + bdaddr_t bdaddr; + + uint32_t flags; + uint8_t type; + + uint8_t features[8]; + + uint32_t pkt_type; + uint32_t link_policy; + uint32_t link_mode; + + uint16_t acl_mtu; + uint16_t acl_max; + uint16_t sco_mtu; + uint16_t sco_max; + + struct hci_dev_stats stat; +}; + +struct hci_conn_info { + uint16_t handle; + bdaddr_t bdaddr; + uint8_t type; + uint8_t out; + uint16_t state; + uint32_t link_mode; +}; + +struct hci_dev_req { + uint16_t dev_id; + uint32_t dev_opt; +}; + +struct hci_dev_list_req { + uint16_t dev_num; + struct hci_dev_req dev_req[0]; /* hci_dev_req structures */ +}; + +struct hci_conn_list_req { + uint16_t dev_id; + uint16_t conn_num; + struct hci_conn_info conn_info[0]; +}; + +struct hci_conn_info_req { + bdaddr_t bdaddr; + uint8_t type; + struct hci_conn_info conn_info[0]; +}; + +struct hci_inquiry_req { + uint16_t dev_id; + uint16_t flags; + uint8_t lap[3]; + uint8_t length; + uint8_t num_rsp; +}; +#define IREQ_CACHE_FLUSH 0x0001 + +struct hci_remotename_req { + uint16_t dev_id; + uint16_t flags; + bdaddr_t bdaddr; + uint8_t name[248]; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __HCI_H */ diff --git a/include/hci_lib.h b/include/hci_lib.h new file mode 100644 index 00000000..0776e1ba --- /dev/null +++ b/include/hci_lib.h @@ -0,0 +1,115 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_LIB_H +#define __HCI_LIB_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct hci_request { + uint16_t ogf; + uint16_t ocf; + int event; + void *cparam; + int clen; + void *rparam; + int rlen; +}; + +struct hci_version { + uint16_t manufacturer; + uint8_t hci_ver; + uint16_t hci_rev; + uint8_t lmp_ver; + uint16_t lmp_subver; +}; + +int hci_open_dev(int dev_id); +int hci_close_dev(int dd); +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); + +int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to); +int hci_disconnect(int dd, int hndl, int res, int to); + +inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); +int hci_devinfo(int dev_id, struct hci_dev_info *di); + +int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); +int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to); +int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to); +int hci_read_local_version(int dd, struct hci_version *ver, int to); + +char *hci_dtypetostr(int type); +char *hci_dflagstostr(uint32_t flags); +char *hci_ptypetostr(unsigned int ptype); +int hci_strtoptype(char *str, unsigned int *val); +char *hci_lptostr(unsigned int ptype); +int hci_strtolp(char *str, unsigned int *val); +char *hci_lmtostr(unsigned int ptype); +int hci_strtolm(char *str, unsigned int *val); + +static inline void hci_set_bit(int nr, void *addr) +{ + *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); +} + +static inline int hci_test_bit(int nr, void *addr) +{ + return *((uint32_t *) addr + (nr >> 5)) & (1 << (nr & 31)); +} + +/* HCI filter tools */ +static inline void hci_filter_clear(struct hci_filter *f) +{ + memset(f, 0, sizeof(*f)); +} +static inline void hci_filter_set_ptype(int t, struct hci_filter *f) +{ + hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); +} +static inline void hci_filter_set_event(int e, struct hci_filter *f) +{ + hci_set_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); +} +static inline void hci_filter_all_events(struct hci_filter *f) +{ + memset((void *)f->event_mask, 0xff, sizeof(f->event_mask)); +} +static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) +{ + f->opcode = opcode; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __HCI_LIB_H */ diff --git a/include/hci_uart.h b/include/hci_uart.h new file mode 100644 index 00000000..e609ed47 --- /dev/null +++ b/include/hci_uart.h @@ -0,0 +1,45 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_UART_H +#define __HCI_UART_H + +#ifndef N_HCI +#define N_HCI 15 +#endif + +/* Ioctls */ +#define HCIUARTSETPROTO _IOW('U', 200, int) +#define HCIUARTGETPROTO _IOR('U', 201, int) + +/* UART protocols */ +#define HCI_UART_H4 0 +#define HCI_UART_BCSP 1 +#define HCI_UART_NCSP 2 + +#endif /* __HCI_UART_H */ diff --git a/include/hci_vhci.h b/include/hci_vhci.h new file mode 100644 index 00000000..4eee6656 --- /dev/null +++ b/include/hci_vhci.h @@ -0,0 +1,35 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __HCI_VHCI_H +#define __HCI_VHCI_H + +#define VHCI_DEV "/dev/vhci" +#define VHCI_MINOR 250 + +#endif /* __HCI_VHCI_H */ diff --git a/include/l2cap.h b/include/l2cap.h new file mode 100644 index 00000000..25178401 --- /dev/null +++ b/include/l2cap.h @@ -0,0 +1,200 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __L2CAP_H +#define __L2CAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* L2CAP defaults */ +#define L2CAP_DEFAULT_MTU 672 +#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF + +#define L2CAP_CONN_TIMEOUT (HZ * 40) + +/* L2CAP socket address */ +struct sockaddr_l2 { + sa_family_t l2_family; + unsigned short l2_psm; + bdaddr_t l2_bdaddr; +}; + +/* Socket options */ +#define L2CAP_OPTIONS 0x01 +struct l2cap_options { + uint16_t omtu; + uint16_t imtu; + uint16_t flush_to; +}; + +#define L2CAP_CONNINFO 0x02 +struct l2cap_conninfo { + uint16_t hci_handle; +}; + +#define L2CAP_LM 0x03 +#define L2CAP_LM_MASTER 0x0001 +#define L2CAP_LM_AUTH 0x0002 +#define L2CAP_LM_ENCRYPT 0x0004 +#define L2CAP_LM_TRUSTED 0x0008 + +#define L2CAP_QOS 0x04 +struct l2cap_qos { + uint16_t service_type; + uint32_t token_rate; + uint32_t token_bucket_size; + uint32_t peak_bandwidth; + uint32_t latency; + uint32_t delay_variation; +}; + +#define L2CAP_SERV_NO_TRAFFIC 0x00 +#define L2CAP_SERV_BEST_EFFORT 0x01 +#define L2CAP_SERV_GUARANTEED 0x02 + +/* L2CAP command codes */ +#define L2CAP_COMMAND_REJ 0x01 +#define L2CAP_CONN_REQ 0x02 +#define L2CAP_CONN_RSP 0x03 +#define L2CAP_CONF_REQ 0x04 +#define L2CAP_CONF_RSP 0x05 +#define L2CAP_DISCONN_REQ 0x06 +#define L2CAP_DISCONN_RSP 0x07 +#define L2CAP_ECHO_REQ 0x08 +#define L2CAP_ECHO_RSP 0x09 +#define L2CAP_INFO_REQ 0x0a +#define L2CAP_INFO_RSP 0x0b + +/* L2CAP structures */ +typedef struct { + uint16_t len; + uint16_t cid; +} __attribute__ ((packed)) l2cap_hdr; +#define L2CAP_HDR_SIZE 4 + +typedef struct { + uint8_t code; + uint8_t ident; + uint16_t len; +} __attribute__ ((packed)) l2cap_cmd_hdr; +#define L2CAP_CMD_HDR_SIZE 4 + +typedef struct { + uint16_t reason; +} __attribute__ ((packed)) l2cap_cmd_rej; +#define L2CAP_CMD_REJ_SIZE 2 + +typedef struct { + uint16_t psm; + uint16_t scid; +} __attribute__ ((packed)) l2cap_conn_req; +#define L2CAP_CONN_REQ_SIZE 4 + +typedef struct { + uint16_t dcid; + uint16_t scid; + uint16_t result; + uint16_t status; +} __attribute__ ((packed)) l2cap_conn_rsp; +#define L2CAP_CONN_RSP_SIZE 8 + +/* connect result */ +#define L2CAP_CR_SUCCESS 0x0000 +#define L2CAP_CR_PEND 0x0001 +#define L2CAP_CR_BAD_PSM 0x0002 +#define L2CAP_CR_SEC_BLOCK 0x0003 +#define L2CAP_CR_NO_MEM 0x0004 + +/* connect status */ +#define L2CAP_CS_NO_INFO 0x0000 +#define L2CAP_CS_AUTHEN_PEND 0x0001 +#define L2CAP_CS_AUTHOR_PEND 0x0002 + +typedef struct { + uint16_t dcid; + uint16_t flags; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_req; +#define L2CAP_CONF_REQ_SIZE 4 + +typedef struct { + uint16_t scid; + uint16_t flags; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_rsp; +#define L2CAP_CONF_RSP_SIZE 6 + +#define L2CAP_CONF_SUCCESS 0x00 +#define L2CAP_CONF_UNACCEPT 0x01 + +typedef struct { + uint8_t type; + uint8_t len; + uint8_t val[0]; +} __attribute__ ((packed)) l2cap_conf_opt; +#define L2CAP_CONF_OPT_SIZE 2 + +#define L2CAP_CONF_MTU 0x01 +#define L2CAP_CONF_FLUSH_TO 0x02 +#define L2CAP_CONF_QOS 0x03 + +#define L2CAP_CONF_MAX_SIZE 22 + +typedef struct { + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_req; +#define L2CAP_DISCONN_REQ_SIZE 4 + +typedef struct { + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_rsp; +#define L2CAP_DISCONN_RSP_SIZE 4 + +typedef struct { + uint16_t type; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_req; +#define L2CAP_INFO_REQ_SIZE 2 + +typedef struct { + uint16_t type; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_rsp; +#define L2CAP_INFO_RSP_SIZE 4 + +#ifdef __cplusplus +} +#endif + +#endif /* __L2CAP_H */ diff --git a/include/sco.h b/include/sco.h new file mode 100644 index 00000000..c02bd7ae --- /dev/null +++ b/include/sco.h @@ -0,0 +1,65 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __SCO_H +#define __SCO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* SCO defaults */ +#define SCO_DEFAULT_MTU 500 +#define SCO_DEFAULT_FLUSH_TO 0xFFFF + +#define SCO_CONN_TIMEOUT (HZ * 40) +#define SCO_DISCONN_TIMEOUT (HZ * 2) +#define SCO_CONN_IDLE_TIMEOUT (HZ * 60) + +/* SCO socket address */ +struct sockaddr_sco { + sa_family_t sco_family; + bdaddr_t sco_bdaddr; +}; + +/* set/get sockopt defines */ +#define SCO_OPTIONS 0x01 +struct sco_options { + uint16_t mtu; +}; + +#define SCO_CONNINFO 0x02 +struct sco_conninfo { + uint16_t hci_handle; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __SCO_H */ diff --git a/install-sh b/install-sh new file mode 100755 index 00000000..e9de2384 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 00000000..2393e14d --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,4946 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +# Parse our command line options once, thoroughly. +while test $# -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + exit 0 + ;; + + --config) + sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 + exit 0 + ;; + + --debug) + echo "$progname: enabling shell trace mode" + set -x + ;; + + --dry-run | -n) + run=: + ;; + + --features) + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + exit 0 + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --quiet | --silent) + show=: + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 +fi + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + case $nonopt in + *cc | *++ | gcc* | *-gcc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + prev= + lastarg= + srcfile="$nonopt" + suppress_output= + + user_target=no + for arg + do + case $prev in + "") ;; + xcompiler) + # Aesthetically quote the previous argument. + prev= + lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + + case $arg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + + # Accept any command-line options. + case $arg in + -o) + if test "$user_target" != "no"; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit 1 + fi + user_target=next + ;; + + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + continue + ;; + esac + + case $user_target in + next) + # The next one is the -o target name + user_target=yes + continue + ;; + yes) + # We got the output file + user_target=set + libobj="$arg" + continue + ;; + esac + + # Accept the current argument as the source file. + lastarg="$srcfile" + srcfile="$arg" + + # Aesthetically quote the previous argument. + + # Backslashify any backslashes, double quotes, and dollar signs. + # These are the only characters that are still specially + # interpreted inside of double-quoted scrings. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $lastarg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + done + + case $user_target in + set) + ;; + no) + # Get the name of the library object. + libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + *) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit 1 + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSfmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit 1 + ;; + esac + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $libobj" + else + removelist="$libobj" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit 1" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit 1" 1 2 15 + else + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$0" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + echo $srcfile > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + + # 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 + # All platforms use -DPIC, to notify preprocessed assembler code. + command="$base_compile $srcfile $pic_flag -DPIC" + else + # Don't build PIC code + command="$base_compile $srcfile" + fi + if test "$build_old_libs" = yes; then + lo_libobj="$libobj" + dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$libobj"; then + dir="$objdir" + else + dir="$dir/$objdir" + fi + libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + + if test -d "$dir"; then + $show "$rm $libobj" + $run $rm $libobj + else + $show "$mkdir $dir" + $run $mkdir $dir + status=$? + if test $status -ne 0 && test ! -d $dir; then + exit $status + fi + fi + fi + if test "$compiler_o_lo" = yes; then + output_obj="$libobj" + command="$command -o $output_obj" + elif test "$compiler_c_o" = yes; then + output_obj="$obj" + command="$command -o $output_obj" + fi + + $run $rm "$output_obj" + $show "$command" + if $run eval "$command"; then : + else + test -n "$output_obj" && $run $rm $removelist + exit 1 + fi + + 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." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed, then go on to compile the next one + if test x"$output_obj" != x"$libobj"; then + $show "$mv $output_obj $libobj" + if $run $mv $output_obj $libobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # If we have no pic_flag, then copy the object into place and finish. + if (test -z "$pic_flag" || test "$pic_mode" != default) && + test "$build_old_libs" = yes; then + # Rename the .lo from within objdir to obj + if test -f $obj; then + $show $rm $obj + $run $rm $obj + fi + + $show "$mv $libobj $obj" + if $run $mv $libobj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` + libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + # Now arrange that obj and lo_libobj become the same file + $show "(cd $xdir && $LN_S $baseobj $libobj)" + if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then + exit 0 + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Allow error messages only from the first compilation. + suppress_output=' >/dev/null 2>&1' + 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 $srcfile" + else + # All platforms use -DPIC, to notify preprocessed assembler code. + command="$base_compile $srcfile $pic_flag -DPIC" + fi + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + output_obj="$obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + $run $rm "$output_obj" + $show "$command" + if $run eval "$command"; then : + else + $run $rm $removelist + exit 1 + fi + + 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." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed + if test x"$output_obj" != x"$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Create an invalid libtool object if no PIC, so that we do not + # accidentally link it into a program. + if test "$build_libtool_libs" != yes; then + $show "echo timestamp > $libobj" + $run eval "echo timestamp > \$libobj" || exit $? + else + # Move the .lo from within objdir + $show "$mv $libobj $lo_libobj" + if $run $mv $libobj $lo_libobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + fi + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + $run $rm "$lockfile" + fi + + exit 0 + ;; + + # libtool link mode + link | relink) + modename="$modename: link" + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # 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 invokation. + # 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" + 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` + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -all-static | -static) + if test "X$arg" = "X-all-static"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test $# -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit 1 + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n $prev + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit 1 + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + 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*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit 1 + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -o) prev=output ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.lo | *.$objext) + # A library or standard object. + if test "$prev" = dlfiles; then + # This file was specified with -dlopen. + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $arg" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` + prev= + else + case $arg in + *.lo) libobjs="$libobjs $arg" ;; + *) objs="$objs $arg" ;; + esac + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d $output_objdir; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $output_objdir; then + exit $status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + *.$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 + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + libs="$libs $deplib" + done + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit 1 + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode" = prog; then + # Determine which files to process + case $pass in + dlopen) + libs="$dlfiles" + save_deplibs="$deplibs" # Collect dlpreopened libraries + deplibs= + ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -l*) + if test "$linkmode" = oldlib && test "$linkmode" = obj; then + $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 + continue + fi + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + # Search the libtool library + lib="$searchdir/lib${name}.la" + if test -f "$lib"; then + found=yes + break + fi + 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 + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + if test "$deplibs_check_method" != pass_all; then + echo + echo "*** Warning: This library needs some functionality provided by $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + else + echo + echo "*** Warning: Linking the shared library $output against the" + echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test $found = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit 1 + fi + + # Check to see that this really is a libtool archive. + if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variable installed. + installed=yes + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then + # Add dl[pre]opened files of deplib + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit 1 + fi + continue + fi # $pass = conv + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit 1 + 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. + dlprefiles="$dlprefiles $lib" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" + fi + continue + fi + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test $linkalldeplibs = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # Link against this shared library + + if test "$linkmode,$pass" = "prog,link" || + { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + if test "$linkmode" = prog; then + # We need to hardcode the library path + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + fi + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { 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 + + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`echo $soroot | sed -e 's/^.*\///'` + newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + eval cmds=\"$extract_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + eval cmds=\"$old_archive_from_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n $old_archive_from_expsyms_cmds + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + 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 + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + + # Try to link the static library + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + 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 library needs some functionality provided by $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** Therefore, libtool will create a static module, that should work " + echo "*** as long as the dlopening application is linked with the -dlopen flag." + 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 + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || test $build_old_libs = yes || + test $link_static = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="-L$absdir/$objdir" + else + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="-L$absdir" + fi + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$deplibs $path" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $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 + test "$pass" != scan && dependency_libs="$newdependency_libs" + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + *) + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + if test "$pass" = "conv" && + { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then + libs="$deplibs" # reset libs + deplibs= + fi + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit 1 + else + echo + echo "*** Warning: Linking the shared library $output against the non-libtool" + echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test $# -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + libext=al + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + current="$2" + revision="$3" + age="$4" + + # 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]) ;; + *) + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $revision in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $age in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + if test $age -gt $current; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix) + major=`expr $current - $age + 1` + verstring="sgi$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test $loop != 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="sgi$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test $loop != 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + verstring="0.0" + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs. + $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" + $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` + deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` + dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test $hardcode_into_libs != yes || test $build_old_libs = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behaviour. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | sed 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | sed 10q \ + | egrep "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + if eval echo \"$potent_lib\" 2>/dev/null \ + | sed 10q \ + | egrep "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | + grep . >/dev/null; then + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + echo "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test $allow_undefined = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + 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 + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + test -z "$dlname" && dlname=$soname + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Ensure that we have .o objects for linkers which dislike .lo + # (e.g. aix) in case we are running --disable-static + for obj in $libobjs; do + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + if test ! -f $xdir/$oldobj; then + $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" + $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? + fi + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + eval cmds=\"$export_symbols_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit 0 + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit 1 + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + $show "echo timestamp > $libobj" + $run eval "echo timestamp > $libobj" || exit $? + exit 0 + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + else + # Just create a symlink. + $show $rm $libobj + $run $rm $libobj + xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$libobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + $show "(cd $xdir && $LN_S $oldobj $baseobj)" + $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + ;; + + prog) + case $host in + *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$output.exp" + $run $rm $export_symbols + $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`echo "$arg" | sed -e 's%^.*/%%'` + $run eval 'echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{\ +" + + sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ + -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ + < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr_t) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit 1 + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test $need_relink = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit 0 + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="cd `pwd`; $relink_command" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $0 --fallback-echo"; then + case $0 in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; + *) qecho="$SHELL `pwd`/$0 --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`echo $output|sed 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) exeext=.exe ;; + *) exeext= ;; + esac + $rm $output + trap "$rm $output; exit 1" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if (eval \$relink_command); then : + else + $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 >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # win32 systems need to use the prog path for dll + # lookup to work + *-*-cygwin* | *-*-pw32*) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + # Export the path to the program. + PATH=\"\$progdir:\$PATH\" + export PATH + + exec \$program \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit 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\ +" + chmod +x $output + fi + exit 0 + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + eval cmds=\"$old_archive_from_new_cmds\" + else + # Ensure that we have .o objects in place in case we decided + # not to build a shared library, and have fallen back to building + # static libs even though --disable-static was passed! + for oldobj in $oldobjs; do + if test ! -f $oldobj; then + xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$oldobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` + obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + $show "(cd $xdir && ${LN_S} $obj $baseobj)" + $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? + fi + done + + eval cmds=\"$old_archive_cmds\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test $need_relink = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit 0 + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit 1 + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test $# -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + continue + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test $# -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + eval cmds=\"$postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit 0 + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 + exit 1 + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + /usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`echo $destfile | sed -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + eval cmds=\"$old_postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec $SHELL $0 --finish$current_libdirs + exit 1 + fi + + exit 0 + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + eval cmds=\"$finish_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = ":" && exit 0 + + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + echo " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + echo "See any operating system documentation about shared libraries for" + echo "more information, such as the ld(1) and ld.so(8) manual pages." + echo "----------------------------------------------------------------------" + exit 0 + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit 1 + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit 1 + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved enviroment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now actually exec the command. + eval "exec \$cmd$args" + + $echo "$modename: cannot exec \$cmd$args" + exit 1 + 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 0 + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + rmdirs= + + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$objdir" + else + objdir="$dir/$objdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test $mode = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test $mode = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + + if test $mode = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + eval cmds=\"$postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + eval cmds=\"$old_postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test $? != 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + fi + fi + ;; + + *.lo) + if test "$build_old_libs" = yes; then + oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` + rmfiles="$rmfiles $dir/$oldobj" + fi + ;; + + *) + # Do a test to see if this is a libtool program. + if test $mode = clean && + (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$file + + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $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 + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + ;; + esac + + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 +fi # test -z "$show_help" + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE." + exit 0 + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; +esac + +echo +$echo "Try \`$modename --help' for more information about other modes." + +exit 0 + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/missing b/missing new file mode 100755 index 00000000..d46f79f6 --- /dev/null +++ b/missing @@ -0,0 +1,198 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. +# Franc,ois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.in; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`$configure_ac'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`$configure_ac'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`$configure_ac'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 00000000..6b3b5fc5 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id$ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 00000000..cc7b582b --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,10 @@ +# +# $Id$ +# + +lib_LTLIBRARIES = libbluetooth.la + +libbluetooth_la_SOURCES = bluetooth.c hci.c +libbluetooth_la_LDFLAGS = -version-info 1:0:0 + +CFLAGS += -I../include diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 00000000..6da2db02 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,353 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# +# $Id$ +# + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AR = @AR@ +AS = @AS@ +CC = @CC@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +EXEEXT = @EXEEXT@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +lib_LTLIBRARIES = libbluetooth.la + +libbluetooth_la_SOURCES = bluetooth.c hci.c +libbluetooth_la_LDFLAGS = -version-info 1:0:0 + +CFLAGS = -I../include +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +libbluetooth_la_LIBADD = +libbluetooth_la_OBJECTS = bluetooth.lo hci.lo +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +DEP_FILES = .deps/bluetooth.P .deps/hci.P +SOURCES = $(libbluetooth_la_SOURCES) +OBJECTS = $(libbluetooth_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-libLTLIBRARIES: + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + +distclean-libLTLIBRARIES: + +maintainer-clean-libLTLIBRARIES: + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libbluetooth.la: $(libbluetooth_la_OBJECTS) $(libbluetooth_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libbluetooth_la_LDFLAGS) $(libbluetooth_la_OBJECTS) $(libbluetooth_la_LIBADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-libLTLIBRARIES +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-libLTLIBRARIES +uninstall: uninstall-am +all-am: Makefile $(LTLIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ + clean-depend clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-libLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-depend \ + distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-depend \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ +clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ +uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +mostlyclean-libtool distclean-libtool clean-libtool \ +maintainer-clean-libtool tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir mostlyclean-depend \ +distclean-depend clean-depend maintainer-clean-depend info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/bluetooth.c b/src/bluetooth.c new file mode 100644 index 00000000..6dfccf44 --- /dev/null +++ b/src/bluetooth.c @@ -0,0 +1,164 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#include +#include +#include +#include +#include + +#include +#include + +void baswap(bdaddr_t *dst, bdaddr_t *src) +{ + register unsigned char * d = (unsigned char *)dst; + register unsigned char * s = (unsigned char *)src; + register int i; + for(i=0; i<6; i++) + d[i] = s[5-i]; +} + +char * batostr(bdaddr_t *ba) +{ + static char str[2][18]; + static int i = 1; + + i ^= 1; + sprintf(str[i], "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", + ba->b[0], ba->b[1], ba->b[2], + ba->b[3], ba->b[4], ba->b[5]); + return str[i]; +} + +bdaddr_t * strtoba(char *str) +{ + static unsigned char ba[2][sizeof(bdaddr_t)]; + static int i = 1; + register char *ptr = str; + register int x; + + i ^= 1; + for(x=0; x<6; x++){ + ba[i][x] = (uint8_t) strtol(ptr, NULL, 16); + if( x!=5 && !(ptr=strchr(ptr,':')) ) + ptr = ":00:00:00:00:00"; + ptr++; + } + return (bdaddr_t *) ba[i]; +} + +int ba2str(bdaddr_t *ba, char *str) +{ + return sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", + ba->b[0], ba->b[1], ba->b[2], + ba->b[3], ba->b[4], ba->b[5]); +} + +int str2ba(char *str, bdaddr_t *ba) +{ + unsigned char *b = (void *) ba; + char *ptr = str; + register int x; + + for (x=0; x < 6; x++) { + b[x] = (uint8_t) strtol(ptr, NULL, 16); + if (x!=5 && !(ptr=strchr(ptr, ':'))) + ptr = ":00:00:00:00:00"; + ptr++; + } + return 0; +} + +/* Bluetooth error codes to Unix errno mapping */ +int bterr(uint16_t code) +{ + switch(code) { + case 0: + return 0; + case 0x01: + return EBADRQC; + case 0x02: + return ENOTCONN; + case 0x03: + return EIO; + case 0x04: + return EHOSTDOWN; + case 0x05: + return EACCES; + case 0x06: + return EINVAL; + case 0x07: + return ENOMEM; + case 0x08: + return ETIMEDOUT; + case 0x09: + return EMLINK; + case 0x0a: + return EMLINK; + case 0x0b: + return EALREADY; + case 0x0c: + return EBUSY; + case 0x0d: + case 0x0e: + case 0x0f: + return ECONNREFUSED; + case 0x10: + return ETIMEDOUT; + case 0x11: + case 0x27: + case 0x29: + case 0x20: + return EOPNOTSUPP; + case 0x12: + return EINVAL; + case 0x13: + case 0x14: + case 0x15: + return ECONNRESET; + case 0x16: + return ECONNABORTED; + case 0x17: + return ELOOP; + case 0x18: + return EACCES; + case 0x1a: + return EPROTONOSUPPORT; + case 0x1b: + return ECONNREFUSED; + case 0x19: + case 0x1e: + case 0x23: + case 0x24: + case 0x25: + return EPROTO; + default: + return ENOSYS; + } +} diff --git a/src/hci.c b/src/hci.c new file mode 100644 index 00000000..e9693d3e --- /dev/null +++ b/src/hci.c @@ -0,0 +1,624 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +typedef struct { + char *str; unsigned int val; +} hci_map; + +static char * hci_uint2str(hci_map *m, unsigned int val) +{ + static char str[50]; + char *ptr = str; + + *ptr = 0; + while (m->str) { + if ((unsigned int) m->val & val) + ptr += sprintf(ptr, "%s ", m->str); + m++; + } + return str; +} + +int hci_str2uint(hci_map *map, char *str, unsigned int *val) +{ + char *t, *ptr; + hci_map *m; + int set; + + if (!str) + return 0; + + str = ptr = strdup(str); + *val = set = 0; + + while ((t=strsep(&ptr, ","))) { + for (m=map; m->str; m++) { + if (!strcasecmp(m->str,t)) { + *val |= (unsigned int) m->val; + set = 1; + } + } + } + free(str); + + return set; +} + +char *hci_dtypetostr(int type) +{ + switch (type) { + case HCI_VHCI: + return "VHCI"; + case HCI_USB: + return "USB "; + case HCI_PCCARD: + return "PCCARD"; + case HCI_UART: + return "UART"; + default: + return "UKNW"; + } +} + +/* HCI dev flags mapping */ +hci_map dev_flags_map[] = { + { "UP", HCI_UP }, + { "INIT", HCI_INIT }, + { "RUNNING", HCI_RUNNING }, + { "RAW", HCI_RAW }, + { "PSCAN", HCI_PSCAN }, + { "ISCAN", HCI_ISCAN }, + { "IQUIRY", HCI_INQUIRY }, + { "AUTH", HCI_AUTH }, + { "ENCRYPT", HCI_ENCRYPT }, + { NULL } +}; +char *hci_dflagstostr(uint32_t flags) +{ + static char str[50]; + char *ptr = str; + hci_map *m = dev_flags_map; + + *ptr = 0; + + if (!hci_test_bit(HCI_UP, &flags)) + ptr += sprintf(ptr, "DOWN "); + + while (m->str) { + if (hci_test_bit(m->val, &flags)) + ptr += sprintf(ptr, "%s ", m->str); + m++; + } + return str; +} + +/* HCI packet type mapping */ +hci_map pkt_type_map[] = { + { "DM1", HCI_DM1 }, + { "DM3", HCI_DM3 }, + { "DM5", HCI_DM5 }, + { "DH1", HCI_DH1 }, + { "DH3", HCI_DH3 }, + { "DH5", HCI_DH5 }, + { "HV1", HCI_HV1 }, + { "HV2", HCI_HV2 }, + { "HV3", HCI_HV3 }, + { NULL } +}; +char *hci_ptypetostr(unsigned int ptype) +{ + return hci_uint2str(pkt_type_map, ptype); +} +int hci_strtoptype(char *str, unsigned int *val) +{ + return hci_str2uint(pkt_type_map, str, val); +} + +/* Link policy mapping */ +hci_map link_policy_map[] = { + { "NONE", 0 }, + { "RSWITCH", HCI_LP_RSWITCH }, + { "HOLD", HCI_LP_HOLD }, + { "SNIFF", HCI_LP_SNIFF }, + { "PARK", HCI_LP_PARK }, + { NULL } +}; +char *hci_lptostr(unsigned int lp) +{ + return hci_uint2str(link_policy_map, lp); +} +int hci_strtolp(char *str, unsigned int *val) +{ + return hci_str2uint(link_policy_map, str, val); +} + +/* Link mode mapping */ +hci_map link_mode_map[] = { + { "NONE", 0 }, + { "ACCEPT", HCI_LM_ACCEPT }, + { "MASTER", HCI_LM_MASTER }, + { "AUTH", HCI_LM_AUTH }, + { "ENCRYPT", HCI_LM_ENCRYPT}, + { "TRUSTED", HCI_LM_TRUSTED}, + { NULL } +}; +char *hci_lmtostr(unsigned int lm) +{ + static char str[50]; + + str[0] = 0; + if (!(lm & HCI_LM_MASTER)) + strcpy(str, "SLAVE "); + + strcat(str, hci_uint2str(link_mode_map, lm)); + return str; +} +int hci_strtolm(char *str, unsigned int *val) +{ + return hci_str2uint(link_mode_map, str, val); +} + +/* HCI functions that do not require open device */ + +int hci_devinfo(int dev_id, struct hci_dev_info *di) +{ + int s, err; + + s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (s < 0) + return s; + + di->dev_id = dev_id; + err = ioctl(s, HCIGETDEVINFO, (void *) di); + close(s); + + return err; +} + +inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags) +{ + struct hci_inquiry_req *ir; + char *buf, *ptr; + int s, err, size; + + if (!*num_rsp) + *num_rsp = 200; // enough ? + + size = sizeof(*ir) + (sizeof(inquiry_info) * (*num_rsp)); + if (!(buf = malloc(size))) + return NULL; + + ir = (void *)buf; + ir->dev_id = dev_id; + ir->num_rsp = *num_rsp; + ir->length = len; + ir->flags = flags; + + if (lap) { + memcpy(ir->lap, lap, 3); + } else { + ir->lap[0] = 0x33; + ir->lap[1] = 0x8b; + ir->lap[2] = 0x9e; + } + + if ((s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI)) < 0) + goto failed; + if (ioctl(s, HCIINQUIRY, (unsigned long)buf) < 0) + goto failed; + + size = sizeof(inquiry_info) * ir->num_rsp; + if (!(ptr = malloc(size))) + goto failed; + + memcpy(ptr, buf + sizeof(*ir), size); + *num_rsp = ir->num_rsp; + + free(buf); + close(s); + return (void *) ptr; + +failed: + err = errno; + free(buf); + close(s); + errno = err; + return NULL; +} + +/* Open HCI device. + * Returns device descriptor (dd). */ +int hci_open_dev(int dev_id) +{ + struct sockaddr_hci a; + int dd, err; + + /* Create HCI socket */ + dd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (dd < 0) + return dd; + + /* Bind socket to the HCI device */ + a.hci_family = AF_BLUETOOTH; + a.hci_dev = dev_id; + if (bind(dd, (struct sockaddr *)&a, sizeof(a)) < 0) + goto failed; + + return dd; + +failed: + err = errno; + close(dd); + errno = err; + return -1; +} + +int hci_close_dev(int dd) +{ + return close(dd); +} + +/* HCI functions that require open device + * dd - Device descriptor returned by hci_dev_open. */ + +int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param) +{ + uint8_t type = HCI_COMMAND_PKT; + hci_command_hdr hc; + struct iovec iv[3]; + int ivn; + + hc.opcode = htobs(cmd_opcode_pack(ogf, ocf)); + hc.plen= plen; + + iv[0].iov_base = &type; + iv[0].iov_len = 1; + iv[1].iov_base = &hc; + iv[1].iov_len = HCI_COMMAND_HDR_SIZE; + ivn = 2; + + if (plen) { + iv[2].iov_base = param; + iv[2].iov_len = plen; + ivn = 3; + } + + while (writev(dd, iv, ivn) < 0) { + if (errno == EAGAIN || errno == EINTR) + continue; + return -1; + } + return 0; +} + +int hci_send_req(int dd, struct hci_request *r, int to) +{ + unsigned char buf[HCI_MAX_EVENT_SIZE], *ptr; + uint16_t opcode = htobs(cmd_opcode_pack(r->ogf, r->ocf)); + struct hci_filter nf, of; + hci_event_hdr *hdr; + int err, len, try; + + len = sizeof(of); + if (getsockopt(dd, SOL_HCI, HCI_FILTER, &of, &len) < 0) + return -1; + + hci_filter_clear(&nf); + hci_filter_set_ptype(HCI_EVENT_PKT, &nf); + hci_filter_set_event(EVT_CMD_STATUS, &nf); + hci_filter_set_event(EVT_CMD_COMPLETE, &nf); + hci_filter_set_event(r->event, &nf); + hci_filter_set_opcode(opcode, &nf); + if (setsockopt(dd, SOL_HCI, HCI_FILTER, &nf, sizeof(nf)) < 0) + return -1; + + if (hci_send_cmd(dd, r->ogf, r->ocf, r->clen, r->cparam) < 0) + goto failed; + + try = 10; + while (try--) { + evt_cmd_complete *cc; + evt_cmd_status *cs; + + if (to) { + struct pollfd p; + int n; + + p.fd = dd; p.events = POLLIN; + while ((n = poll(&p, 1, to)) < 0) { + if (errno == EAGAIN || errno == EINTR) + continue; + goto failed; + } + + if (!n) { + errno = ETIMEDOUT; + goto failed; + } + + to -= 10; + if (to < 0) to = 0; + + } + + while ((len = read(dd, buf, sizeof(buf))) < 0) { + if (errno == EAGAIN || errno == EINTR) + continue; + goto failed; + } + + hdr = (void *)(buf + 1); + ptr = buf + (1 + HCI_EVENT_HDR_SIZE); + len -= (1 + HCI_EVENT_HDR_SIZE); + + switch (hdr->evt) { + case EVT_CMD_STATUS: + cs = (void *)ptr; + + if (cs->opcode != opcode) + continue; + + if (cs->status) { + errno = EIO; + goto failed; + } + break; + + case EVT_CMD_COMPLETE: + cc = (void *)ptr; + + if (cc->opcode != opcode) + continue; + + ptr += EVT_CMD_COMPLETE_SIZE; + len -= EVT_CMD_COMPLETE_SIZE; + + r->rlen = MIN(len, r->rlen); + memcpy(r->rparam, ptr, r->rlen); + goto done; + + default: + if (hdr->evt != r->event) + break; + + r->rlen = MIN(len, r->rlen); + memcpy(r->rparam, ptr, r->rlen); + goto done; + } + } + errno = ETIMEDOUT; + +failed: + err = errno; + setsockopt(dd, SOL_HCI, HCI_FILTER, &of, sizeof(of)); + errno = err; + return -1; + +done: + setsockopt(dd, SOL_HCI, HCI_FILTER, &of, sizeof(of)); + return 0; +} + +int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to) +{ + evt_conn_complete rp; + create_conn_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.bdaddr, ba); + cp.pkt_type = ptype; + cp.role_switch = rswitch; + + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_CREATE_CONN; + rq.event = EVT_CONN_COMPLETE; + rq.cparam = &cp; + rq.clen = CREATE_CONN_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_CONN_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return rp.handle; +} + +int hci_disconnect(int dd, int hndl, int res, int to) +{ + evt_disconn_complete rp; + disconnect_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = hndl; + cp.reason = res; + + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_DISCONNECT; + rq.event = EVT_DISCONN_COMPLETE; + rq.cparam = &cp; + rq.clen = DISCONNECT_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_DISCONN_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + return 0; +} + +int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) +{ + evt_remote_name_req_complete rn; + remote_name_req_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.bdaddr, ba); + + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_REMOTE_NAME_REQ; + rq.cparam = &cp; + rq.clen = REMOTE_NAME_REQ_CP_SIZE; + rq.event = EVT_REMOTE_NAME_REQ_COMPLETE; + rq.rparam = &rn; + rq.rlen = EVT_REMOTE_NAME_REQ_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rn.status) { + errno = EIO; + return -1; + } + + rn.name[247] = '\0'; + strncpy(name, rn.name, len); + return 0; +} + +int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to) +{ + evt_read_remote_features_complete rp; + read_remote_features_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = hndl; + + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_READ_REMOTE_FEATURES; + rq.event = EVT_READ_REMOTE_FEATURES_COMPLETE; + rq.cparam = &cp; + rq.clen = READ_REMOTE_FEATURES_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + memcpy(features, rp.features, 8); + return 0; +} + +int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to) +{ + evt_read_remote_version_complete rp; + read_remote_version_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = hndl; + + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_READ_REMOTE_VERSION; + rq.event = EVT_READ_REMOTE_VERSION_COMPLETE; + rq.cparam = &cp; + rq.clen = READ_REMOTE_VERSION_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_READ_REMOTE_VERSION_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + ver->manufacturer = btohs(rp.manufacturer); + ver->lmp_ver = rp.lmp_ver; + ver->lmp_subver = btohs(rp.lmp_subver); + return 0; +} + +int hci_read_local_version(int dd, struct hci_version *ver, int to) +{ + read_local_version_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_INFO_PARAM; + rq.ocf = OCF_READ_LOCAL_VERSION; + rq.cparam = NULL; + rq.clen = 0; + rq.rparam = &rp; + rq.rlen = READ_LOCAL_VERSION_RP_SIZE; + + if (hci_send_req(dd, &rq, 1000) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + ver->manufacturer = btohs(rp.manufacturer); + ver->hci_ver = rp.lmp_ver; + ver->hci_rev = btohs(rp.hci_rev); + ver->lmp_ver = rp.lmp_ver; + ver->lmp_subver = btohs(rp.lmp_subver); + + return 0; +} -- cgit From f01eb8698b6cf461be0ad7a22c29d34cf1262e54 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 8 Mar 2002 21:22:43 +0000 Subject: Update --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index a5569bdb..056eafe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ ver 2.0-pre7: Bluetooth libraries and header files is now a separate package. + New build environment uses automake and libtool. + Massive header files cleanup. ver 2.0-pre6: API cleanup and additions. -- cgit From 2c4532ba9feb08d1e37ca785bde83330d9cb4b71 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 12 Mar 2002 18:58:39 +0000 Subject: Missing includes. Cleanup. --- include/bluetooth.h | 1 + include/hci.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index 441e1d3a..5dd4085f 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -35,6 +35,7 @@ extern "C" { #include #include +#include #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 diff --git a/include/hci.h b/include/hci.h index 3f98ab1d..38060fb8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -33,7 +33,7 @@ extern "C" { #endif -#define HCI_MAX_DEV 4 +#define HCI_MAX_DEV 16 #define HCI_MAX_ACL_SIZE 1024 #define HCI_MAX_SCO_SIZE 255 -- cgit From aced690cd4c623607a5ac1ebc0bb12b8b213fac8 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 12 Mar 2002 18:59:15 +0000 Subject: Cleanup. --- Makefile.am | 2 ++ Makefile.in | 3 +++ conftest | Bin 6518 -> 0 bytes conftest.c | 1 - 4 files changed, 5 insertions(+), 1 deletion(-) delete mode 100755 conftest delete mode 100644 conftest.c diff --git a/Makefile.am b/Makefile.am index 64e1a183..c744d8fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,3 +3,5 @@ # SUBDIRS = include src + +DISTCLEANFILES = conftest.c conftest diff --git a/Makefile.in b/Makefile.in index e541f40d..854507ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,6 +81,8 @@ STRIP = @STRIP@ VERSION = @VERSION@ SUBDIRS = include src + +DISTCLEANFILES = conftest.c conftest ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = @@ -296,6 +298,7 @@ clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: mostlyclean-am: mostlyclean-tags mostlyclean-generic diff --git a/conftest b/conftest deleted file mode 100755 index 0a5bb3d5..00000000 Binary files a/conftest and /dev/null differ diff --git a/conftest.c b/conftest.c deleted file mode 100644 index cb8c7a57..00000000 --- a/conftest.c +++ /dev/null @@ -1 +0,0 @@ -static int dummy; -- cgit From 9ff2c721bb4ff84ad15e4593404bf47941315337 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 19 Mar 2002 17:35:54 +0000 Subject: Added hci_local_name function. --- include/hci_lib.h | 1 + src/hci.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 0776e1ba..5a5d2ae7 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -62,6 +62,7 @@ int hci_disconnect(int dd, int hndl, int res, int to); inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); +int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to); int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to); diff --git a/src/hci.c b/src/hci.c index e9693d3e..1e20243b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -503,6 +503,29 @@ int hci_disconnect(int dd, int hndl, int res, int to) return 0; } +int hci_local_name(int dd, int len, char *name, int to) +{ + read_local_name_rp rp; + struct hci_request rq; + + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_LOCAL_NAME; + rq.rparam = &rp; + rq.rlen = READ_LOCAL_NAME_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + rp.name[247] = '\0'; + strncpy(name, rp.name, len); + return 0; +} + int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) { evt_remote_name_req_complete rn; -- cgit From 54e7db35ec328da8e131a70d757904f2bbaa2083 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 19 Mar 2002 18:07:03 +0000 Subject: Inquiry activity defines. --- include/hci.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/hci.h b/include/hci.h index 38060fb8..5fcc8c1e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -206,6 +206,22 @@ typedef struct { /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 #define OCF_RESET 0x0003 + +#define OCF_READ_INQ_ACTIVITY 0x001D +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_inq_activity_rp; +#define READ_INQ_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_INQ_ACTIVITY 0x001E +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_inq_activity_cp; +#define WRITE_INQ_ACTIVITY_CP_SIZE 4 + #define OCF_READ_AUTH_ENABLE 0x001F #define OCF_WRITE_AUTH_ENABLE 0x0020 #define AUTH_DISABLED 0x00 -- cgit From be6ddaecae3cb232e79c2f7bbcc2c9277ec4494b Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 19 Mar 2002 18:19:12 +0000 Subject: HCI filter additions. --- include/hci_lib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 5a5d2ae7..28a32993 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -96,6 +96,10 @@ static inline void hci_filter_set_ptype(int t, struct hci_filter *f) { hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); } +static inline void hci_filter_all_ptypes(struct hci_filter *f) +{ + memset((void *)&f->type_mask, 0xff, sizeof(f->type_mask)); +} static inline void hci_filter_set_event(int e, struct hci_filter *f) { hci_set_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); -- cgit From e5049f81cd29f935a2465c430f5db8f15765d46d Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 20 Mar 2002 17:59:04 +0000 Subject: Typo correction. --- include/hci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hci.h b/include/hci.h index 5fcc8c1e..a9b23ffd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -342,7 +342,7 @@ typedef struct { #define OCF_INQUIRY 0x0001 typedef struct { uint8_t lap[3]; - uint8_t lenght; + uint8_t length; uint8_t num_rsp; } __attribute__ ((packed)) inquiry_cp; #define INQUIRY_CP_SIZE 5 @@ -555,7 +555,7 @@ typedef struct { #define EVT_NUM_COMP_PKTS 0x13 typedef struct { uint8_t num_hndl; - /* variable lenght part */ + /* variable length part */ } __attribute__ ((packed)) evt_num_comp_pkts; #define EVT_NUM_COMP_PKTS_SIZE 1 -- cgit From a51747b602f9cd03c7431788f80431c1710f5827 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 21 Mar 2002 23:20:32 +0000 Subject: Additional strtoXX and XXtostr functions. --- include/bluetooth.h | 3 +- include/hci_lib.h | 5 ++ src/bluetooth.c | 216 +++++++++++++++++++++++++++++++++++++--------------- src/hci.c | 82 ++++++++++++++++++-- 4 files changed, 234 insertions(+), 72 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index 5dd4085f..ee345616 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -103,7 +103,8 @@ char *batostr(bdaddr_t *ba); int ba2str(bdaddr_t *ba, char *str); int str2ba(char *str, bdaddr_t *ba); -int bterr(uint16_t code); +int bt_error(uint16_t code); +char *bt_compidtostr(int id); #ifdef __cplusplus } diff --git a/include/hci_lib.h b/include/hci_lib.h index 28a32993..c590150d 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -77,6 +77,11 @@ int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); int hci_strtolm(char *str, unsigned int *val); +char *hci_vertostr(unsigned int ver); +int hci_strtover(char *str, unsigned int *ver); +char *lmp_vertostr(unsigned int ver); +int lmp_strtover(char *str, unsigned int *ver); + static inline void hci_set_bit(int nr, void *addr) { *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); diff --git a/src/bluetooth.c b/src/bluetooth.c index 6dfccf44..b202f280 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -96,69 +96,159 @@ int str2ba(char *str, bdaddr_t *ba) } /* Bluetooth error codes to Unix errno mapping */ -int bterr(uint16_t code) +int bt_error(uint16_t code) { - switch(code) { - case 0: - return 0; - case 0x01: - return EBADRQC; - case 0x02: - return ENOTCONN; - case 0x03: - return EIO; - case 0x04: - return EHOSTDOWN; - case 0x05: - return EACCES; - case 0x06: - return EINVAL; - case 0x07: - return ENOMEM; - case 0x08: - return ETIMEDOUT; - case 0x09: - return EMLINK; - case 0x0a: - return EMLINK; - case 0x0b: - return EALREADY; - case 0x0c: - return EBUSY; - case 0x0d: - case 0x0e: - case 0x0f: - return ECONNREFUSED; - case 0x10: - return ETIMEDOUT; - case 0x11: - case 0x27: - case 0x29: - case 0x20: - return EOPNOTSUPP; - case 0x12: - return EINVAL; - case 0x13: - case 0x14: - case 0x15: - return ECONNRESET; - case 0x16: - return ECONNABORTED; - case 0x17: - return ELOOP; - case 0x18: - return EACCES; - case 0x1a: - return EPROTONOSUPPORT; - case 0x1b: - return ECONNREFUSED; - case 0x19: - case 0x1e: - case 0x23: - case 0x24: - case 0x25: - return EPROTO; - default: - return ENOSYS; + switch (code) { + case 0: + return 0; + case 0x01: + return EBADRQC; + case 0x02: + return ENOTCONN; + case 0x03: + return EIO; + case 0x04: + return EHOSTDOWN; + case 0x05: + return EACCES; + case 0x06: + return EINVAL; + case 0x07: + return ENOMEM; + case 0x08: + return ETIMEDOUT; + case 0x09: + return EMLINK; + case 0x0a: + return EMLINK; + case 0x0b: + return EALREADY; + case 0x0c: + return EBUSY; + case 0x0d: + case 0x0e: + case 0x0f: + return ECONNREFUSED; + case 0x10: + return ETIMEDOUT; + case 0x11: + case 0x27: + case 0x29: + case 0x20: + return EOPNOTSUPP; + case 0x12: + return EINVAL; + case 0x13: + case 0x14: + case 0x15: + return ECONNRESET; + case 0x16: + return ECONNABORTED; + case 0x17: + return ELOOP; + case 0x18: + return EACCES; + case 0x1a: + return EPROTONOSUPPORT; + case 0x1b: + return ECONNREFUSED; + case 0x19: + case 0x1e: + case 0x23: + case 0x24: + case 0x25: + return EPROTO; + default: + return ENOSYS; + } +} + +char *bt_compidtostr(int compid) +{ + switch (compid) { + case 0: + return "Ericsson Mobile Comunications"; + case 1: + return "Nokia Mobile Phones"; + case 2: + return "Intel Corp."; + case 3: + return "IBM Corp."; + case 4: + return "Toshiba Corp."; + case 5: + return "3Com"; + case 6: + return "Microsoft"; + case 7: + return "Lucent"; + case 8: + return "Motorola"; + case 9: + return "Infineon Technologies AG"; + case 10: + return "Cambridge Silicon Radio"; + case 11: + return "Silicon Wave"; + case 12: + return "Digianswer A/S"; + case 13: + return "Texas Instruments Inc."; + case 14: + return "Parthus Technologies Inc."; + case 15: + return "Broadcom Corporation"; + case 16: + return "Mitel Semiconductor"; + case 17: + return "Widcomm, Inc."; + case 18: + return "Telencomm Inc."; + case 19: + return "Atmel Corporation"; + case 20: + return "Mitsubishi Electric Corporation"; + case 21: + return "RTX Telecom A/S"; + case 22: + return "KC Technology Inc."; + case 23: + return "Newlogic"; + case 24: + return "Transilica, Inc."; + case 25: + return "Rohde & Schwartz GmbH & Co. KG"; + case 26: + return "TTPCom Limited"; + case 27: + return "Signia Technologies, Inc."; + case 28: + return "Conexant Systems Inc."; + case 29: + return "Qualcomm"; + case 30: + return "Inventel"; + case 31: + return "AVM Berlin"; + case 32: + return "BandSpeed, Inc."; + case 33: + return "Mansella Ltd"; + case 34: + return "NEC Corporation"; + case 35: + return "WavePlus Technology Co., Ltd."; + case 36: + return "Alcatel"; + case 37: + return "Philips Semiconductors"; + case 38: + return "C Technologies"; + case 39: + return "Open Interface"; + case 65535: + return "internal use"; + default: + return "not assigned"; } } diff --git a/src/hci.c b/src/hci.c index 1e20243b..cd65a296 100644 --- a/src/hci.c +++ b/src/hci.c @@ -51,7 +51,7 @@ typedef struct { char *str; unsigned int val; } hci_map; -static char * hci_uint2str(hci_map *m, unsigned int val) +static char *hci_bit2str(hci_map *m, unsigned int val) { static char str[50]; char *ptr = str; @@ -65,7 +65,7 @@ static char * hci_uint2str(hci_map *m, unsigned int val) return str; } -int hci_str2uint(hci_map *map, char *str, unsigned int *val) +static int hci_str2bit(hci_map *map, char *str, unsigned int *val) { char *t, *ptr; hci_map *m; @@ -90,6 +90,46 @@ int hci_str2uint(hci_map *map, char *str, unsigned int *val) return set; } +static char *hci_uint2str(hci_map *m, unsigned int val) +{ + static char str[50]; + char *ptr = str; + + *ptr = 0; + while (m->str) { + if ((unsigned int) m->val == val) { + ptr += sprintf(ptr, "%s", m->str); + break; + } + m++; + } + return str; +} + +static int hci_str2uint(hci_map *map, char *str, unsigned int *val) +{ + char *t, *ptr; + hci_map *m; + int set = 0; + + if (!str) + return 0; + + str = ptr = strdup(str); + + while ((t=strsep(&ptr, ","))) { + for (m=map; m->str; m++) { + if (!strcasecmp(m->str,t)) { + *val = (unsigned int) m->val; set = 1; + break; + } + } + } + free(str); + + return set; +} + char *hci_dtypetostr(int type) { switch (type) { @@ -153,11 +193,11 @@ hci_map pkt_type_map[] = { }; char *hci_ptypetostr(unsigned int ptype) { - return hci_uint2str(pkt_type_map, ptype); + return hci_bit2str(pkt_type_map, ptype); } int hci_strtoptype(char *str, unsigned int *val) { - return hci_str2uint(pkt_type_map, str, val); + return hci_str2bit(pkt_type_map, str, val); } /* Link policy mapping */ @@ -171,11 +211,11 @@ hci_map link_policy_map[] = { }; char *hci_lptostr(unsigned int lp) { - return hci_uint2str(link_policy_map, lp); + return hci_bit2str(link_policy_map, lp); } int hci_strtolp(char *str, unsigned int *val) { - return hci_str2uint(link_policy_map, str, val); + return hci_str2bit(link_policy_map, str, val); } /* Link mode mapping */ @@ -196,12 +236,38 @@ char *hci_lmtostr(unsigned int lm) if (!(lm & HCI_LM_MASTER)) strcpy(str, "SLAVE "); - strcat(str, hci_uint2str(link_mode_map, lm)); + strcat(str, hci_bit2str(link_mode_map, lm)); return str; } int hci_strtolm(char *str, unsigned int *val) { - return hci_str2uint(link_mode_map, str, val); + return hci_str2bit(link_mode_map, str, val); +} + +/* Version mapping */ +hci_map ver_map[] = { + { "1.0b", 0x00 }, + { "1.1", 0x01 }, + { NULL } +}; +char *hci_vertostr(unsigned int ver) +{ + char *str = hci_uint2str(ver_map, ver); + return *str ? str : "n/a"; +} +int hci_strtover(char *str, unsigned int *ver) +{ + return hci_str2uint(ver_map, str, ver); +} + +char *lmp_vertostr(unsigned int ver) +{ + char *str = hci_uint2str(ver_map, ver); + return *str ? str : "n/a"; +} +int lmp_strtover(char *str, unsigned int *ver) +{ + return hci_str2uint(ver_map, str, ver); } /* HCI functions that do not require open device */ -- cgit From 0a6472fe170438016c23c71d9129e627f26cd398 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 22 Mar 2002 19:45:46 +0000 Subject: Fixed compiler options and warnings. Proper parameter types. Cleanup. --- configure | 208 +++++++++++++++++++++++++++--------------------------- configure.in | 2 + include/hci_lib.h | 8 +-- src/Makefile.am | 2 +- src/Makefile.in | 3 +- src/hci.c | 24 ++++--- 6 files changed, 127 insertions(+), 120 deletions(-) diff --git a/configure b/configure index 1306bc69..d15a5324 100755 --- a/configure +++ b/configure @@ -950,10 +950,12 @@ fi +CFLAGS="-Wall -g -O2" + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:957: checking for $ac_word" >&5 +echo "configure:959: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -983,7 +985,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:987: checking for $ac_word" >&5 +echo "configure:989: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1034,7 +1036,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1038: checking for $ac_word" >&5 +echo "configure:1040: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1066,7 +1068,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1070: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1072: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1077,12 +1079,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1081 "configure" +#line 1083 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1108,12 +1110,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1112: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1114: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1117: checking whether we are using GNU C" >&5 +echo "configure:1119: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1122,7 +1124,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1141,7 +1143,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1145: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1147: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1175,7 +1177,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1179: checking for $ac_word" >&5 +echo "configure:1181: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1214,7 +1216,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1218: checking for a BSD compatible install" >&5 +echo "configure:1220: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1267,12 +1269,12 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1271: checking for Cygwin environment" >&5 +echo "configure:1273: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1300,19 +1302,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1304: checking for mingw32 environment" >&5 +echo "configure:1306: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1329,7 +1331,7 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1333: checking how to run the C preprocessor" >&5 +echo "configure:1335: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1344,13 +1346,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1361,13 +1363,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1378,13 +1380,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1484,7 +1486,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1488: checking host system type" >&5 +echo "configure:1490: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1505,7 +1507,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1509: checking build system type" >&5 +echo "configure:1511: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1534,7 +1536,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1538: checking for ld used by GCC" >&5 +echo "configure:1540: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1564,10 +1566,10 @@ echo "configure:1538: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1568: checking for GNU ld" >&5 +echo "configure:1570: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1571: checking for non-GNU ld" >&5 +echo "configure:1573: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1602,7 +1604,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1606: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1608: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1619,7 +1621,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1623: checking for $LD option to reload object files" >&5 +echo "configure:1625: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1631,7 +1633,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1635: checking for BSD-compatible nm" >&5 +echo "configure:1637: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1669,7 +1671,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1673: checking whether ln -s works" >&5 +echo "configure:1675: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1690,7 +1692,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1694: checking how to recognise dependant libraries" >&5 +echo "configure:1696: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1863,13 +1865,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1867: checking for object suffix" >&5 +echo "configure:1869: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1889,7 +1891,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1893: checking for executable suffix" >&5 +echo "configure:1895: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1899,7 +1901,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1930,7 +1932,7 @@ fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 -echo "configure:1934: checking command to parse $NM output" >&5 +echo "configure:1936: checking command to parse $NM output" >&5 if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2006,10 +2008,10 @@ void nm_test_func(){} int main(){nm_test_var='a';nm_test_func();return(0);} EOF - if { (eval echo configure:2010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. nlist=conftest.nm - if { (eval echo configure:2013: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then + if { (eval echo configure:2015: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -2060,7 +2062,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo configure:2064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" @@ -2106,17 +2108,17 @@ for ac_hdr in dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2110: checking for $ac_hdr" >&5 +echo "configure:2112: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2151,7 +2153,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2155: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2157: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2213,7 +2215,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2217: checking for file" >&5 +echo "configure:2219: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2284,7 +2286,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2288: checking for $ac_word" >&5 +echo "configure:2290: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2316,7 +2318,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2320: checking for $ac_word" >&5 +echo "configure:2322: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2351,7 +2353,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2355: checking for $ac_word" >&5 +echo "configure:2357: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2383,7 +2385,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2387: checking for $ac_word" >&5 +echo "configure:2389: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2432,8 +2434,8 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2436 "configure"' > conftest.$ac_ext - if { (eval echo configure:2437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2438 "configure"' > conftest.$ac_ext + if { (eval echo configure:2439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2454,7 +2456,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2458: checking whether the C compiler needs -belf" >&5 +echo "configure:2460: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2467,14 +2469,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2587,7 +2589,7 @@ set dummy $CC compiler="$2" echo $ac_n "checking for objdir""... $ac_c" 1>&6 -echo "configure:2591: checking for objdir" >&5 +echo "configure:2593: checking for objdir" >&5 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -2614,7 +2616,7 @@ test -z "$pic_mode" && pic_mode=default # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:2618: checking for $compiler option to produce PIC" >&5 +echo "configure:2620: checking for $compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2766,21 +2768,21 @@ else # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 -echo "configure:2770: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 +echo "configure:2772: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* case $host_os in hpux9* | hpux10* | hpux11*) @@ -2832,7 +2834,7 @@ if test -n "$lt_cv_prog_cc_shlib"; then fi echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 -echo "configure:2836: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 +echo "configure:2838: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2840,14 +2842,14 @@ else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_prog_cc_static_works=yes else @@ -2874,7 +2876,7 @@ can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 -echo "configure:2878: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo "configure:2880: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2893,7 +2895,7 @@ chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:2897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:2899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -2922,7 +2924,7 @@ echo "$ac_t""$compiler_c_o" 1>&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6 -echo "configure:2926: checking if $compiler supports -c -o file.lo" >&5 +echo "configure:2928: checking if $compiler supports -c -o file.lo" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2931,14 +2933,14 @@ else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -2968,7 +2970,7 @@ hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 -echo "configure:2972: checking if we can lock with hard links" >&5 +echo "configure:2974: checking if we can lock with hard links" >&5 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no @@ -2987,20 +2989,20 @@ fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 -echo "configure:2991: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo "configure:2993: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -3027,7 +3029,7 @@ fi # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:3031: checking whether the linker ($LD) supports shared libraries" >&5 +echo "configure:3033: checking whether the linker ($LD) supports shared libraries" >&5 allow_undefined_flag= no_undefined_flag= @@ -3643,7 +3645,7 @@ test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 -echo "configure:3647: checking how to hardcode library paths into programs" >&5 +echo "configure:3649: checking how to hardcode library paths into programs" >&5 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then @@ -3671,7 +3673,7 @@ echo "$ac_t""$hardcode_action" 1>&6 striplib= old_striplib= echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 -echo "configure:3675: checking whether stripping libraries is possible" >&5 +echo "configure:3677: checking whether stripping libraries is possible" >&5 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" @@ -3685,7 +3687,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 -echo "configure:3689: checking dynamic linker characteristics" >&5 +echo "configure:3691: checking dynamic linker characteristics" >&5 library_names_spec= libname_spec='lib$name' soname_spec= @@ -4071,7 +4073,7 @@ test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 -echo "configure:4075: checking if libtool supports shared libraries" >&5 +echo "configure:4077: checking if libtool supports shared libraries" >&5 echo "$ac_t""$can_build_shared" 1>&6 if test "$hardcode_action" = relink; then @@ -4110,7 +4112,7 @@ else *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4114: checking for dlopen in -ldl" >&5 +echo "configure:4116: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4118,7 +4120,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4148,12 +4150,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4152: checking for dlopen" >&5 +echo "configure:4154: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4194,12 +4196,12 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "configure:4198: checking for shl_load" >&5 +echo "configure:4200: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -4240,7 +4242,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "configure:4244: checking for dlopen in -lsvld" >&5 +echo "configure:4246: checking for dlopen in -lsvld" >&5 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4248,7 +4250,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsvld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4278,7 +4280,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:4282: checking for shl_load in -ldld" >&5 +echo "configure:4284: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4286,7 +4288,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4350,7 +4352,7 @@ fi LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4354: checking whether a program can dlopen itself" >&5 +echo "configure:4356: checking whether a program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4360,7 +4362,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4444,7 +4446,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4448: checking whether a statically linked program can dlopen itself" >&5 +echo "configure:4450: checking whether a statically linked program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4454,7 +4456,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4564,14 +4566,14 @@ if test "$enable_shared" = yes && test "$GCC" = yes; then # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 -echo "configure:4568: checking whether -lc should be explicitly linked in" >&5 +echo "configure:4570: checking whether -lc should be explicitly linked in" >&5 if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext - if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext @@ -4584,7 +4586,7 @@ else libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= - if { (eval echo configure:4588: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } + if { (eval echo configure:4590: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then lt_cv_archive_cmds_need_lc=no else diff --git a/configure.in b/configure.in index 442f19ff..ae9aa5a7 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,8 @@ AC_PREFIX_DEFAULT(/usr) AC_SUBST(LD) AC_SUBST(AR) +CFLAGS="-Wall -g -O2" + AC_PROG_CC AC_PROG_RANLIB AC_PROG_INSTALL diff --git a/include/hci_lib.h b/include/hci_lib.h index c590150d..ed3306ab 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -56,16 +56,16 @@ int hci_close_dev(int dd); 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); -int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to); -int hci_disconnect(int dd, int hndl, int res, int to); +int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); +int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to); -int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to); +int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); +int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); char *hci_dtypetostr(int type); diff --git a/src/Makefile.am b/src/Makefile.am index cc7b582b..b1c657e0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,4 +7,4 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c libbluetooth_la_LDFLAGS = -version-info 1:0:0 -CFLAGS += -I../include +AM_CFLAGS = -I../include diff --git a/src/Makefile.in b/src/Makefile.in index 6da2db02..530d0757 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -85,7 +85,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c libbluetooth_la_LDFLAGS = -version-info 1:0:0 -CFLAGS = -I../include +AM_CFLAGS = -I../include mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) @@ -97,6 +97,7 @@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libbluetooth_la_LIBADD = libbluetooth_la_OBJECTS = bluetooth.lo hci.lo +CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) diff --git a/src/hci.c b/src/hci.c index cd65a296..3e1dd52e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -511,7 +511,7 @@ done: return 0; } -int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to) +int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to) { evt_conn_complete rp; create_conn_cp cp; @@ -519,8 +519,9 @@ int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to) memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); - cp.pkt_type = ptype; - cp.role_switch = rswitch; + cp.pkt_type = ptype; + cp.clock_offset = clkoffset; + cp.role_switch = rswitch; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_CREATE_CONN; @@ -538,18 +539,19 @@ int hci_create_connection(int dd, bdaddr_t *ba, int ptype, int rswitch, int to) return -1; } - return rp.handle; + *handle = rp.handle; + return 0; } -int hci_disconnect(int dd, int hndl, int res, int to) +int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) { evt_disconn_complete rp; disconnect_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = hndl; - cp.reason = res; + cp.handle = handle; + cp.reason = reason; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_DISCONNECT; @@ -622,14 +624,14 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) return 0; } -int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to) +int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) { evt_read_remote_features_complete rp; read_remote_features_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = hndl; + cp.handle = handle; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_FEATURES; @@ -651,14 +653,14 @@ int hci_read_remote_features(int dd, int hndl, uint8_t *features, int to) return 0; } -int hci_read_remote_version(int dd, int hndl, struct hci_version *ver, int to) +int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to) { evt_read_remote_version_complete rp; read_remote_version_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = hndl; + cp.handle = handle; rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_VERSION; -- cgit From 87f8b3bc7c1967cef913de6b23bbdebb8f98d19e Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 25 Mar 2002 19:12:16 +0000 Subject: Fix static allocations. --- src/bluetooth.c | 45 +++++++++++++++++++++++---------------------- src/hci.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/src/bluetooth.c b/src/bluetooth.c index b202f280..add25594 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -44,33 +44,34 @@ void baswap(bdaddr_t *dst, bdaddr_t *src) d[i] = s[5-i]; } -char * batostr(bdaddr_t *ba) +char *batostr(bdaddr_t *ba) { - static char str[2][18]; - static int i = 1; + char *str = malloc(18); + if (!str) + return NULL; - i ^= 1; - sprintf(str[i], "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", + sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", ba->b[0], ba->b[1], ba->b[2], ba->b[3], ba->b[4], ba->b[5]); - return str[i]; + return str; } -bdaddr_t * strtoba(char *str) +bdaddr_t *strtoba(char *str) { - static unsigned char ba[2][sizeof(bdaddr_t)]; - static int i = 1; - register char *ptr = str; - register int x; - - i ^= 1; - for(x=0; x<6; x++){ - ba[i][x] = (uint8_t) strtol(ptr, NULL, 16); - if( x!=5 && !(ptr=strchr(ptr,':')) ) + char *ptr = str; + int i; + + uint8_t *ba = malloc(sizeof(bdaddr_t)); + if (!ba) + return NULL; + + for(i=0; i<6; i++){ + ba[i] = (uint8_t) strtol(ptr, NULL, 16); + if( i!=5 && !(ptr=strchr(ptr,':')) ) ptr = ":00:00:00:00:00"; ptr++; } - return (bdaddr_t *) ba[i]; + return (bdaddr_t *) ba; } int ba2str(bdaddr_t *ba, char *str) @@ -82,13 +83,13 @@ int ba2str(bdaddr_t *ba, char *str) int str2ba(char *str, bdaddr_t *ba) { - unsigned char *b = (void *) ba; + uint8_t *b = (void *) ba; char *ptr = str; - register int x; + int i; - for (x=0; x < 6; x++) { - b[x] = (uint8_t) strtol(ptr, NULL, 16); - if (x!=5 && !(ptr=strchr(ptr, ':'))) + for (i=0; i < 6; i++) { + b[i] = (uint8_t) strtol(ptr, NULL, 16); + if (i!=5 && !(ptr=strchr(ptr, ':'))) ptr = ":00:00:00:00:00"; ptr++; } diff --git a/src/hci.c b/src/hci.c index 3e1dd52e..fb7a2780 100644 --- a/src/hci.c +++ b/src/hci.c @@ -53,9 +53,12 @@ typedef struct { static char *hci_bit2str(hci_map *m, unsigned int val) { - static char str[50]; + char *str = malloc(50); char *ptr = str; + if (!str) + return NULL; + *ptr = 0; while (m->str) { if ((unsigned int) m->val & val) @@ -71,10 +74,10 @@ static int hci_str2bit(hci_map *map, char *str, unsigned int *val) hci_map *m; int set; + str = ptr = strdup(str); if (!str) return 0; - str = ptr = strdup(str); *val = set = 0; while ((t=strsep(&ptr, ","))) { @@ -92,9 +95,12 @@ static int hci_str2bit(hci_map *map, char *str, unsigned int *val) static char *hci_uint2str(hci_map *m, unsigned int val) { - static char str[50]; + char *str = malloc(50); char *ptr = str; + if (!str) + return NULL; + *ptr = 0; while (m->str) { if ((unsigned int) m->val == val) { @@ -161,10 +167,13 @@ hci_map dev_flags_map[] = { }; char *hci_dflagstostr(uint32_t flags) { - static char str[50]; + char *str = malloc(50); char *ptr = str; hci_map *m = dev_flags_map; + if (!str) + return NULL; + *ptr = 0; if (!hci_test_bit(HCI_UP, &flags)) @@ -230,13 +239,22 @@ hci_map link_mode_map[] = { }; char *hci_lmtostr(unsigned int lm) { - static char str[50]; + char *s, *str = malloc(50); + if (!str) + return NULL; - str[0] = 0; + *str = 0; if (!(lm & HCI_LM_MASTER)) strcpy(str, "SLAVE "); - strcat(str, hci_bit2str(link_mode_map, lm)); + s = hci_bit2str(link_mode_map, lm); + if (!s) { + free(str); + return NULL; + } + + strcat(str, s); + free(s); return str; } int hci_strtolm(char *str, unsigned int *val) @@ -706,7 +724,7 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) } ver->manufacturer = btohs(rp.manufacturer); - ver->hci_ver = rp.lmp_ver; + ver->hci_ver = rp.hci_ver; ver->hci_rev = btohs(rp.hci_rev); ver->lmp_ver = rp.lmp_ver; ver->lmp_subver = btohs(rp.lmp_subver); -- cgit From 1247cae735e039a593f42ce9867f8cf8e68effee Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 26 Mar 2002 17:59:19 +0000 Subject: New ioctls. Minor cleanups. --- include/hci.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/hci.h b/include/hci.h index a9b23ffd..ef07bc06 100644 --- a/include/hci.h +++ b/include/hci.h @@ -86,6 +86,8 @@ enum { #define HCISETPTYPE _IOW('H', 224, int) #define HCISETLINKPOL _IOW('H', 225, int) #define HCISETLINKMODE _IOW('H', 226, int) +#define HCISETACLMTU _IOW('H', 227, int) +#define HCISETSCOMTU _IOW('H', 228, int) #define HCIINQUIRY _IOR('H', 240, int) @@ -723,11 +725,11 @@ struct hci_dev_info { uint32_t link_mode; uint16_t acl_mtu; - uint16_t acl_max; + uint16_t acl_pkts; uint16_t sco_mtu; - uint16_t sco_max; + uint16_t sco_pkts; - struct hci_dev_stats stat; + struct hci_dev_stats stat; }; struct hci_conn_info { -- cgit From b442a036129e5bfe44eb95ef036bdb13f2eba009 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 26 Mar 2002 19:25:05 +0000 Subject: Check for null string in strtobit. --- src/hci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index fb7a2780..544607b9 100644 --- a/src/hci.c +++ b/src/hci.c @@ -74,8 +74,7 @@ static int hci_str2bit(hci_map *map, char *str, unsigned int *val) hci_map *m; int set; - str = ptr = strdup(str); - if (!str) + if (!str || !(str = ptr = strdup(str))) return 0; *val = set = 0; -- cgit From ab9d7d4249cfc7708ed39795413bd28cc97c930e Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 28 Mar 2002 18:09:32 +0000 Subject: Update --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 7cd84ba8..d9b488f5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,5 +2,5 @@ Maxim Krasnyansky Original author. Primary maintainer. -Marcel Holtmann +Marcel Holtmann Various patches, fixes and other contributions. -- cgit From 59fa39d1686237493fce068472e195a709134a39 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 28 Mar 2002 20:48:45 +0000 Subject: Fix compiler warnings. --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index ee345616..8d1c7c51 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -36,6 +36,7 @@ extern "C" { #include #include #include +#include #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 -- cgit From 21efc9d87640fa0d9b78a311677e316590515171 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 28 Mar 2002 23:11:53 +0000 Subject: Swap address in str2ba and ba2str. --- src/bluetooth.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bluetooth.c b/src/bluetooth.c index add25594..97a1cf57 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -76,14 +76,16 @@ bdaddr_t *strtoba(char *str) int ba2str(bdaddr_t *ba, char *str) { + uint8_t b[6]; + + baswap((bdaddr_t *)b, ba); return sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", - ba->b[0], ba->b[1], ba->b[2], - ba->b[3], ba->b[4], ba->b[5]); + b[0], b[1], b[2], b[3], b[4], b[5]); } int str2ba(char *str, bdaddr_t *ba) { - uint8_t *b = (void *) ba; + uint8_t b[6]; char *ptr = str; int i; @@ -93,6 +95,7 @@ int str2ba(char *str, bdaddr_t *ba) ptr = ":00:00:00:00:00"; ptr++; } + baswap(ba, (bdaddr_t *)b); return 0; } -- cgit From a8d4b5143b9fc3ee47a5f59180d8a92c5f742115 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 29 Mar 2002 21:34:01 +0000 Subject: Cleanup. --- src/Makefile.am | 2 +- src/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b1c657e0..22dd8aac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,4 +7,4 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c libbluetooth_la_LDFLAGS = -version-info 1:0:0 -AM_CFLAGS = -I../include +INCLUDES = -I../include diff --git a/src/Makefile.in b/src/Makefile.in index 530d0757..0335d393 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -85,7 +85,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c libbluetooth_la_LDFLAGS = -version-info 1:0:0 -AM_CFLAGS = -I../include +INCLUDES = -I../include mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) -- cgit From dac18f34e1080e84d779496232a838c5bc570ddd Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 31 Mar 2002 05:14:51 +0000 Subject: Added BDADDR_LOCAL --- include/bluetooth.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index 8d1c7c51..8026832b 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -86,7 +86,8 @@ typedef struct { uint8_t b[6]; } __attribute__((packed)) bdaddr_t; -#define BDADDR_ANY ((bdaddr_t *)"\000\000\000\000\000") +#define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) +#define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) /* Copy, swap, convert BD Address */ static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) -- cgit From 633ac2d7161201c6fa2b0800995ff0c47f7614dc Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 2 Apr 2002 01:49:31 +0000 Subject: Update --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 056eafe1..a2d6511f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 2.0-pre8: + Additional HCI ioctls and defines. + All strings and buffers are allocated dynamically. + ba2str, str2ba automaticaly swap bdaddress. + Minor fixes and cleanup. + ver 2.0-pre7: Bluetooth libraries and header files is now a separate package. New build environment uses automake and libtool. -- cgit From 682fd2124fa3b6949c1901492ee9ff5183400316 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 2 Apr 2002 01:50:10 +0000 Subject: update --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a2d6511f..cf84f55f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ ver 2.0-pre8: Additional HCI ioctls and defines. All strings and buffers are allocated dynamically. - ba2str, str2ba automaticaly swap bdaddress. + ba2str, str2ba automatically swap bdaddress. Minor fixes and cleanup. ver 2.0-pre7: -- cgit From cf7340b7aa8fc1a5cae9bc55b368ef4b110cebc0 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 3 Apr 2002 17:45:50 +0000 Subject: Added status commands --- include/hci.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/hci.h b/include/hci.h index ef07bc06..65eabc62 100644 --- a/include/hci.h +++ b/include/hci.h @@ -461,6 +461,37 @@ typedef struct { /* Status params */ #define OGF_STATUS_PARAM 0x05 +#define OCF_READ_FAILED_CONTACT_COUNTER 0x0001 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t counter; +} __attribute__ ((packed)) read_failed_contact_counter_rp; +#define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4 + +#define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) reset_failed_contact_counter_rp; +#define OCF_RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 + +#define OCF_GET_LINK_QUALITY 0x0003 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t link_quality; +} __attribute__ ((packed)) get_link_quality_rp; +#define GET_LINK_QUALITY_RP_SIZE 4 + +#define OCF_READ_RSSI 0x0005 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t rssi; +} __attribute__ ((packed)) read_rssi_rp; +#define READ_RSSI_RP_SIZE 4 + /* ---- HCI Events ---- */ #define EVT_INQUIRY_COMPLETE 0x01 -- cgit From 00012f0fe236ff884d28c12781398183dac51b7f Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 10 Apr 2002 18:20:36 +0000 Subject: hci_req initialization fixes. --- configure.in | 1 - src/hci.c | 21 +++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/configure.in b/configure.in index ae9aa5a7..cc27876c 100644 --- a/configure.in +++ b/configure.in @@ -14,7 +14,6 @@ AC_SUBST(AR) CFLAGS="-Wall -g -O2" AC_PROG_CC -AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LIBTOOL #AC_CHECK_TOOL(LD, ld, ld) diff --git a/src/hci.c b/src/hci.c index 544607b9..a3ffe28b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -593,10 +593,12 @@ int hci_local_name(int dd, int len, char *name, int to) read_local_name_rp rp; struct hci_request rq; - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_READ_LOCAL_NAME; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_LOCAL_NAME; + rq.cparam = NULL; + rq.clen = 0; rq.rparam = &rp; - rq.rlen = READ_LOCAL_NAME_RP_SIZE; + rq.rlen = READ_LOCAL_NAME_RP_SIZE; if (hci_send_req(dd, &rq, to) < 0) return -1; @@ -620,8 +622,8 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); - rq.ogf = OGF_LINK_CTL; - rq.ocf = OCF_REMOTE_NAME_REQ; + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_REMOTE_NAME_REQ; rq.cparam = &cp; rq.clen = REMOTE_NAME_REQ_CP_SIZE; rq.event = EVT_REMOTE_NAME_REQ_COMPLETE; @@ -706,13 +708,12 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) read_local_version_rp rp; struct hci_request rq; - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_INFO_PARAM; - rq.ocf = OCF_READ_LOCAL_VERSION; + rq.ogf = OGF_INFO_PARAM; + rq.ocf = OCF_READ_LOCAL_VERSION; rq.cparam = NULL; - rq.clen = 0; + rq.clen = 0; rq.rparam = &rp; - rq.rlen = READ_LOCAL_VERSION_RP_SIZE; + rq.rlen = READ_LOCAL_VERSION_RP_SIZE; if (hci_send_req(dd, &rq, 1000) < 0) return -1; -- cgit From 8dab9b0bcab616bde55a3a137bd6fb8818ced4a5 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 11 Apr 2002 16:56:10 +0000 Subject: Added LMP features to sting translation function and table. --- include/hci.h | 3 ++- include/hci_lib.h | 2 ++ src/hci.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 70 insertions(+), 2 deletions(-) diff --git a/include/hci.h b/include/hci.h index 65eabc62..4610ac00 100644 --- a/include/hci.h +++ b/include/hci.h @@ -139,7 +139,7 @@ enum { #define LMP_TACCURACY 0x10 #define LMP_RSWITCH 0x20 #define LMP_HOLD 0x40 -#define LMP_SNIF 0x80 +#define LMP_SNIFF 0x80 #define LMP_PARK 0x01 #define LMP_RSSI 0x02 @@ -153,6 +153,7 @@ enum { #define LMP_CVSD 0x01 #define LMP_PSCHEME 0x02 #define LMP_PCONTROL 0x04 +#define LMP_TRSP_SCO 0x08 /* Link policies */ #define HCI_LP_RSWITCH 0x0001 diff --git a/include/hci_lib.h b/include/hci_lib.h index ed3306ab..10374a30 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -82,6 +82,8 @@ int hci_strtover(char *str, unsigned int *ver); char *lmp_vertostr(unsigned int ver); int lmp_strtover(char *str, unsigned int *ver); +char *lmp_featurestostr(uint8_t *features, char *pref, int width); + static inline void hci_set_bit(int nr, void *addr) { *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); diff --git a/src/hci.c b/src/hci.c index a3ffe28b..af494c15 100644 --- a/src/hci.c +++ b/src/hci.c @@ -53,7 +53,7 @@ typedef struct { static char *hci_bit2str(hci_map *m, unsigned int val) { - char *str = malloc(50); + char *str = malloc(120); char *ptr = str; if (!str) @@ -287,6 +287,71 @@ int lmp_strtover(char *str, unsigned int *ver) return hci_str2uint(ver_map, str, ver); } +/* LMP features mapping */ +hci_map lmp_features_map[][9] = { + { /* byte 0 */ + { "<3-slot packets>", LMP_3SLOT }, + { "<5-slot packets>", LMP_5SLOT }, + { "", LMP_ENCRYPT }, + { "", LMP_SOFFSET }, + { "", LMP_TACCURACY}, + { "", LMP_RSWITCH }, + { "", LMP_HOLD }, + { "", LMP_SNIFF }, + { NULL } + }, + { /* byte 1 */ + { "", LMP_PARK }, + { "", LMP_RSSI }, + { "", LMP_QUALITY }, + { "", LMP_SCO }, + { "", LMP_HV2 }, + { "", LMP_HV3 }, + { "", LMP_ULAW }, + { "", LMP_ALAW }, + { NULL } + }, + { /* byte 2 */ + { "", LMP_CVSD }, + { "", LMP_PSCHEME }, + { "", LMP_PCONTROL }, + { "", LMP_TRSP_SCO }, + { NULL } + }, + {{ NULL }} +}; + +char *lmp_featurestostr(uint8_t *features, char *pref, int width) +{ + char *ptr, *str = malloc(400); + int i, w; + + if (!str) + return NULL; + + ptr = str; *ptr = 0; + + if (pref) + ptr += sprintf(ptr, "%s", pref); + + for(i=0, w=0; lmp_features_map[i][0].str; i++) { + hci_map *m; + + m = lmp_features_map[i]; + while (m->str) { + if ((unsigned int) m->val & (unsigned int) features[i]) + ptr += sprintf(ptr, "%s ", m->str); + m++; + + w = (w + 1) & width; + if (!w) + ptr += sprintf(ptr, "\n%s", pref); + } + } + + return str; +} + /* HCI functions that do not require open device */ int hci_devinfo(int dev_id, struct hci_dev_info *di) -- cgit From 083ac35c0e178f548da930e91fe4154a4993af0e Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 11 Apr 2002 18:19:58 +0000 Subject: Added hci_class_of_dev function. hci_req initialization cleanup. --- include/hci_lib.h | 1 + src/hci.c | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 10374a30..5a49fd35 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -67,6 +67,7 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); +int hci_class_of_dev(int dd, uint8_t *class, int to); char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); diff --git a/src/hci.c b/src/hci.c index af494c15..9418eb42 100644 --- a/src/hci.c +++ b/src/hci.c @@ -605,6 +605,7 @@ int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffs cp.clock_offset = clkoffset; cp.role_switch = rswitch; + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_CREATE_CONN; rq.event = EVT_CONN_COMPLETE; @@ -635,6 +636,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) cp.handle = handle; cp.reason = reason; + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_DISCONNECT; rq.event = EVT_DISCONN_COMPLETE; @@ -658,10 +660,9 @@ int hci_local_name(int dd, int len, char *name, int to) read_local_name_rp rp; struct hci_request rq; + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_READ_LOCAL_NAME; - rq.cparam = NULL; - rq.clen = 0; rq.rparam = &rp; rq.rlen = READ_LOCAL_NAME_RP_SIZE; @@ -687,6 +688,7 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_REMOTE_NAME_REQ; rq.cparam = &cp; @@ -717,6 +719,7 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) memset(&cp, 0, sizeof(cp)); cp.handle = handle; + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_FEATURES; rq.event = EVT_READ_REMOTE_FEATURES_COMPLETE; @@ -746,6 +749,7 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in memset(&cp, 0, sizeof(cp)); cp.handle = handle; + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_VERSION; rq.event = EVT_READ_REMOTE_VERSION_COMPLETE; @@ -773,10 +777,9 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) read_local_version_rp rp; struct hci_request rq; + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_INFO_PARAM; rq.ocf = OCF_READ_LOCAL_VERSION; - rq.cparam = NULL; - rq.clen = 0; rq.rparam = &rp; rq.rlen = READ_LOCAL_VERSION_RP_SIZE; @@ -796,3 +799,26 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) return 0; } + +int hci_class_of_dev(int dd, uint8_t *class, int to) +{ + read_class_of_dev_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_CLASS_OF_DEV; + rq.rparam = &rp; + rq.rlen = READ_CLASS_OF_DEV_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + memcpy(class, rp.dev_class, 3); + return 0; +} -- cgit From e6564963d4e3c7efe92e30c00fa289dd5a964f28 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 15 Apr 2002 16:55:14 +0000 Subject: lmp_featuretostr fixes --- src/hci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hci.c b/src/hci.c index 9418eb42..6af14864 100644 --- a/src/hci.c +++ b/src/hci.c @@ -339,13 +339,13 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) m = lmp_features_map[i]; while (m->str) { - if ((unsigned int) m->val & (unsigned int) features[i]) + if ((unsigned int) m->val & (unsigned int) features[i]) { ptr += sprintf(ptr, "%s ", m->str); + w = (w + 1) & width; + if (!w) + ptr += sprintf(ptr, "\n%s", pref ? pref : ""); + } m++; - - w = (w + 1) & width; - if (!w) - ptr += sprintf(ptr, "\n%s", pref); } } -- cgit From 6402046f11be1122658c1388c9d0614ad117c0f8 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 15 Apr 2002 16:55:41 +0000 Subject: update --- configure | 216 +++++++++++++++++++++++++++----------------------------------- 1 file changed, 93 insertions(+), 123 deletions(-) diff --git a/configure b/configure index d15a5324..70f2c732 100755 --- a/configure +++ b/configure @@ -1174,36 +1174,6 @@ else fi fi -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1181: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - # 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: @@ -1216,7 +1186,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1220: checking for a BSD compatible install" >&5 +echo "configure:1190: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1269,12 +1239,12 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1273: checking for Cygwin environment" >&5 +echo "configure:1243: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1302,19 +1272,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1306: checking for mingw32 environment" >&5 +echo "configure:1276: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1331,7 +1301,7 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1335: checking how to run the C preprocessor" >&5 +echo "configure:1305: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1346,13 +1316,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1363,13 +1333,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1380,13 +1350,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1486,7 +1456,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1490: checking host system type" >&5 +echo "configure:1460: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1507,7 +1477,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1511: checking build system type" >&5 +echo "configure:1481: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1536,7 +1506,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1540: checking for ld used by GCC" >&5 +echo "configure:1510: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1566,10 +1536,10 @@ echo "configure:1540: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1570: checking for GNU ld" >&5 +echo "configure:1540: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1573: checking for non-GNU ld" >&5 +echo "configure:1543: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1604,7 +1574,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1608: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1578: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1621,7 +1591,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1625: checking for $LD option to reload object files" >&5 +echo "configure:1595: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1633,7 +1603,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1637: checking for BSD-compatible nm" >&5 +echo "configure:1607: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1671,7 +1641,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1675: checking whether ln -s works" >&5 +echo "configure:1645: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1692,7 +1662,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1696: checking how to recognise dependant libraries" >&5 +echo "configure:1666: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1865,13 +1835,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1869: checking for object suffix" >&5 +echo "configure:1839: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1891,7 +1861,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1895: checking for executable suffix" >&5 +echo "configure:1865: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1901,7 +1871,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1932,7 +1902,7 @@ fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 -echo "configure:1936: checking command to parse $NM output" >&5 +echo "configure:1906: checking command to parse $NM output" >&5 if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2008,10 +1978,10 @@ void nm_test_func(){} int main(){nm_test_var='a';nm_test_func();return(0);} EOF - if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:1982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. nlist=conftest.nm - if { (eval echo configure:2015: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then + if { (eval echo configure:1985: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -2062,7 +2032,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo configure:2066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo configure:2036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" @@ -2108,17 +2078,17 @@ for ac_hdr in dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2112: checking for $ac_hdr" >&5 +echo "configure:2082: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2153,7 +2123,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2157: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2127: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2215,7 +2185,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2219: checking for file" >&5 +echo "configure:2189: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2286,7 +2256,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2290: checking for $ac_word" >&5 +echo "configure:2260: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2318,7 +2288,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2322: checking for $ac_word" >&5 +echo "configure:2292: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2353,7 +2323,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2357: checking for $ac_word" >&5 +echo "configure:2327: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2385,7 +2355,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2389: checking for $ac_word" >&5 +echo "configure:2359: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2434,8 +2404,8 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2438 "configure"' > conftest.$ac_ext - if { (eval echo configure:2439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2408 "configure"' > conftest.$ac_ext + if { (eval echo configure:2409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2456,7 +2426,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2460: checking whether the C compiler needs -belf" >&5 +echo "configure:2430: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2469,14 +2439,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2589,7 +2559,7 @@ set dummy $CC compiler="$2" echo $ac_n "checking for objdir""... $ac_c" 1>&6 -echo "configure:2593: checking for objdir" >&5 +echo "configure:2563: checking for objdir" >&5 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -2616,7 +2586,7 @@ test -z "$pic_mode" && pic_mode=default # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:2620: checking for $compiler option to produce PIC" >&5 +echo "configure:2590: checking for $compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2768,21 +2738,21 @@ else # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 -echo "configure:2772: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 +echo "configure:2742: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* case $host_os in hpux9* | hpux10* | hpux11*) @@ -2834,7 +2804,7 @@ if test -n "$lt_cv_prog_cc_shlib"; then fi echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 -echo "configure:2838: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 +echo "configure:2808: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2842,14 +2812,14 @@ else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_prog_cc_static_works=yes else @@ -2876,7 +2846,7 @@ can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 -echo "configure:2880: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo "configure:2850: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2895,7 +2865,7 @@ chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:2899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:2869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -2924,7 +2894,7 @@ echo "$ac_t""$compiler_c_o" 1>&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6 -echo "configure:2928: checking if $compiler supports -c -o file.lo" >&5 +echo "configure:2898: checking if $compiler supports -c -o file.lo" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2933,14 +2903,14 @@ else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -2970,7 +2940,7 @@ hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 -echo "configure:2974: checking if we can lock with hard links" >&5 +echo "configure:2944: checking if we can lock with hard links" >&5 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no @@ -2989,20 +2959,20 @@ fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 -echo "configure:2993: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo "configure:2963: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -3029,7 +2999,7 @@ fi # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:3033: checking whether the linker ($LD) supports shared libraries" >&5 +echo "configure:3003: checking whether the linker ($LD) supports shared libraries" >&5 allow_undefined_flag= no_undefined_flag= @@ -3645,7 +3615,7 @@ test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 -echo "configure:3649: checking how to hardcode library paths into programs" >&5 +echo "configure:3619: checking how to hardcode library paths into programs" >&5 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then @@ -3673,7 +3643,7 @@ echo "$ac_t""$hardcode_action" 1>&6 striplib= old_striplib= echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 -echo "configure:3677: checking whether stripping libraries is possible" >&5 +echo "configure:3647: checking whether stripping libraries is possible" >&5 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" @@ -3687,7 +3657,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 -echo "configure:3691: checking dynamic linker characteristics" >&5 +echo "configure:3661: checking dynamic linker characteristics" >&5 library_names_spec= libname_spec='lib$name' soname_spec= @@ -4073,7 +4043,7 @@ test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 -echo "configure:4077: checking if libtool supports shared libraries" >&5 +echo "configure:4047: checking if libtool supports shared libraries" >&5 echo "$ac_t""$can_build_shared" 1>&6 if test "$hardcode_action" = relink; then @@ -4112,7 +4082,7 @@ else *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4116: checking for dlopen in -ldl" >&5 +echo "configure:4086: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4120,7 +4090,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4150,12 +4120,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4154: checking for dlopen" >&5 +echo "configure:4124: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4196,12 +4166,12 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "configure:4200: checking for shl_load" >&5 +echo "configure:4170: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -4242,7 +4212,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "configure:4246: checking for dlopen in -lsvld" >&5 +echo "configure:4216: checking for dlopen in -lsvld" >&5 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4250,7 +4220,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsvld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4280,7 +4250,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:4284: checking for shl_load in -ldld" >&5 +echo "configure:4254: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4288,7 +4258,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4352,7 +4322,7 @@ fi LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4356: checking whether a program can dlopen itself" >&5 +echo "configure:4326: checking whether a program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4362,7 +4332,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4446,7 +4416,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4450: checking whether a statically linked program can dlopen itself" >&5 +echo "configure:4420: checking whether a statically linked program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4456,7 +4426,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4566,14 +4536,14 @@ if test "$enable_shared" = yes && test "$GCC" = yes; then # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 -echo "configure:4570: checking whether -lc should be explicitly linked in" >&5 +echo "configure:4540: checking whether -lc should be explicitly linked in" >&5 if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext - if { (eval echo configure:4577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext @@ -4586,7 +4556,7 @@ else libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= - if { (eval echo configure:4590: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } + if { (eval echo configure:4560: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then lt_cv_archive_cmds_need_lc=no else @@ -5325,7 +5295,6 @@ s%@SET_MAKE@%$SET_MAKE%g s%@LD@%$LD%g s%@AR@%$AR%g s%@CC@%$CC%g -s%@RANLIB@%$RANLIB%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g @@ -5340,6 +5309,7 @@ s%@LN_S@%$LN_S%g s%@OBJEXT@%$OBJEXT%g s%@EXEEXT@%$EXEEXT%g s%@ECHO@%$ECHO%g +s%@RANLIB@%$RANLIB%g s%@STRIP@%$STRIP%g s%@CPP@%$CPP%g s%@LIBTOOL@%$LIBTOOL%g -- cgit From 16591cb20976879e8189d46d24ed1b41b0941a27 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 22 Apr 2002 20:12:15 +0000 Subject: Additional hci_filter_ functions --- include/hci_lib.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 5a49fd35..ecf180be 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -90,6 +90,11 @@ static inline void hci_set_bit(int nr, void *addr) *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); } +static inline void hci_clear_bit(int nr, void *addr) +{ + *((uint32_t *) addr + (nr >> 5)) &= ~(1 << (nr & 31)); +} + static inline int hci_test_bit(int nr, void *addr) { return *((uint32_t *) addr + (nr >> 5)) & (1 << (nr & 31)); @@ -104,6 +109,14 @@ static inline void hci_filter_set_ptype(int t, struct hci_filter *f) { hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); } +static inline void hci_filter_clear_ptype(int t, struct hci_filter *f) +{ + hci_clear_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); +} +static inline int hci_filter_test_ptype(int t, struct hci_filter *f) +{ + return hci_test_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); +} static inline void hci_filter_all_ptypes(struct hci_filter *f) { memset((void *)&f->type_mask, 0xff, sizeof(f->type_mask)); @@ -112,6 +125,14 @@ static inline void hci_filter_set_event(int e, struct hci_filter *f) { hci_set_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); } +static inline void hci_filter_clear_event(int e, struct hci_filter *f) +{ + hci_clear_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); +} +static inline int hci_filter_test_event(int e, struct hci_filter *f) +{ + return hci_test_bit((e & HCI_FLT_EVENT_BITS), &f->event_mask); +} static inline void hci_filter_all_events(struct hci_filter *f) { memset((void *)f->event_mask, 0xff, sizeof(f->event_mask)); @@ -120,6 +141,14 @@ static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) { f->opcode = opcode; } +static inline void hci_filter_clear_opcode(int opcode, struct hci_filter *f) +{ + f->opcode = 0; +} +static inline int hci_filter_test_opcode(int opcode, struct hci_filter *f) +{ + return (f->opcode == opcode); +} #ifdef __cplusplus } -- cgit From d783970c123698e8582ebf3b396c9c50e0666f46 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 1 May 2002 00:21:50 +0000 Subject: update --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index cf84f55f..fa80fe14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 2.0-pre9: + LMP features to string translation support. + Additional HCI command and event defines. + Extended hci_filter API. + ver 2.0-pre8: Additional HCI ioctls and defines. All strings and buffers are allocated dynamically. -- cgit From 807d006ed3259907b450642536cad6123431acf9 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 6 May 2002 20:54:32 +0000 Subject: Add BNEP socket proto. --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 8026832b..b93c4e35 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -47,6 +47,7 @@ extern "C" { #define BTPROTO_HCI 1 #define BTPROTO_SCO 2 #define BTPROTO_RFCOMM 3 +#define BTPROTO_BNEP 4 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From d61a1930cd52b112516c0442a9b75d8461a6031a Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 13 May 2002 19:00:25 +0000 Subject: more company ids --- src/bluetooth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 97a1cf57..622464f8 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -250,6 +250,12 @@ char *bt_compidtostr(int compid) return "C Technologies"; case 39: return "Open Interface"; + case 40: + return "R F Micro Devices"; + case 41: + return "Hitachi Ltd"; + case 42: + return "Symbol Technologies, Inc."; case 65535: return "internal use"; default: -- cgit From 49599e0272bcb717a3919ead8147450f2cbe2d99 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 17 May 2002 01:03:35 +0000 Subject: ltconfig seem to be required on some systems. --- ltconfig | 2795 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2795 insertions(+) create mode 100755 ltconfig diff --git a/ltconfig b/ltconfig new file mode 100755 index 00000000..746e15b9 --- /dev/null +++ b/ltconfig @@ -0,0 +1,2795 @@ +#! /bin/sh + +# ltconfig - Create a system-specific libtool. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A lot of this script is taken from autoconf-2.10. + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} +echo=echo +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec "$SHELL" "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null`} + case X$UNAME in + *-DOS) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; + esac +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running ltconfig again with it. + ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + + export echo_test_string + exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# The name of this program. +progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` + +# Constants: +PROGRAM=ltconfig +PACKAGE=libtool +VERSION=1.4a-GCC3.0 +TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)" +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +rm="rm -f" + +help="Try \`$progname --help' for more information." + +# Global variables: +default_ofile=libtool +can_build_shared=yes +enable_shared=yes +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +enable_static=yes +enable_fast_install=yes +enable_dlopen=unknown +enable_win32_dll=no +pic_mode=default +ltmain= +silent= +srcdir= +ac_config_guess= +ac_config_sub= +host= +build=NONE +nonopt=NONE +ofile="$default_ofile" +verify_host=yes +tagname= +with_gcc=no +with_gnu_ld=no +need_locks=yes +ac_ext=c +libext=a +cache_file= +max_cmd_len= + +## Dependencies to place before and after the object being linked: +predep_objects= +postdep_objects= +predeps= +postdeps= +compiler_lib_search_path= + +## Link characteristics: +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +old_archive_from_expsyms_cmds= +striplib= +old_striplib= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_into_libs=no +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +link_all_deplibs=unknown +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression of symbols to exclude +# it will be wrapped by ` (' and `)$', so one must not match beginning or +# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +# as well as any symbol that contains `d'. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_" +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +# platforms (ab)use it in PIC code, but their linkers get confused if +# the symbol is explicitly referenced. Since portable code cannot +# rely on this symbol name, it's probably fine to never include it in +# preloaded symbol tables. +extract_expsyms_cmds= + +## Tools: +old_AR="$AR" +old_AR_FLAGS="$AR_FLAGS" +old_CC="$CC" +old_CFLAGS="$CFLAGS" +old_CPPFLAGS="$CPPFLAGS" +old_LDFLAGS="$LDFLAGS" +old_LIBS="$LIBS" +old_MAGIC_CMD="$MAGIC_CMD" +old_LD="$LD" +old_LN_S="$LN_S" +old_LTCC="$LTCC" +old_NM="$NM" +old_RANLIB="$RANLIB" +old_STRIP="$STRIP" +old_AS="$AS" +old_DLLTOOL="$DLLTOOL" +old_OBJDUMP="$OBJDUMP" +old_OBJEXT="$OBJEXT" +old_EXEEXT="$EXEEXT" +old_reload_flag="$reload_flag" +old_deplibs_check_method="$deplibs_check_method" +old_file_magic_cmd="$file_magic_cmd" + +# Parse the command line options. +args= +prev= +for option +do + case $option in + -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + eval "$prev=\$option" + prev= + continue + fi + + case $option in + --help) cat <&2 + echo "$help" 1>&2 + exit 1 + ;; + + *) + if test -z "$ltmain"; then + ltmain="$option" + elif test -z "$host"; then +# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 +# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then +# echo "$progname: warning \`$option' is not a valid host type" 1>&2 +# fi + host="$option" + else + echo "$progname: too many arguments" 1>&2 + echo "$help" 1>&2 + exit 1 + fi ;; + esac +done + +if test -z "$ltmain"; then + echo "$progname: you must specify a LTMAIN file" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +if test ! -f "$ltmain"; then + echo "$progname: \`$ltmain' does not exist" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +if test -n "$tagname"; then + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in + "") ;; + *) + echo "$progname: invalid tag name: $tagname" 1>&2 + exit 1 + ;; + esac + + if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ofile" > /dev/null; then + echo "$progname: tag name $tagname already exists" 1>&2 + exit 1 + fi + + if test ! -f "$ofile"; then + echo "$progname: warning: output file \`$ofile' does not exist" 1>&2 + fi + + if test -z "$LTCC"; then + eval "`$SHELL $ofile --config | grep '^LTCC='`" + if test -z "$LTCC"; then + echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2 + else + echo "$progname: warning: using \`LTCC=$LTCC', extracted from \`$ofile'" 1>&2 + fi + fi +fi + +# Quote any args containing shell metacharacters. +ltconfig_args= +for arg +do + case $arg in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ltconfig_args="$ltconfig_args '$arg'" ;; + *) ltconfig_args="$ltconfig_args $arg" ;; + esac +done + +# A relevant subset of AC_INIT. + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 5 compiler messages saved in config.log +# 6 checking for... messages and results +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>>./config.log + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi +if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi + +if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then + echo "loading cache $cache_file within ltconfig" + . $cache_file +fi + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + +if test -z "$srcdir"; then + # Assume the source directory is the same one as the path to LTMAIN. + srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` + test "$srcdir" = "$ltmain" && srcdir=. +fi + +trap "$rm conftest*; exit 1" 1 2 15 +if test "$verify_host" = yes; then + # Check for config.guess and config.sub. + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/config.guess; then + ac_aux_dir=$ac_dir + break + fi + done + if test -z "$ac_aux_dir"; then + echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 + echo "$help" 1>&2 + exit 1 + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + + # Make sure we can run config.sub. + if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : + else + echo "$progname: cannot run $ac_config_sub" 1>&2 + echo "$help" 1>&2 + exit 1 + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 + + host_alias=$host + case $host_alias in + "") + # Force config.guess to use the C compiler. + # CC_FOR_BUILD overrides the CC variable in config.guess but I had + # problems with it so do it this way for now. + CC="$LTCC" + + if host_alias=`$SHELL $ac_config_guess`; then : + else + echo "$progname: cannot guess host type; you must specify one" 1>&2 + echo "$help" 1>&2 + exit 1 + fi + + # Restore the C compiler. + CC="$old_CC" + ;; + esac + host=`$SHELL $ac_config_sub $host_alias` + echo "$ac_t$host" 1>&6 + + # Make sure the host verified. + test -z "$host" && exit 1 + + # Check for the build system type + echo $ac_n "checking build system type... $ac_c" 1>&6 + + build_alias=$build + case $build_alias in + NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; + esac + + build=`$SHELL $ac_config_sub $build_alias` + build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$build" 1>&6 + +elif test -z "$host"; then + echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 + echo "$help" 1>&2 + exit 1 +else + host_alias=$host + build_alias=$host_alias + build=$host +fi + +if test x"$host" != x"$build"; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case $host_os in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" +fi + +# Source the script associated with the $tagname tag configuration. +if test -n "$tagname"; then + . $ltmain +else + # FIXME: We should use a variable here + # Configure for a C compiler + . $srcdir/ltcf-c.sh +fi + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$NM" && NM=nm +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$objext" && objext=o + +echo $ac_n "checking for objdir... $ac_c" 1>&6 +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +echo "$ac_t$objdir" 1>&6 + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="$2" + +# We assume here that the value for ac_cv_prog_cc_pic will not be cached +# in isolation, and that seeing it set (from the cache) indicates that +# the associated values are set (in the cache) correctly too. +echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 +echo "$progname:678:checking for $compiler option to produce PIC" 1>&5 + +if test -z "$ac_cv_prog_cc_pic"; then + echo "$ac_t"none 1>&6 +else + echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6 + + # Check to make sure the pic_flag actually works. + echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6 + echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5 + if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \ + test "X${ac_cv_prog_cc_pic_works}" != X; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_prog_cc_pic_works=yes + $rm conftest* + echo $lt_simple_compile_test_code > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC" + if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + case $host_os in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then + # they create non-PIC objects. So, if there were any warnings, we + # assume that PIC is not supported. + if test -s conftest.err; then + ac_cv_prog_cc_pic_works=no + ac_cv_prog_cc_can_build_shared=no + ac_cv_prog_cc_pic= + else + ac_cv_prog_cc_pic_works=yes + ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" + fi + ;; + *) + ac_cv_prog_cc_pic_works=yes + ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" + ;; + esac + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + ac_cv_prog_cc_pic_works=no + ac_cv_prog_cc_can_build_shared=no + ac_cv_prog_cc_pic= + fi + CFLAGS="$save_CFLAGS" + $rm conftest* + fi + # Belt *and* braces to stop my trousers falling down: + if test "X$ac_cv_prog_cc_pic_works" = Xno; then + ac_cv_prog_cc_pic= + ac_cv_prog_cc_can_build_shared=no + fi + echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6 +fi + +# Check for any special shared library compilation flags. +if test -n "$ac_cv_prog_cc_shlib"; then + echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2 + if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then : + else + echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 + ac_cv_prog_cc_can_build_shared=no + fi +fi + +echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6 +echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5 +if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \ + test "X${ac_cv_prog_cc_static_works}" != X; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + $rm conftest* + echo $lt_simple_link_test_code > conftest.$ac_ext + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static" + if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_static_works=yes + else + ac_cv_prog_cc_static_works=no + ac_cv_prog_cc_static= + fi + LDFLAGS="$save_LDFLAGS" + $rm conftest* +fi +# Belt *and* braces to stop my trousers falling down: +if test "X$ac_cv_prog_cc_static_works" = Xno; then + ac_cv_prog_cc_static= +fi +echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6 +pic_flag="$ac_cv_prog_cc_pic" +special_shlib_compile_flags="$ac_cv_prog_cc_shlib" +wl="$ac_cv_prog_cc_wl" +link_static_flag="$ac_cv_prog_cc_static" +no_builtin_flag="$ac_cv_prog_cc_no_builtin" +can_build_shared="$ac_cv_prog_cc_can_build_shared" + +# find the maximum length of command line arguments +echo "$progname:780: finding the maximum length of command line arguments" 1>&5 +echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + i=0 + testring="ABCD" + # 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"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring" && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # add a significant safety factor because C++ compilers can tack on massive amounts + # of additional arguments before passing them to the linker. 1/4 should be good. + len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len` +fi +echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5 +echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6 + +if test -n $lt_cv_sys_max_cmd_len ; then + max_cmd_len=$lt_cv_sys_max_cmd_len +else + max_cmd_len=none +fi + +# Check to see if options -o and -c are simultaneously supported by compiler +echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6 +if test "${lt_cv_compiler_c_o+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + $rm conftest* + echo $lt_simple_compile_test_code > conftest.$ac_ext + mkdir out + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -o out/conftest2.$objext" + echo "$progname:833: checking if $compiler supports -c -o file.$objext" >&5 + if { (eval echo $progname:834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + lt_cv_compiler_c_o=no + else + lt_cv_compiler_c_o=yes + fi + else + # Append any errors to the config.log. + cat out/conftest.err 1>&5 + lt_cv_compiler_c_o=no + fi + CFLAGS="$save_CFLAGS" + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm -r conftest 2>/dev/null +fi +compiler_c_o=$lt_cv_compiler_c_o +echo "${ac_t}$compiler_c_o" 1>&6 + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$ac_t$hard_links" 1>&6 + $rm conftest* + if test "$hard_links" = no; then + echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 + need_locks=warn + fi +else + need_locks=no +fi + +if test "$with_gcc" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 + $rm conftest* + echo $lt_simple_compile_test_code > conftest.$ac_ext + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" + echo "$progname:887: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + if { (eval echo $progname:888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + compiler_rtti_exceptions=no + else + echo "$ac_t"yes 1>&6 + compiler_rtti_exceptions=yes + fi + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + compiler_rtti_exceptions=no + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi + +fi + +# See if the linker supports building shared libraries. +echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 + +echo "$ac_t$ld_shlibs" 1>&6 +test "$ld_shlibs" = no && can_build_shared=no + +# Check hardcoding attributes. +echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$ac_t$hardcode_action" 1>&6 + +echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6 +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + echo "${ac_t}yes" 1>&6 +else + echo "${ac_t}no" 1>&6 +fi + +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +# PORTME Fill in your ld.so characteristics +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + +echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4* | aix5*) + version_type=linux + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + else + # 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. + # We preserve .a as extension for shared libraries though AIX4.2 + # and later linker supports .so + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so instead of + # lib.a to let people know that these are not typical AIX shared libraries. + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + else + # We preserve .a as extension for shared libraries though AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}.so$major' + fi + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + shlibpath_var=LIBPATH + deplibs_check_method=pass_all + 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 + # 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. + can_build_shared=no + fi + ;; + esac + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + need_version=no + need_lib_prefix=no + case $with_gcc,$host_os in + yes,cygwin*) + library_names_spec='$libname.dll.a' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' + postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog .libs/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll; $rm \$dlpath' + ;; + yes,mingw*) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` + ;; + yes,pw32*) + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' +;; + *) + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}.`test .$module = .yes && echo so || echo dylib` ${libname}${release}${major}.$`test .$module = .yes && echo so || echo dylib` ${libname}.`test .$module = .yes && echo so || echo dylib`' + soname_spec='${libname}${release}${major}.`test .$module = .yes && echo so || echo dylib`' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lc=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + *) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + case $host_os in + irix5*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + need_lib_prefix=no + need_version=no + version_type=sunos + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + need_version=no + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$ac_t$dynamic_linker" 1>&6 +test "$dynamic_linker" = no && can_build_shared=no + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + ;; +irix*) + symcode='[BCDEGRST]' + ;; +solaris* | sysv5*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $host_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[ABCDGISTW]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + $rm conftest* + cat > conftest.$ac_ext <&5 + if { (eval echo $progname:1432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + # Now try to grab the symbols. + nlist=conftest.nm + if { echo "$progname:1435: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$objext conftstm.$objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + pipe_works=yes + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + LIBS="$save_LIBS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + $rm conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + global_symbol_pipe= + fi +done +if test "$pipe_works" = yes; then + echo "${ac_t}ok" 1>&6 +else + echo "${ac_t}failed" 1>&6 +fi + +if test -z "$global_symbol_pipe"; then + global_symbol_to_cdecl= +fi + +# Report the final consequences. +echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 + +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in +# configure.in, otherwise build static only libraries. +case $host_os in +cygwin* | mingw* | pw32* | os2*) + if test x$can_build_shared = xyes; then + test x$enable_win32_dll = xno && can_build_shared=no + echo "checking if package supports dlls... $can_build_shared" 1>&6 + fi +;; +esac + +echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + test "$enable_shared" = yes && enable_static=no + ;; +esac + +echo "$ac_t$enable_shared" 1>&6 + +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes + +echo "checking whether to build static libraries... $enable_static" 1>&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$with_gcc" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +# Check whether we must set pic_mode to default +test -z "$pic_flag" && pic_mode=default + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else +if test "X${lt_cv_dlopen+set}" != Xset; then + lt_cv_dlopen=no lt_cv_dlopen_libs= +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "$progname:1591: checking for dlopen in -ldl" >&5 +if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_dl_dlopen=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_dl_dlopen=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_dl_dlopen" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen""... $ac_c" 1>&6 +echo "$progname:1630: checking for dlopen" >&5 +if test "X${ac_cv_func_dlopen+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dlopen) || defined (__stub___dlopen) +choke me +#else +dlopen(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_dlopen=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_dlopen=no +fi +rm -f conftest* +fi +if test "X$ac_cv_func_dlopen" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 +echo "$progname:1677: checking for dlopen in -lsvld" >&5 +if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsvld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_svld_dlopen=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_svld_dlopen=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_svld_dlopen" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 +echo "$progname:1716: checking for dld_link in -ldld" >&5 +if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_dld_dld_link=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_dld_dld_link=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_dld_dld_link" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load""... $ac_c" 1>&6 +echo "$progname:1755: checking for shl_load" >&5 +if test "X${ac_cv_func_shl_load+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shl_load) || defined (__stub___shl_load) +choke me +#else +shl_load(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_shl_load=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_shl_load=no +fi +rm -f conftest* +fi + +if test "X$ac_cv_func_shl_load" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "$progname:1803: checking for shl_load in -ldld" >&5 +if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldld $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_lib_dld_shl_load=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_lib_dld_shl_load=no +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if test "X$ac_cv_lib_dld_shl_load" = Xyes; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +fi + + +fi + + +fi + +fi + +fi + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) +for ac_hdr in dlfcn.h; do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "$progname:1871: checking for $ac_hdr" >&5 +if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int fnord = 0; +int main () { return(0); } +EOF +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:1882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +done + + if test "x$ac_cv_header_dlfcn_h" = xyes; then + CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + fi + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:1910: checking whether a program can dlopen itself" >&5 +if test "X${lt_cv_dlopen_self+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self=cross + else + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42; } +int main() { + void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + +EOF +if { (eval echo $progname:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self" 1>&6 + + if test "$lt_cv_dlopen_self" = yes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:1984: checking whether a statically linked program can dlopen itself" >&5 +if test "X${lt_cv_dlopen_self_static+set}" = Xset; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self_static=cross + else + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42; } +int main() { + void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + +EOF +if { (eval echo $progname:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self_static=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self_static=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 +fi + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + +# Copy echo and quote the copy, instead of the original, because it is +# used later. +ltecho="$echo" +if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ltecho="$CONFIG_SHELL \$0 --fallback-echo" +fi +LTSHELL="$SHELL" + +LTCONFIG_VERSION="$VERSION" + +# Only quote variables if we're using ltmain.sh. +case $ltmain in +*.sh) + # Now quote all the things that may contain metacharacters. + for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ + old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ + old_LN_S old_NM old_RANLIB old_STRIP \ + old_AS old_DLLTOOL old_OBJDUMP \ + old_OBJEXT old_EXEEXT old_reload_flag \ + old_deplibs_check_method old_file_magic_cmd \ + AR AR_FLAGS CC LTCC LD LN_S NM LTSHELL LTCONFIG_VERSION \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ + postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ + predep_objects postdep_objects predeps postdeps compiler_lib_search_path \ + old_striplib striplib file_magic_cmd export_symbols_cmds \ + deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o need_locks exclude_expsyms include_expsyms; do + + case $var in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test + ;; + *) + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test + ;; + esac + done + + case $ltecho in + *'\$0 --fallback-echo"') + ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + + if test -z "$tagname"; then + trap "$rm \"$ofile\"; exit 1" 1 2 15 + echo "creating $ofile" + $rm "$ofile" + cat < "$ofile" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. +# +# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +# The names of the tagged configurations supported by this script. +available_tags= + +### BEGIN LIBTOOL CONFIG +EOF + else + echo "appending configuration tag \"$tagname\" to $ofile" + echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" + fi + cfgfile="$ofile" + ;; + +*) + # Double-quote the variables that need it (for aesthetics). + for var in old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ + old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ + old_LN_S old_NM old_RANLIB old_STRIP \ + old_AS old_DLLTOOL old_OBJDUMP \ + old_OBJEXT old_EXEEXT old_reload_flag \ + old_deplibs_check_method old_file_magic_cmd; do + eval "$var=\\\"\$var\\\"" + done + + # Just create a config file. + cfgfile="$ofile.cfg" + if test -z "$tagname"; then + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + echo "creating $cfgfile" + $rm "$cfgfile" + cat < "$cfgfile" +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) + +### BEGIN LIBTOOL CONFIG +EOF + else + echo "appending to $cfgfile" + echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" + fi + ;; +esac + +cat <> "$cfgfile" +# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# AR=$old_AR AR_FLAGS=$old_AR_FLAGS LTCC=$old_LTCC CC=$old_CC \\ +# CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ +# MAGIC_CMD=$old_MAGIC_CMD LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ +# LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\ +# AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\ +# objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\ +# deplibs_check_method=$old_deplibs_check_method \\ +# file_magic_cmd=$old_file_magic_cmd \\ +# $0$ltconfig_args +# +# Compiler and other test output produced by $progname, useful for +# debugging $progname, is in ./config.log if it exists. + +# The version of $progname that generated this script. +LTCONFIG_VERSION=$LTCONFIG_VERSION + +# Shell to use when invoking shell scripts. +SHELL=$LTSHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$need_lc + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$ltecho + +# The archiver. +AR=$AR +AR_FLAGS=$AR_FLAGS + +# A C compiler. +LTCC=$LTCC + +# A language-specific compiler. +CC=$CC + +# Is the compiler the GNU C compiler? +with_gcc=$with_gcc + +# The linker used to build libraries. +LD=$LD + +# Whether we need hard or soft links. +LN_S=$LN_S + +# A BSD-compatible nm program. +NM=$NM + +# A symbol stripping program +STRIP=$STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$reload_flag +reload_cmds=$reload_cmds + +# How to pass a linker flag through the compiler. +wl=$wl + +# Object file suffix (normally "o"). +objext="$objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$pic_flag +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$compiler_c_o + +# Must we lock files when doing compilation ? +need_locks=$need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$RANLIB +old_archive_cmds=$old_archive_cmds +old_postinstall_cmds=$old_postinstall_cmds +old_postuninstall_cmds=$old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$archive_cmds +archive_expsym_cmds=$archive_expsym_cmds +postinstall_cmds=$postinstall_cmds +postuninstall_cmds=$postuninstall_cmds + +# Commands to strip libraries. +old_striplib=$old_striplib +striplib=$striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$global_symbol_to_cdecl + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$hardcode_libdir_separator + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$include_expsyms + +EOF + +if test -z "$tagname"; then + echo '### END LIBTOOL CONFIG' >> "$ofile" +else + echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile" +fi + +case $ltmain in +*.sh) + echo >> "$ofile" + if test -z "$tagname"; then + case $host_os in + aix3*) + cat <<\EOF >> "$ofile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + cat <<'EOF' >> "$ofile" + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# */ +# +# #include /* for printf() */ +# #include /* for open(), lseek(), read() */ +# #include /* for O_RDONLY, O_BINARY */ +# #include /* for strdup() */ +# +# /* O_BINARY isn't required (or even defined sometimes) under Unix */ +# #ifndef O_BINARY +# #define O_BINARY 0 +# #endif +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (dll < 1) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + + chmod +x "$ofile" + fi + ;; + +*) + # Compile the libtool program. + echo "FIXME: would compile $ltmain" + ;; +esac + +# Update the list of available tags. +if test -n "$tagname"; then + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" $ofile | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + # Append the new tag name to the list of available tags. + available_tags="$available_tags $tagname" + + # Now substitute the updated of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' ${ofile} > ${ofile}.new"; then + mv ${ofile}.new ${ofile} + chmod +x "$ofile" + else + rm -f ${ofile}.new + echo "$progname: unable to update list of available tagged configurations." + exit 1 + fi +fi + +# Don't cache tagged configuration! +test -n "$cache_file" && test -z "$tagname" || exit 0 + +# AC_CACHE_SAVE +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +exit 0 + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: -- cgit From 8e9ea9b77e3c4eaf1f1813cfa1e275c7b7ef219a Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 17 May 2002 01:09:28 +0000 Subject: Fix "make dist" --- Makefile.am | 2 + Makefile.in | 8 +- configure | 404 +++++++++++++++++++++++++++++++--------------------- configure.in | 5 + include/Makefile.am | 2 + include/Makefile.in | 6 + src/Makefile.in | 4 + 7 files changed, 267 insertions(+), 164 deletions(-) diff --git a/Makefile.am b/Makefile.am index c744d8fe..d00fd392 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,3 +5,5 @@ SUBDIRS = include src DISTCLEANFILES = conftest.c conftest + +EXTRA_DIST = ChangeLog diff --git a/Makefile.in b/Makefile.in index 854507ac..c84d69ee 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,8 +61,12 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ AR = @AR@ AS = @AS@ CC = @CC@ @@ -83,12 +87,14 @@ VERSION = @VERSION@ SUBDIRS = include src DISTCLEANFILES = conftest.c conftest + +EXTRA_DIST = ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS aclocal.m4 config.guess config.sub configure \ -configure.in install-sh ltmain.sh missing mkinstalldirs +configure.in install-sh ltconfig ltmain.sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) diff --git a/configure b/configure index 70f2c732..4e691e76 100755 --- a/configure +++ b/configure @@ -692,6 +692,7 @@ else fi + ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -711,6 +712,123 @@ ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:744: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:765: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:783: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:812: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + + # 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: @@ -723,7 +841,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:727: checking for a BSD compatible install" >&5 +echo "configure:845: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -776,7 +894,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:780: checking whether build environment is sane" >&5 +echo "configure:898: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -833,7 +951,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:837: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:955: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -879,7 +997,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:883: checking for working aclocal" >&5 +echo "configure:1001: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -892,7 +1010,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:896: checking for working autoconf" >&5 +echo "configure:1014: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -905,7 +1023,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:909: checking for working automake" >&5 +echo "configure:1027: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -918,7 +1036,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:922: checking for working autoheader" >&5 +echo "configure:1040: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -931,7 +1049,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:935: checking for working makeinfo" >&5 +echo "configure:1053: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -955,7 +1073,7 @@ CFLAGS="-Wall -g -O2" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:959: checking for $ac_word" >&5 +echo "configure:1077: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -985,7 +1103,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:989: checking for $ac_word" >&5 +echo "configure:1107: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1036,7 +1154,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1040: checking for $ac_word" >&5 +echo "configure:1158: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1068,7 +1186,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1072: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1190: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1079,12 +1197,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1083 "configure" +#line 1201 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1110,12 +1228,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1114: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1232: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1119: checking whether we are using GNU C" >&5 +echo "configure:1237: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1124,7 +1242,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1143,7 +1261,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1147: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1265: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1186,7 +1304,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1190: checking for a BSD compatible install" >&5 +echo "configure:1308: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1239,12 +1357,12 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1243: checking for Cygwin environment" >&5 +echo "configure:1361: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1272,19 +1390,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1276: checking for mingw32 environment" >&5 +echo "configure:1394: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1301,7 +1419,7 @@ echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1305: checking how to run the C preprocessor" >&5 +echo "configure:1423: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1316,13 +1434,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1333,13 +1451,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1350,13 +1468,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1449,51 +1567,6 @@ else enable_fast_install=yes fi - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1460: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1481: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -1506,7 +1579,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1510: checking for ld used by GCC" >&5 +echo "configure:1583: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1536,10 +1609,10 @@ echo "configure:1510: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1540: checking for GNU ld" >&5 +echo "configure:1613: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1543: checking for non-GNU ld" >&5 +echo "configure:1616: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1574,7 +1647,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1578: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1651: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1591,7 +1664,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1595: checking for $LD option to reload object files" >&5 +echo "configure:1668: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1603,7 +1676,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1607: checking for BSD-compatible nm" >&5 +echo "configure:1680: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1641,7 +1714,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1645: checking whether ln -s works" >&5 +echo "configure:1718: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1662,7 +1735,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1666: checking how to recognise dependant libraries" >&5 +echo "configure:1739: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1835,13 +1908,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1839: checking for object suffix" >&5 +echo "configure:1912: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1861,7 +1934,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1865: checking for executable suffix" >&5 +echo "configure:1938: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1871,7 +1944,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1902,7 +1975,7 @@ fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 -echo "configure:1906: checking command to parse $NM output" >&5 +echo "configure:1979: checking command to parse $NM output" >&5 if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1978,10 +2051,10 @@ void nm_test_func(){} int main(){nm_test_var='a';nm_test_func();return(0);} EOF - if { (eval echo configure:1982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. nlist=conftest.nm - if { (eval echo configure:1985: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then + if { (eval echo configure:2058: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -2032,7 +2105,7 @@ EOF save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo configure:2036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" @@ -2078,17 +2151,17 @@ for ac_hdr in dlfcn.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2082: checking for $ac_hdr" >&5 +echo "configure:2155: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2123,7 +2196,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2127: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2200: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2185,7 +2258,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2189: checking for file" >&5 +echo "configure:2262: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2256,7 +2329,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2260: checking for $ac_word" >&5 +echo "configure:2333: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2288,7 +2361,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2292: checking for $ac_word" >&5 +echo "configure:2365: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2323,7 +2396,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2327: checking for $ac_word" >&5 +echo "configure:2400: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2355,7 +2428,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2359: checking for $ac_word" >&5 +echo "configure:2432: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2404,8 +2477,8 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2408 "configure"' > conftest.$ac_ext - if { (eval echo configure:2409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2481 "configure"' > conftest.$ac_ext + if { (eval echo configure:2482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2426,7 +2499,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2430: checking whether the C compiler needs -belf" >&5 +echo "configure:2503: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2439,14 +2512,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2559,7 +2632,7 @@ set dummy $CC compiler="$2" echo $ac_n "checking for objdir""... $ac_c" 1>&6 -echo "configure:2563: checking for objdir" >&5 +echo "configure:2636: checking for objdir" >&5 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -2586,7 +2659,7 @@ test -z "$pic_mode" && pic_mode=default # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:2590: checking for $compiler option to produce PIC" >&5 +echo "configure:2663: checking for $compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2738,21 +2811,21 @@ else # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 -echo "configure:2742: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 +echo "configure:2815: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* case $host_os in hpux9* | hpux10* | hpux11*) @@ -2804,7 +2877,7 @@ if test -n "$lt_cv_prog_cc_shlib"; then fi echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 -echo "configure:2808: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 +echo "configure:2881: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2812,14 +2885,14 @@ else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_prog_cc_static_works=yes else @@ -2846,7 +2919,7 @@ can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 -echo "configure:2850: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo "configure:2923: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2865,7 +2938,7 @@ chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:2869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:2942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -2894,7 +2967,7 @@ echo "$ac_t""$compiler_c_o" 1>&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6 -echo "configure:2898: checking if $compiler supports -c -o file.lo" >&5 +echo "configure:2971: checking if $compiler supports -c -o file.lo" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2903,14 +2976,14 @@ else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -2940,7 +3013,7 @@ hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 -echo "configure:2944: checking if we can lock with hard links" >&5 +echo "configure:3017: checking if we can lock with hard links" >&5 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no @@ -2959,20 +3032,20 @@ fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 -echo "configure:2963: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo "configure:3036: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -2999,7 +3072,7 @@ fi # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:3003: checking whether the linker ($LD) supports shared libraries" >&5 +echo "configure:3076: checking whether the linker ($LD) supports shared libraries" >&5 allow_undefined_flag= no_undefined_flag= @@ -3615,7 +3688,7 @@ test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 -echo "configure:3619: checking how to hardcode library paths into programs" >&5 +echo "configure:3692: checking how to hardcode library paths into programs" >&5 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then @@ -3643,7 +3716,7 @@ echo "$ac_t""$hardcode_action" 1>&6 striplib= old_striplib= echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 -echo "configure:3647: checking whether stripping libraries is possible" >&5 +echo "configure:3720: checking whether stripping libraries is possible" >&5 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" @@ -3657,7 +3730,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 -echo "configure:3661: checking dynamic linker characteristics" >&5 +echo "configure:3734: checking dynamic linker characteristics" >&5 library_names_spec= libname_spec='lib$name' soname_spec= @@ -4043,7 +4116,7 @@ test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 -echo "configure:4047: checking if libtool supports shared libraries" >&5 +echo "configure:4120: checking if libtool supports shared libraries" >&5 echo "$ac_t""$can_build_shared" 1>&6 if test "$hardcode_action" = relink; then @@ -4082,7 +4155,7 @@ else *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4086: checking for dlopen in -ldl" >&5 +echo "configure:4159: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4090,7 +4163,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4120,12 +4193,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4124: checking for dlopen" >&5 +echo "configure:4197: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4166,12 +4239,12 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "configure:4170: checking for shl_load" >&5 +echo "configure:4243: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else @@ -4212,7 +4285,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "configure:4216: checking for dlopen in -lsvld" >&5 +echo "configure:4289: checking for dlopen in -lsvld" >&5 ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4220,7 +4293,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsvld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4250,7 +4323,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:4254: checking for shl_load in -ldld" >&5 +echo "configure:4327: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4258,7 +4331,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4322,7 +4395,7 @@ fi LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4326: checking whether a program can dlopen itself" >&5 +echo "configure:4399: checking whether a program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4332,7 +4405,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4416,7 +4489,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4420: checking whether a statically linked program can dlopen itself" >&5 +echo "configure:4493: checking whether a statically linked program can dlopen itself" >&5 if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4426,7 +4499,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then + if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in @@ -4536,14 +4609,14 @@ if test "$enable_shared" = yes && test "$GCC" = yes; then # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 -echo "configure:4540: checking whether -lc should be explicitly linked in" >&5 +echo "configure:4613: checking whether -lc should be explicitly linked in" >&5 if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext - if { (eval echo configure:4547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:4620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext @@ -4556,7 +4629,7 @@ else libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= - if { (eval echo configure:4560: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } + if { (eval echo configure:4633: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then lt_cv_archive_cmds_need_lc=no else @@ -5281,6 +5354,21 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g @@ -5295,16 +5383,6 @@ s%@SET_MAKE@%$SET_MAKE%g s%@LD@%$LD%g s%@AR@%$AR%g s%@CC@%$CC%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g s%@LN_S@%$LN_S%g s%@OBJEXT@%$OBJEXT%g s%@EXEEXT@%$EXEEXT%g diff --git a/configure.in b/configure.in index cc27876c..f812c0c5 100644 --- a/configure.in +++ b/configure.in @@ -4,6 +4,11 @@ dnl dnl Process this file with autoconf to produce a configure script. dnl AC_INIT() + +dnl Guess host type. +AC_CANONICAL_SYSTEM +AC_CANONICAL_HOST + AM_INIT_AUTOMAKE(bluez-libs, 2.0) AC_PREFIX_DEFAULT(/usr) diff --git a/include/Makefile.am b/include/Makefile.am index dceb3447..53b05244 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,6 +4,8 @@ hdrdir = $(prefix)/include/bluetooth +EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h + install-data-local: $(mkinstalldirs) $(DESTDIR)$(hdrdir) $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) diff --git a/include/Makefile.in b/include/Makefile.in index 5a8de87a..78aa59f9 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -61,8 +61,12 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ AR = @AR@ AS = @AS@ CC = @CC@ @@ -81,6 +85,8 @@ STRIP = @STRIP@ VERSION = @VERSION@ hdrdir = $(prefix)/include/bluetooth + +EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DIST_COMMON = Makefile.am Makefile.in diff --git a/src/Makefile.in b/src/Makefile.in index 0335d393..d0a7b1ed 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -61,8 +61,12 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : +build_alias = @build_alias@ +build_triplet = @build@ host_alias = @host_alias@ host_triplet = @host@ +target_alias = @target_alias@ +target_triplet = @target@ AR = @AR@ AS = @AS@ CC = @CC@ -- cgit From bf19cd7953fbc8cc916b9514d8f11fc8557f0cec Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 17 May 2002 17:12:30 +0000 Subject: Add hci_devba function --- include/hci_lib.h | 1 + src/hci.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index ecf180be..02c56a1f 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -61,6 +61,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); +int hci_devba(int dev_id, bdaddr_t *ba); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); diff --git a/src/hci.c b/src/hci.c index 6af14864..426eb91e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -369,6 +369,22 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di) return err; } +int hci_devba(int dev_id, bdaddr_t *ba) +{ + struct hci_dev_info di; + + if (hci_devinfo(dev_id, &di)) + return -1; + + if (!hci_test_bit(HCI_UP, &di.flags)) { + errno = ENETDOWN; + return -1; + } + + bacpy(ba, &di.bdaddr); + return 0; +} + inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags) { struct hci_inquiry_req *ir; -- cgit From 468f117f4ce1090cec1cc1928676c449434eb9a3 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sat, 18 May 2002 00:30:02 +0000 Subject: SET_CONN_PTYPE defin fix. --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 4610ac00..d6946976 100644 --- a/include/hci.h +++ b/include/hci.h @@ -378,7 +378,7 @@ typedef struct { uint16_t handle; uint16_t pkt_type; } __attribute__ ((packed)) set_conn_ptype_cp; -#define SET_CONN_PKT_TYPE_CP_SIZE 4 +#define SET_CONN_PTYPE_CP_SIZE 4 #define OCF_AUTH_REQUESTED 0x0011 typedef struct { -- cgit From 4bbdd73f337a0e1f76597c93bb3bda99cea4a550 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 23 May 2002 20:26:01 +0000 Subject: Build env cleanup. Remove auto generated files from CVS. Working 'make distcheck'. --- Makefile.in | 348 ---- bootstrap | 2 + configure | 5505 --------------------------------------------------- include/Makefile.am | 8 +- include/Makefile.in | 200 -- src/Makefile.am | 2 +- src/Makefile.in | 358 ---- 7 files changed, 5 insertions(+), 6418 deletions(-) delete mode 100644 Makefile.in create mode 100755 bootstrap delete mode 100755 configure delete mode 100644 include/Makefile.in delete mode 100644 src/Makefile.in diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index c84d69ee..00000000 --- a/Makefile.in +++ /dev/null @@ -1,348 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# -# $Id$ -# - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_alias = @build_alias@ -build_triplet = @build@ -host_alias = @host_alias@ -host_triplet = @host@ -target_alias = @target_alias@ -target_triplet = @target@ -AR = @AR@ -AS = @AS@ -CC = @CC@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -EXEEXT = @EXEEXT@ -LD = @LD@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAKEINFO = @MAKEINFO@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -VERSION = @VERSION@ - -SUBDIRS = include src - -DISTCLEANFILES = conftest.c conftest - -EXTRA_DIST = ChangeLog -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = -DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ -Makefile.in NEWS aclocal.m4 config.guess config.sub configure \ -configure.in install-sh ltconfig ltmain.sh missing mkinstalldirs - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): configure.in - cd $(srcdir) && $(ACLOCAL) - -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) - cd $(srcdir) && $(AUTOCONF) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ - dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ - done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive -check-am: all-am -check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -install-exec-am: -install-exec: install-exec-recursive - -install-data-am: -install-data: install-data-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: -uninstall: uninstall-recursive -all-am: Makefile -all-redirect: all-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-tags mostlyclean-generic - -mostlyclean: mostlyclean-recursive - -clean-am: clean-tags clean-generic mostlyclean-am - -clean: clean-recursive - -distclean-am: distclean-tags distclean-generic clean-am - -rm -f libtool - -distclean: distclean-recursive - -rm -f config.status - -maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-recursive - -rm -f config.status - -.PHONY: install-data-recursive uninstall-data-recursive \ -install-exec-recursive uninstall-exec-recursive installdirs-recursive \ -uninstalldirs-recursive all-recursive check-recursive \ -installcheck-recursive info-recursive dvi-recursive \ -mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs-am \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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/bootstrap b/bootstrap new file mode 100755 index 00000000..019a160f --- /dev/null +++ b/bootstrap @@ -0,0 +1,2 @@ +#! /bin/sh +aclocal && automake --copy --add-missing && autoconf diff --git a/configure b/configure deleted file mode 100755 index 4e691e76..00000000 --- a/configure +++ /dev/null @@ -1,5505 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_default_prefix=/usr -ac_help="$ac_help - --enable-shared[=PKGS] build shared libraries [default=yes]" -ac_help="$ac_help - --enable-static[=PKGS] build static libraries [default=yes]" -ac_help="$ac_help - --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" -ac_help="$ac_help - --with-gnu-ld assume the C compiler uses GNU ld [default=no]" - -# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac -fi - - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` - ;; -esac - -echo=${ECHO-echo} -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" -fi - - -ac_help="$ac_help - --disable-libtool-lock avoid locking (might break parallel builds)" -ac_help="$ac_help - --with-pic try to use only PIC/non-PIC objects [default=use both]" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$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" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --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 -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file= - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -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 - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:744: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:765: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; -esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:783: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; -esac - -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:812: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - - -# 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 -# 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" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:845: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:898: checking whether build environment is sane" >&5 -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } - fi - - test "$2" = conftestfile - ) -then - # Ok. - : -else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed -fi -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" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:955: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -PACKAGE=bluez-libs - -VERSION=2.0 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } -fi -cat >> confdefs.h <> confdefs.h <&6 -echo "configure:1001: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 -else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1014: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 -else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1027: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 -else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1040: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 -fi - -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1053: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi - - - - - - - - -CFLAGS="-Wall -g -O2" - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1077: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1107: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_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 $# -gt 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 - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1158: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1190: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 1201 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1232: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1237: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1265: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 - -# 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 -# 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" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1308: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&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_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1361: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_cygwin" 1>&6 -CYGWIN= -test "$ac_cv_cygwin" = yes && CYGWIN=yes -echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1394: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1423: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1444: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1478: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -# Check whether --enable-shared or --disable-shared was given. -if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} -case $enableval in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_shared=yes -fi - -# Check whether --enable-static or --disable-static was given. -if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} -case $enableval in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_static=yes -fi - -# Check whether --enable-fast-install or --disable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} -case $enableval in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac -else - enable_fast_install=yes -fi - -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1583: checking for ld used by GCC" >&5 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1613: checking for GNU ld" >&5 -else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1616: checking for non-GNU ld" >&5 -fi -if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } -echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1651: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes -else - lt_cv_prog_gnu_ld=no -fi -fi - -echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 -with_gnu_ld=$lt_cv_prog_gnu_ld - - -echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1668: checking for $LD option to reload object files" >&5 -if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - lt_cv_ld_reload_flag='-r' -fi - -echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" - -echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1680: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" - break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" - break - else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi - -NM="$lt_cv_path_NM" -echo "$ac_t""$NM" 1>&6 - -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1718: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1739: checking how to recognise dependant libraries" >&5 -if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&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 egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* | pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.012) - lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - ;; - -freebsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[78]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - esac - ;; -esac - -fi - -echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method - -echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1912: checking for object suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftest* -echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; - *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; - esac - done -else - { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_objext" 1>&6 -OBJEXT=$ac_cv_objext -ac_objext=$ac_cv_objext - - - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1938: checking for executable suffix" >&5 -if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_exeext=.exe -else - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= - if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; - *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; - esac - done - else - { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } - fi - rm -f conftest* - test x"${ac_cv_exeext}" = x && ac_cv_exeext=no -fi -fi - -EXEEXT="" -test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} -echo "$ac_t""${ac_cv_exeext}" 1>&6 -ac_exeext=$EXEEXT - -if test $host != $build; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6 -echo "configure:1979: checking command to parse $NM output" >&5 -if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris* | sysv5*) - symcode='[BDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. -lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo configure:2058: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - pipe_works=yes - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" -if test -z "$lt_cv_sys_global_symbol_pipe"; then - global_symbol_to_cdecl= -else - global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" -fi -if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then - echo "$ac_t""failed" 1>&6 -else - echo "$ac_t""ok" 1>&6 -fi - -for ac_hdr in dlfcn.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2155: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - - - - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2200: checking for ${ac_tool_prefix}file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2262: checking for file" >&5 -if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="/usr/bin:$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2333: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_RANLIB"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2365: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" -fi -fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - RANLIB=":" -fi -fi - -# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2400: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -STRIP="$ac_cv_prog_STRIP" -if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -if test -z "$ac_cv_prog_STRIP"; then -if test -n "$ac_tool_prefix"; then - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2432: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_STRIP="strip" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" -fi -fi -STRIP="$ac_cv_prog_STRIP" -if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -else - STRIP=":" -fi -fi - - -enable_dlopen=no -enable_win32_dll=no - -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" - : -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 2481 "configure"' > conftest.$ac_ext - if { (eval echo configure:2482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2503: checking whether the C compiler needs -belf" >&5 -if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - lt_cv_cc_needs_belf=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_cc_needs_belf=no -fi -rm -f conftest* - ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -fi - -echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - - -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -need_locks="$enable_libtool_lock" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -echo $ac_n "checking for objdir""... $ac_c" 1>&6 -echo "configure:2636: checking for objdir" >&5 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$ac_t""$objdir" 1>&6 - - -# Check whether --with-pic or --without-pic was given. -if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" -else - pic_mode=default -fi - -test -z "$pic_mode" && pic_mode=default - -# We assume here that the value for lt_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:2663: checking for $compiler option to produce PIC" >&5 -if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - lt_cv_prog_cc_pic= - lt_cv_prog_cc_shlib= - lt_cv_prog_cc_wl= - lt_cv_prog_cc_static= - lt_cv_prog_cc_no_builtin= - lt_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$GCC" = yes; then - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - lt_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix3* | aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better lt_cv_prog_cc_static that works with the bundled CC? - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" - lt_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - lt_cv_prog_cc_pic='-Kpic' - lt_cv_prog_cc_static='-dn' - lt_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - lt_cv_prog_cc_pic='-PIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' - else - lt_cv_prog_cc_wl='-Wl,' - fi - ;; - - uts4*) - lt_cv_prog_cc_pic='-pic' - lt_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_cv_prog_cc_pic='-Kconform_pic' - lt_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - lt_cv_prog_cc_can_build_shared=no - ;; - esac - fi - -fi - -if test -z "$lt_cv_prog_cc_pic"; then - echo "$ac_t""none" 1>&6 -else - echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 -echo "configure:2815: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 - if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - lt_cv_prog_cc_pic_works=no - else - lt_cv_prog_cc_pic_works=yes - fi - ;; - *) - lt_cv_prog_cc_pic_works=yes - ;; - esac - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_prog_cc_pic_works=no - -fi -rm -f conftest* - CFLAGS="$save_CFLAGS" - -fi - - - if test "X$lt_cv_prog_cc_pic_works" = Xno; then - lt_cv_prog_cc_pic= - lt_cv_prog_cc_can_build_shared=no - else - lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" - fi - - echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6 -fi - -# Check for any special shared library compilation flags. -if test -n "$lt_cv_prog_cc_shlib"; then - echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : - else - echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 - lt_cv_prog_cc_can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 -echo "configure:2881: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 -if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - lt_cv_prog_cc_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - lt_cv_prog_cc_static_works=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - LDFLAGS="$save_LDFLAGS" - -fi - - -# Belt *and* braces to stop my trousers falling down: -test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= -echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6 - -pic_flag="$lt_cv_prog_cc_pic" -special_shlib_compile_flags="$lt_cv_prog_cc_shlib" -wl="$lt_cv_prog_cc_wl" -link_static_flag="$lt_cv_prog_cc_static" -no_builtin_flag="$lt_cv_prog_cc_no_builtin" -can_build_shared="$lt_cv_prog_cc_can_build_shared" - - -# Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 -echo "configure:2923: checking if $compiler supports -c -o file.$ac_objext" >&5 -if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -echo "int some_variable = 0;" > conftest.$ac_ext -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" -compiler_c_o=no -if { (eval echo configure:2942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - lt_cv_compiler_c_o=no -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null - -fi - -compiler_c_o=$lt_cv_compiler_c_o -echo "$ac_t""$compiler_c_o" 1>&6 - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6 -echo "configure:2971: checking if $compiler supports -c -o file.lo" >&5 - if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - lt_cv_compiler_o_lo=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - lt_cv_compiler_o_lo=no - else - lt_cv_compiler_o_lo=yes - fi - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - CFLAGS="$save_CFLAGS" - -fi - - compiler_o_lo=$lt_cv_compiler_o_lo - echo "$ac_t""$compiler_o_lo" 1>&6 -else - compiler_o_lo=no -fi - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6 -echo "configure:3017: checking if we can lock with hard links" >&5 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$ac_t""$hard_links" 1>&6 - if test "$hard_links" = no; then - echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$GCC" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6 -echo "configure:3036: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - echo "int some_variable = 0;" > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - compiler_rtti_exceptions=no - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - compiler_rtti_exceptions=no - else - compiler_rtti_exceptions=yes - fi - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* - CFLAGS="$save_CFLAGS" - echo "$ac_t""$compiler_rtti_exceptions" 1>&6 - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi -fi - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 -echo "configure:3076: checking whether the linker ($LD) supports shared libraries" >&5 - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -case $host_os in -cygwin* | mingw* | pw32* ) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \$# in - 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - # 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_libdir_separator=':' - if test "$GCC" = yes; then - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - shared_flag='-shared' - else - if test "$host_cpu" = ia64; then - shared_flag='-G' - else - shared_flag='${wl}-bM:SRE' - fi - hardcode_direct=yes - fi - - 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 - # 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 run time linking. - aix_use_runtimelinking=no - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then - aix_use_runtimelinking=yes - break - fi - done - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # It seems that -bexpall can do strange things, so it is better to - # generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - allow_undefined_flag=' -Wl,-G' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-znodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, -berok will - # link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - darwin* | rhapsody*) - allow_undefined_flag='-undefined suppress' - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - #Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z defs' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - if test "x$host_vendor" = xsno; then - archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes # is this really true??? - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -echo "$ac_t""$ld_shlibs" 1>&6 -test "$ld_shlibs" = no && can_build_shared=no - -# Check hardcoding attributes. -echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 -echo "configure:3692: checking how to hardcode library paths into programs" >&5 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$ac_t""$hardcode_action" 1>&6 - -striplib= -old_striplib= -echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 -echo "configure:3720: checking whether stripping libraries is possible" >&5 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -# PORTME Fill in your ld.so characteristics -echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 -echo "configure:3734: checking dynamic linker characteristics" >&5 -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so instead of - # lib.a to let people know that these are not typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' - ;; - *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$ac_t""$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# Report the final consequences. -echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 -echo "configure:4120: checking if libtool supports shared libraries" >&5 -echo "$ac_t""$can_build_shared" 1>&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - cygwin* | mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - *) - echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4159: checking for dlopen in -ldl" >&5 -ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4197: checking for dlopen" >&5 -if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_dlopen=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_dlopen=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "configure:4243: checking for shl_load" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -shl_load(); -#endif - -; return 0; } -EOF -if { (eval echo configure:4271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shl_load=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shl_load=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "configure:4289: checking for dlopen in -lsvld" >&5 -ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsvld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:4327: checking for shl_load in -ldld" >&5 -ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4399: checking whether a program can dlopen itself" >&5 -if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo configure:4470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi - -echo "$ac_t""$lt_cv_dlopen_self" 1>&6 - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "configure:4493: checking whether a statically linked program can dlopen itself" >&5 -if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo configure:4564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi - -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&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 - - -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 -echo "configure:4613: checking whether -lc should be explicitly linked in" >&5 - if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - $rm conftest* - echo 'static int dummy;' > conftest.$ac_ext - - if { (eval echo configure:4620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo configure:4633: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi -fi - - echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6 - ;; - esac -fi -need_lc=${lt_cv_archive_cmds_need_lc-yes} - -# The second clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - : -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - test -f Makefile && make "$ltmain" -fi - -if test -f "$ltmain"; then - trap "$rm \"${ofile}T\"; exit 1" 1 2 15 - $rm -f "${ofile}T" - - echo creating $ofile - - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS \ - AR AR_FLAGS CC LD LN_S NM SHELL \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - cat <<__EOF__ > "${ofile}T" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# The default C compiler. -CC=$lt_CC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_pic_flag -pic_mode=$pic_mode - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$lt_compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# ### END LIBTOOL CONFIG - -__EOF__ - - case $host_os in - aix3*) - cat <<\EOF >> "${ofile}T" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - case $host_os in - cygwin* | mingw* | pw32* | os2*) - cat <<'EOF' >> "${ofile}T" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) - - mv -f "${ofile}T" "$ofile" || \ - (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") - chmod +x "$ofile" -fi - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - -#AC_CHECK_TOOL(LD, ld, ld) -#AC_CHECK_TOOL(AR, ar, ar) - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile include/Makefile src/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@LD@%$LD%g -s%@AR@%$AR%g -s%@CC@%$CC%g -s%@LN_S@%$LN_S%g -s%@OBJEXT@%$OBJEXT%g -s%@EXEEXT@%$EXEEXT%g -s%@ECHO@%$ECHO%g -s%@RANLIB@%$RANLIB%g -s%@STRIP@%$STRIP%g -s%@CPP@%$CPP%g -s%@LIBTOOL@%$LIBTOOL%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - diff --git a/include/Makefile.am b/include/Makefile.am index 53b05244..f4a9f308 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -2,10 +2,6 @@ # $Id$ # -hdrdir = $(prefix)/include/bluetooth +includedir = @includedir@/bluetooth -EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(hdrdir) - $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h diff --git a/include/Makefile.in b/include/Makefile.in deleted file mode 100644 index 78aa59f9..00000000 --- a/include/Makefile.in +++ /dev/null @@ -1,200 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# -# $Id$ -# - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_alias = @build_alias@ -build_triplet = @build@ -host_alias = @host_alias@ -host_triplet = @host@ -target_alias = @target_alias@ -target_triplet = @target@ -AR = @AR@ -AS = @AS@ -CC = @CC@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -EXEEXT = @EXEEXT@ -LD = @LD@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAKEINFO = @MAKEINFO@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -VERSION = @VERSION@ - -hdrdir = $(prefix)/include/bluetooth - -EXTRA_DIST = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect -.SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = include - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: install-data-local -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-generic clean-am - -rm -f libtool - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: tags distdir info-am info dvi-am dvi check check-am \ -installcheck-am installcheck install-exec-am install-exec \ -install-data-local install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(hdrdir) - $(INSTALL) -m 644 $(srcdir)/*.h $(DESTDIR)$(hdrdir) - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/Makefile.am b/src/Makefile.am index 22dd8aac..6359a2b0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,4 +7,4 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c libbluetooth_la_LDFLAGS = -version-info 1:0:0 -INCLUDES = -I../include +INCLUDES = -I$(top_srcdir)/include diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index d0a7b1ed..00000000 --- a/src/Makefile.in +++ /dev/null @@ -1,358 +0,0 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# -# $Id$ -# - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_alias = @build_alias@ -build_triplet = @build@ -host_alias = @host_alias@ -host_triplet = @host@ -target_alias = @target_alias@ -target_triplet = @target@ -AR = @AR@ -AS = @AS@ -CC = @CC@ -DLLTOOL = @DLLTOOL@ -ECHO = @ECHO@ -EXEEXT = @EXEEXT@ -LD = @LD@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAKEINFO = @MAKEINFO@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -VERSION = @VERSION@ - -lib_LTLIBRARIES = libbluetooth.la - -libbluetooth_la_SOURCES = bluetooth.c hci.c -libbluetooth_la_LDFLAGS = -version-info 1:0:0 - -INCLUDES = -I../include -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(lib_LTLIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libbluetooth_la_LIBADD = -libbluetooth_la_OBJECTS = bluetooth.lo hci.lo -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -DEP_FILES = .deps/bluetooth.P .deps/hci.P -SOURCES = $(libbluetooth_la_SOURCES) -OBJECTS = $(libbluetooth_la_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .lo .o .obj .s -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-libLTLIBRARIES: - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - -distclean-libLTLIBRARIES: - -maintainer-clean-libLTLIBRARIES: - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -# FIXME: We should only use cygpath when building on Windows, -# and only if it is available. -.c.obj: - $(COMPILE) -c `cygpath -w $<` - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -rm -f *.$(OBJEXT) - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -.s.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.S.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -maintainer-clean-libtool: - -libbluetooth.la: $(libbluetooth_la_OBJECTS) $(libbluetooth_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libbluetooth_la_LDFLAGS) $(libbluetooth_la_OBJECTS) $(libbluetooth_la_LIBADD) $(LIBS) - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = src - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - -DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) - --include $(DEP_FILES) - -mostlyclean-depend: - -clean-depend: - -distclean-depend: - -rm -rf .deps - -maintainer-clean-depend: - -%.o: %.c - @echo '$(COMPILE) -c $<'; \ - $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - -%.lo: %.c - @echo '$(LTCOMPILE) -c $<'; \ - $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: install-libLTLIBRARIES -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-libLTLIBRARIES -uninstall: uninstall-am -all-am: Makefile $(LTLIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) - - -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ - mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ - mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ - clean-depend clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-libLTLIBRARIES distclean-compile \ - distclean-libtool distclean-tags distclean-depend \ - distclean-generic clean-am - -rm -f libtool - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-tags maintainer-clean-depend \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ -clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ -uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ -distclean-compile clean-compile maintainer-clean-compile \ -mostlyclean-libtool distclean-libtool clean-libtool \ -maintainer-clean-libtool tags mostlyclean-tags distclean-tags \ -clean-tags maintainer-clean-tags distdir mostlyclean-depend \ -distclean-depend clean-depend maintainer-clean-depend info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -# 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: -- cgit From 9bf1d0ca2ad3beefb98c8f1a08c8188dfaedf579 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 27 May 2002 02:25:33 +0000 Subject: Libtoolize and fix top level build. Make cleanup. --- Makefile.am | 2 +- include/Makefile.am | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index d00fd392..bc2d6cb2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ # $Id$ # -SUBDIRS = include src +SUBDIRS := include src DISTCLEANFILES = conftest.c conftest diff --git a/include/Makefile.am b/include/Makefile.am index f4a9f308..794a4c55 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,3 +5,10 @@ includedir = @includedir@/bluetooth include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h + +bluetooth: + ln -s . bluetooth + +all-local: bluetooth +clean-local: + rm -f bluetooth -- cgit From 00b68045e890dccbf09bed06727f0453daa27b90 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 4 Jun 2002 00:13:33 +0000 Subject: Additional comp ids --- src/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 622464f8..6c09c4d9 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -256,6 +256,10 @@ char *bt_compidtostr(int compid) return "Hitachi Ltd"; case 42: return "Symbol Technologies, Inc."; + case 43: + return "Tenovis"; + case 44: + return "Macronix International Co. Ltd."; case 65535: return "internal use"; default: -- cgit From 5c3b76c8f08b4cb37ef417aaad1dd6c36068786f Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 6 Jun 2002 22:23:20 +0000 Subject: AC_PROG_LIBTOOL -> AM_PROG_LIBTOOL --- aclocal.m4 | 3274 ++++------------------------------------------------------ configure.in | 2 +- 2 files changed, 183 insertions(+), 3093 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index d5ac3659..b0b7b5b1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 +dnl aclocal.m4 generated automatically by aclocal 1.4 -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,7 +19,7 @@ dnl PARTICULAR PURPOSE. dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) -AC_DEFUN([AM_INIT_AUTOMAKE], +AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) @@ -47,7 +47,7 @@ AC_REQUIRE([AC_PROG_MAKE_SET])]) # Check to make sure that the build environment is sane. # -AC_DEFUN([AM_SANITY_CHECK], +AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 @@ -88,7 +88,7 @@ AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], +AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. @@ -102,2767 +102,140 @@ else fi AC_SUBST($1)]) -# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -# serial 46 AC_PROG_LIBTOOL -AC_DEFUN([AC_PROG_LIBTOOL], +# serial 40 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -]) - -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -_LT_AC_PROG_ECHO_BACKSLASH -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, - [AC_TRY_LINK([], - [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0);], - [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) - - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, - [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain@16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac - ;; - ]) -esac - -_LT_AC_LTCONFIG_HACK - -]) - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN(_LT_AC_CHECK_DLFCN, -[AC_CHECK_HEADERS(dlfcn.h) -])# _LT_AC_CHECK_DLFCN - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -[symcode='[BCDEGRST]'] - -# Regexp to match symbols that can be accessed directly from C. -[sympat='\([_A-Za-z][_A-Za-z0-9]*\)'] - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case $host_os in -aix*) - [symcode='[BCDT]'] - ;; -cygwin* | mingw* | pw32*) - [symcode='[ABCDGISTW]'] - ;; -hpux*) # Its linker distinguishes data from code symbols - lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - [symcode='[BCDEGRST]'] - ;; -solaris* | sysv5*) - [symcode='[BDT]'] - ;; -sysv4) - [symcode='[DFNSTU]'] - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - [symcode='[ABCDGISTW]'] -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. -[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"] - - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -[lt_preloaded_symbols[] =] -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if AC_TRY_EVAL(ac_link) && test -s conftest; then - pipe_works=yes - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AC_FD_CC - fi - else - echo "cannot find nm_test_var in $nlist" >&AC_FD_CC - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi - else - echo "$progname: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" -if test -z "$lt_cv_sys_global_symbol_pipe"; then - global_symbol_to_cdecl= -else - global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" -fi -if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - -# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -# --------------------------------- -AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], -[# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac -fi -])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn;t interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -AC_DIVERT_POP -])# _LT_AC_PROG_ECHO_BACKSLASH - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF, -[if test "$cross_compiling" = yes; then : - [$4] -else - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF, -[if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - cygwin* | mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - *) - AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen", - [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load", - [AC_CHECK_LIB(svld, dlopen, - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB(dld, shl_load, - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - -AC_DEFUN([_LT_AC_LTCONFIG_HACK], -[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -need_locks="$enable_libtool_lock" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="[$]2" - -AC_MSG_CHECKING([for objdir]) -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -AC_MSG_RESULT($objdir) - - -AC_ARG_WITH(pic, -[ --with-pic try to use only PIC/non-PIC objects [default=use both]], -pic_mode="$withval", pic_mode=default) -test -z "$pic_mode" && pic_mode=default - -# We assume here that the value for lt_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -AC_MSG_CHECKING([for $compiler option to produce PIC]) -AC_CACHE_VAL(lt_cv_prog_cc_pic, -[ lt_cv_prog_cc_pic= - lt_cv_prog_cc_shlib= - lt_cv_prog_cc_wl= - lt_cv_prog_cc_static= - lt_cv_prog_cc_no_builtin= - lt_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$GCC" = yes; then - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # we not sure about C++ programs. - lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - lt_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix3* | aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better lt_cv_prog_cc_static that works with the bundled CC? - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" - lt_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - lt_cv_prog_cc_pic='-Kpic' - lt_cv_prog_cc_static='-dn' - lt_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - lt_cv_prog_cc_pic='-PIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' - else - lt_cv_prog_cc_wl='-Wl,' - fi - ;; - - uts4*) - lt_cv_prog_cc_pic='-pic' - lt_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_cv_prog_cc_pic='-Kconform_pic' - lt_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - lt_cv_prog_cc_can_build_shared=no - ;; - esac - fi -]) -if test -z "$lt_cv_prog_cc_pic"; then - AC_MSG_RESULT([none]) -else - AC_MSG_RESULT([$lt_cv_prog_cc_pic]) - - # Check to make sure the pic_flag actually works. - AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) - AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" - AC_TRY_COMPILE([], [], [dnl - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - lt_cv_prog_cc_pic_works=no - else - lt_cv_prog_cc_pic_works=yes - fi - ;; - *) - lt_cv_prog_cc_pic_works=yes - ;; - esac - ], [dnl - lt_cv_prog_cc_pic_works=no - ]) - CFLAGS="$save_CFLAGS" - ]) - - if test "X$lt_cv_prog_cc_pic_works" = Xno; then - lt_cv_prog_cc_pic= - lt_cv_prog_cc_can_build_shared=no - else - lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" - fi - - AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) -fi - -# Check for any special shared library compilation flags. -if test -n "$lt_cv_prog_cc_shlib"; then - AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | [egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]"] >/dev/null; then : - else - AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) - lt_cv_prog_cc_can_build_shared=no - fi -fi - -AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) -AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl - lt_cv_prog_cc_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" - AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) - LDFLAGS="$save_LDFLAGS" -]) - -# Belt *and* braces to stop my trousers falling down: -test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= -AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) - -pic_flag="$lt_cv_prog_cc_pic" -special_shlib_compile_flags="$lt_cv_prog_cc_shlib" -wl="$lt_cv_prog_cc_wl" -link_static_flag="$lt_cv_prog_cc_static" -no_builtin_flag="$lt_cv_prog_cc_no_builtin" -can_build_shared="$lt_cv_prog_cc_can_build_shared" - - -# Check to see if options -o and -c are simultaneously supported by compiler -AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) -AC_CACHE_VAL([lt_cv_compiler_c_o], [ -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -echo "int some_variable = 0;" > conftest.$ac_ext -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" -compiler_c_o=no -if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&AC_FD_CC - lt_cv_compiler_c_o=no -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null -]) -compiler_c_o=$lt_cv_compiler_c_o -AC_MSG_RESULT([$compiler_c_o]) - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) - AC_CACHE_VAL([lt_cv_compiler_o_lo], [ - lt_cv_compiler_o_lo=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - lt_cv_compiler_o_lo=no - else - lt_cv_compiler_o_lo=yes - fi - ]) - CFLAGS="$save_CFLAGS" - ]) - compiler_o_lo=$lt_cv_compiler_o_lo - AC_MSG_RESULT([$compiler_o_lo]) -else - compiler_o_lo=no -fi - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi - -if test "$GCC" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) - echo "int some_variable = 0;" > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - compiler_rtti_exceptions=no - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - compiler_rtti_exceptions=no - else - compiler_rtti_exceptions=yes - fi - ]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT([$compiler_rtti_exceptions]) - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi -fi - -# See if the linker supports building shared libraries. -AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -case $host_os in -cygwin* | mingw* | pw32* ) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - # 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_libdir_separator=':' - if test "$GCC" = yes; then - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - shared_flag='-shared' - else - if test "$host_cpu" = ia64; then - shared_flag='-G' - else - shared_flag='${wl}-bM:SRE' - fi - hardcode_direct=yes - fi - - 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 - # 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 run time linking. - aix_use_runtimelinking=no - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then - aix_use_runtimelinking=yes - break - fi - done - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # It seems that -bexpall can do strange things, so it is better to - # generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - allow_undefined_flag=' -Wl,-G' - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-znodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, -berok will - # link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - darwin* | rhapsody*) - allow_undefined_flag='-undefined suppress' - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - #Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - - solaris*) - no_undefined_flag=' -z defs' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - [solaris2.[0-5] | solaris2.[0-5].*]) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - if test "x$host_vendor" = xsno; then - archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts' - hardcode_direct=yes # is this really true??? - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -AC_MSG_RESULT([$ld_shlibs]) -test "$ld_shlibs" = no && can_build_shared=no - -# Check hardcoding attributes. -AC_MSG_CHECKING([how to hardcode library paths into programs]) -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -AC_MSG_RESULT([$hardcode_action]) - -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -# PORTME Fill in your ld.so characteristics -AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - [ aix4 | aix4.[01] | aix4.[01].*)] - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so instead of - # lib.a to let people know that these are not typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | [$Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\'']`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - ;; - *) - library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -# Report the final consequences. -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -AC_LIBTOOL_DLOPEN_SELF - -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], - [$rm conftest* - echo 'static int dummy;' > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile); then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi]) - AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) - ;; - esac -fi -need_lc=${lt_cv_archive_cmds_need_lc-yes} - -# The second clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - : -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - test -f Makefile && make "$ltmain" -fi - -if test -f "$ltmain"; then - trap "$rm \"${ofile}T\"; exit 1" 1 2 15 - $rm -f "${ofile}T" - - echo creating $ofile - - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS \ - AR AR_FLAGS CC LD LN_S NM SHELL \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - cat <<__EOF__ > "${ofile}T" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# The default C compiler. -CC=$lt_CC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_pic_flag -pic_mode=$pic_mode - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$lt_compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| AC_MSG_ERROR([libtool configure failed]) -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" -# ### END LIBTOOL CONFIG +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl -__EOF__ +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) - case $host_os in - aix3*) - cat <<\EOF >> "${ofile}T" +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_RANLIB])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +dnl -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac - case $host_os in - cygwin* | mingw* | pw32* | os2*) - cat <<'EOF' >> "${ofile}T" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; +# Check for any special flags to pass to ltconfig. # -# filename = argv[1]; +# the following will cause an existing older ltconfig to fail, so +# we ignore this at the expense of the cache file... Checking this +# will just take longer ... bummer! +#libtool_flags="--cache-file=$cache_file" # -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; - mv -f "${ofile}T" "$ofile" || \ - (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") - chmod +x "$ofile" -fi +*-*-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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) + 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 + ;; -])# _LT_AC_LTCONFIG_HACK +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +]) +esac +]) # AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -2881,22 +254,21 @@ enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -2915,8 +287,7 @@ enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) @@ -2924,14 +295,14 @@ AC_ENABLE_STATIC(no)]) # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -2949,98 +320,12 @@ esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) -# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) -# AC_LIBTOOL_PICMODE - implement the --with-pic flag -# Usage: AC_LIBTOOL_PICMODE[(MODE)] -# Where MODE is either `yes' or `no'. If omitted, it defaults to -# `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default)]) - - -# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -]) - - -# AC_PATH_MAGIC - find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl -AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) - else - MAGIC_CMD=: - fi -fi -]) - - # AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], +AC_DEFUN(AC_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) @@ -3048,20 +333,16 @@ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld -if test "$GCC" = yes; then +if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do @@ -3083,17 +364,17 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(lt_cv_path_LD, +AC_CACHE_VAL(ac_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -3102,9 +383,9 @@ AC_CACHE_VAL(lt_cv_path_LD, done IFS="$ac_save_ifs" else - lt_cv_path_LD="$LD" # Let the user override the test with a path. + ac_cv_path_LD="$LD" # Let the user override the test with a path. fi]) -LD="$lt_cv_path_LD" +LD="$ac_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else @@ -3114,241 +395,56 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) -# AC_PROG_LD_GNU - -AC_DEFUN([AC_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then - lt_cv_prog_gnu_ld=yes + ac_cv_prog_gnu_ld=yes else - lt_cv_prog_gnu_ld=no + ac_cv_prog_gnu_ld=no fi]) -with_gnu_ld=$lt_cv_prog_gnu_ld -]) - -# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, -[lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" -]) - -# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise dependant libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# ['file_magic [regex]'] -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'] - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* | pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.[012]) - lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - ;; - -freebsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - [lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'] - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'] - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"] - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;] - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'] - else - [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'] - fi - ;; - -newos6*) - [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'] - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -[sysv5uw[78]* | sysv4*uw2*)] - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'] - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - [lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"] - lt_cv_file_magic_test_file=/lib/libc.so - ;; - esac - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method ]) - # AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], +AC_DEFUN(AC_PROG_NM, [AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(lt_cv_path_NM, +AC_CACHE_VAL(ac_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + ac_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" break else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm fi]) -NM="$lt_cv_path_NM" +NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library -AC_DEFUN([AC_CHECK_LIBM], +AC_DEFUN(AC_CHECK_LIBM, [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32*) +case "$lt_target" in +*-*-beos* | *-*-cygwin*) # These system don't have libm ;; *-ncr-sysv4.3*) @@ -3362,39 +458,33 @@ esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-convenience to the -# configure arguments. Note that LIBLTDL and INCLTDL are not -# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not -# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed -# with '${top_builddir}/' and INCLTDL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in +# the libltdl convenience library, adds --enable-ltdl-convenience to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-install to the configure -# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is -# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed -# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed -# with '${top_srcdir}/' (note the single quotes!). If your package is -# not flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. +# the libltdl installable library, and adds --enable-ltdl-install to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then @@ -3405,8 +495,8 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE], ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" @@ -3414,15 +504,15 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE], fi ]) -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl diff --git a/configure.in b/configure.in index f812c0c5..eb8e5c1b 100644 --- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ CFLAGS="-Wall -g -O2" AC_PROG_CC AC_PROG_INSTALL -AC_PROG_LIBTOOL +AM_PROG_LIBTOOL #AC_CHECK_TOOL(LD, ld, ld) #AC_CHECK_TOOL(AR, ar, ar) -- cgit From 4837bd7e9ba55361aeca45610a160dd107d5be2f Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 16:46:54 +0000 Subject: Fix inquiry function to return errors and accept user buffers. New functions hci_for_each_dev and hci_get_route. --- include/hci_lib.h | 5 ++- src/hci.c | 116 +++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 92 insertions(+), 29 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 02c56a1f..7fd95cfc 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -59,7 +59,7 @@ int hci_send_req(int dd, struct hci_request *req, int timeout); int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); -inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags); +int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); @@ -70,6 +70,9 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_class_of_dev(int dd, uint8_t *class, int to); +int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); +int hci_get_route(bdaddr_t *bdaddr); + char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); diff --git a/src/hci.c b/src/hci.c index 426eb91e..bc645686 100644 --- a/src/hci.c +++ b/src/hci.c @@ -354,6 +354,59 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) /* HCI functions that do not require open device */ +int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg) +{ + struct hci_dev_list_req *dl; + struct hci_dev_req *dr; + int dev_id = -1; + int s, i; + + s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (s < 0) + return -1; + + dl = malloc(HCI_MAX_DEV * sizeof(struct hci_dev_req) + sizeof(uint16_t)); + if (!dl) { + close(s); + return -1; + } + + dl->dev_num = HCI_MAX_DEV; + dr = dl->dev_req; + + if (ioctl(s, HCIGETDEVLIST, (void *)dl)) + goto done; + + for (i=0; i < dl->dev_num; i++, dr++) { + if (hci_test_bit(flag, &dr->dev_opt)) + if (!func || func(s, dr->dev_id, arg)) { + dev_id = dr->dev_id; + break; + } + } + +done: + close(s); + free(dl); + return dev_id; +} + +static int __other_bdaddr(int s, int dev_id, long arg) +{ + struct hci_dev_info di = {dev_id: dev_id}; + if (ioctl(s, HCIGETDEVINFO, (void*) &di)) + return 0; + return bacmp((bdaddr_t *)arg, &di.bdaddr); +} + +int hci_get_route(bdaddr_t *bdaddr) +{ + if (bdaddr) + return hci_for_each_dev(HCI_UP, __other_bdaddr, (long) bdaddr); + else + return hci_for_each_dev(HCI_UP, NULL, 0); +} + int hci_devinfo(int dev_id, struct hci_dev_info *di) { int s, err; @@ -385,22 +438,33 @@ int hci_devba(int dev_id, bdaddr_t *ba) return 0; } -inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long flags) +int hci_inquiry(int dev_id, int len, int nrsp, uint8_t *lap, inquiry_info **ii, long flags) { struct hci_inquiry_req *ir; - char *buf, *ptr; - int s, err, size; + void *buf; + int s, err; - if (!*num_rsp) - *num_rsp = 200; // enough ? + if (nrsp <= 0) + nrsp = 200; // enough ? - size = sizeof(*ir) + (sizeof(inquiry_info) * (*num_rsp)); - if (!(buf = malloc(size))) - return NULL; + if (dev_id < 0 && (dev_id = hci_get_route(NULL)) < 0) { + errno = ENODEV; + return -1; + } + + s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (s < 0) + return -1; + + buf = malloc(sizeof(*ir) + (sizeof(inquiry_info) * (nrsp))); + if (!buf) { + close(s); + return -1; + } - ir = (void *)buf; + ir = buf; ir->dev_id = dev_id; - ir->num_rsp = *num_rsp; + ir->num_rsp = nrsp; ir->length = len; ir->flags = flags; @@ -412,28 +476,23 @@ inquiry_info *hci_inquiry(int dev_id, int len, int *num_rsp, uint8_t *lap, long ir->lap[2] = 0x9e; } - if ((s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI)) < 0) - goto failed; - if (ioctl(s, HCIINQUIRY, (unsigned long)buf) < 0) - goto failed; - - size = sizeof(inquiry_info) * ir->num_rsp; - if (!(ptr = malloc(size))) - goto failed; + err = ioctl(s, HCIINQUIRY, (unsigned long) buf); + close(s); - memcpy(ptr, buf + sizeof(*ir), size); - *num_rsp = ir->num_rsp; + if (!err) { + int size = sizeof(inquiry_info) * ir->num_rsp; - free(buf); - close(s); - return (void *) ptr; + if (!*ii) + *ii = (void *) malloc(size); -failed: - err = errno; + if (*ii) { + memcpy((void *) *ii, buf + sizeof(*ir), size); + err = ir->num_rsp; + } else + err = -1; + } free(buf); - close(s); - errno = err; - return NULL; + return err; } /* Open HCI device. @@ -838,3 +897,4 @@ int hci_class_of_dev(int dd, uint8_t *class, int to) memcpy(class, rp.dev_class, 3); return 0; } + -- cgit From d316a5fbab4a41ce3f8321eef407db9c53b57e85 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 18:15:13 +0000 Subject: Added hci_devid function. --- include/hci_lib.h | 1 + src/hci.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 7fd95cfc..982c7608 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -62,6 +62,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); +int hci_devid(bdaddr_t *ba); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); diff --git a/src/hci.c b/src/hci.c index bc645686..f72ef760 100644 --- a/src/hci.c +++ b/src/hci.c @@ -399,6 +399,14 @@ static int __other_bdaddr(int s, int dev_id, long arg) return bacmp((bdaddr_t *)arg, &di.bdaddr); } +static int __same_bdaddr(int s, int dev_id, long arg) +{ + struct hci_dev_info di = {dev_id: dev_id}; + if (ioctl(s, HCIGETDEVINFO, (void*) &di)) + return 0; + return !bacmp((bdaddr_t *)arg, &di.bdaddr); +} + int hci_get_route(bdaddr_t *bdaddr) { if (bdaddr) @@ -407,6 +415,11 @@ int hci_get_route(bdaddr_t *bdaddr) return hci_for_each_dev(HCI_UP, NULL, 0); } +int hci_devid(bdaddr_t *bdaddr) +{ + return hci_for_each_dev(HCI_UP, __same_bdaddr, (long) bdaddr); +} + int hci_devinfo(int dev_id, struct hci_dev_info *di) { int s, err; -- cgit From 9942261d0febb9ef243ffe810421451e97925e68 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 18:32:44 +0000 Subject: improved hci_devid --- include/hci_lib.h | 2 +- src/hci.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 982c7608..b988de5f 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -62,7 +62,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); -int hci_devid(bdaddr_t *ba); +int hci_devid(char *str); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); diff --git a/src/hci.c b/src/hci.c index f72ef760..c0be8df2 100644 --- a/src/hci.c +++ b/src/hci.c @@ -415,9 +415,20 @@ int hci_get_route(bdaddr_t *bdaddr) return hci_for_each_dev(HCI_UP, NULL, 0); } -int hci_devid(bdaddr_t *bdaddr) +int hci_devid(char *str) { - return hci_for_each_dev(HCI_UP, __same_bdaddr, (long) bdaddr); + bdaddr_t ba; + int id = -1; + + if (!strncmp(str, "hci", 3) && strlen(str) >= 4) { + id = atoi(str + 3); + if (hci_devba(id, &ba) < 0) + return -1; + } else { + str2ba(str, &ba); + id = hci_for_each_dev(HCI_UP, __same_bdaddr, (long) &ba); + } + return id; } int hci_devinfo(int dev_id, struct hci_dev_info *di) -- cgit From e549aca0820bd58dc7b714f365ff0c46a941dc65 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 18:48:36 +0000 Subject: Return correct error if adds was not found. --- src/hci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hci.c b/src/hci.c index c0be8df2..1424ddcd 100644 --- a/src/hci.c +++ b/src/hci.c @@ -425,6 +425,7 @@ int hci_devid(char *str) if (hci_devba(id, &ba) < 0) return -1; } else { + errno = ENODEV; str2ba(str, &ba); id = hci_for_each_dev(HCI_UP, __same_bdaddr, (long) &ba); } -- cgit From dbeb655cea31a48a9cadaefd36ad85c1cfb3e556 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 18 Jun 2002 20:31:21 +0000 Subject: Bump version number and update. --- ChangeLog | 6 ++++++ configure.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fa80fe14..31c43155 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 2.0-pre10: + Fix hci_inquiry function to return errors and accept user buffers. + New functions hci_devba, hci_devid, hci_for_each_dev and hci_get_route. + Additional company IDs. + Makefile and other minor fixes. + ver 2.0-pre9: LMP features to string translation support. Additional HCI command and event defines. diff --git a/configure.in b/configure.in index eb8e5c1b..c4c555ef 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ dnl Guess host type. AC_CANONICAL_SYSTEM AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(bluez-libs, 2.0) +AM_INIT_AUTOMAKE(bluez-libs, 2.0-pre10) AC_PREFIX_DEFAULT(/usr) -- cgit From af8f79a2509219c19673056dde1b02c42d30598a Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 20 Jun 2002 00:48:45 +0000 Subject: remove autogenerated files. --- aclocal.m4 | 518 ------------------------------------------------------------- 1 file changed, 518 deletions(-) delete mode 100644 aclocal.m4 diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index b0b7b5b1..00000000 --- a/aclocal.m4 +++ /dev/null @@ -1,518 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 - -dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# Do all the work for Automake. 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. - -# serial 1 - -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN(AM_INIT_AUTOMAKE, -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN(AM_SANITY_CHECK, -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftestfile -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` - fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "[$]2" = conftestfile - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN(AM_MISSING_PROG, -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - - -# serial 40 AC_PROG_LIBTOOL -AC_DEFUN(AC_PROG_LIBTOOL, -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ -DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -AC_DEFUN(AC_LIBTOOL_SETUP, -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -dnl - -case "$target" in -NONE) lt_target="$host" ;; -*) lt_target="$target" ;; -esac - -# Check for any special flags to pass to ltconfig. -# -# the following will cause an existing older ltconfig to fail, so -# we ignore this at the expense of the cache file... Checking this -# will just take longer ... bummer! -#libtool_flags="--cache-file=$cache_file" -# -test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" -test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" -test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], -[libtool_flags="$libtool_flags --enable-dlopen"]) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[libtool_flags="$libtool_flags --enable-win32-dll"]) -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case "$lt_target" in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -]) -esac -]) - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_SHARED, [dnl -define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_STATIC, [dnl -define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl -define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN(AC_PROG_LD, -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. -changequote(,)dnl - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -changequote([,])dnl - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(ac_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - ac_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$ac_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) - -AC_DEFUN(AC_PROG_LD_GNU, -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes -else - ac_cv_prog_gnu_ld=no -fi]) -]) - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN(AC_PROG_NM, -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - ac_cv_path_NM="$NM" -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" - break - else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm -fi]) -NM="$ac_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case "$lt_target" in -*-*-beos* | *-*-cygwin*) - # These system don't have libm - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, main, LIBM="-lm") - ;; -esac -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library, adds --enable-ltdl-convenience to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case "$enable_ltdl_convenience" in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library, and adds --enable-ltdl-install to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= - fi -]) - -dnl old names -AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl -AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl -AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl -AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl -AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl -AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl -AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl - -dnl This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL])dnl - -- cgit From afdbc9e8fe53fdf5c4a5c78e379d604e92a61480 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 25 Jun 2002 04:03:54 +0000 Subject: new comp ids --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 6c09c4d9..d769e2b9 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -260,6 +260,8 @@ char *bt_compidtostr(int compid) return "Tenovis"; case 44: return "Macronix International Co. Ltd."; + case 45: + return "GCT Semiconductor"; case 65535: return "internal use"; default: -- cgit From 2377f938f56bc623ac6e0ad2e68862a0566dd7de Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 25 Jun 2002 04:07:01 +0000 Subject: Additional HCI defines. --- include/hci.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/hci.h b/include/hci.h index d6946976..8c898d42 100644 --- a/include/hci.h +++ b/include/hci.h @@ -210,6 +210,34 @@ typedef struct { #define OGF_HOST_CTL 0x03 #define OCF_RESET 0x0003 +#define OCF_READ_PAGE_TIMEOUT 0x0017 +typedef struct { + uint8_t status; + uint16_t timeout; +} __attribute__ ((packed)) read_page_timeout_rp; +#define READ_PAGE_TIMEOUT_RP_SIZE 3 + +#define OCF_WRITE_PAGE_TIMEOUT 0x0018 +typedef struct { + uint16_t timeout; +} __attribute__ ((packed)) write_page_timeout_cp; +#define WRITE_PAGE_TIMEOUT_CP_SIZE 2 + +#define OCF_READ_PAGE_ACTIVITY 0x001B +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_page_activity_rp; +#define READ_PAGE_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_PAGE_ACTIVITY 0x001C +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_page_activity_cp; +#define WRITE_PAGE_ACTIVITY_CP_SIZE 4 + #define OCF_READ_INQ_ACTIVITY 0x001D typedef struct { uint8_t status; -- cgit From 23ee7253eaee8524cdad88c0a796a630ceebac66 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 27 Jun 2002 17:30:13 +0000 Subject: Fix broadcast flags. --- include/hci.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hci.h b/include/hci.h index 8c898d42..d36a43eb 100644 --- a/include/hci.h +++ b/include/hci.h @@ -122,10 +122,10 @@ enum { #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) /* ACL flags */ -#define ACL_CONT 0x0001 -#define ACL_START 0x0002 -#define ACL_ACTIVE_BCAST 0x0010 -#define ACL_PICO_BCAST 0x0020 +#define ACL_CONT 0x01 +#define ACL_START 0x02 +#define ACL_ACTIVE_BCAST 0x04 +#define ACL_PICO_BCAST 0x08 /* Baseband links */ #define SCO_LINK 0x00 -- cgit From 8ee9bf3777ff4f57ec1e170174e2fcb6e1f870f7 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 2 Jul 2002 18:34:22 +0000 Subject: more compids --- src/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index d769e2b9..7097ebf0 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -262,6 +262,10 @@ char *bt_compidtostr(int compid) return "Macronix International Co. Ltd."; case 45: return "GCT Semiconductor"; + case 46: + return "Norwood Systems"; + case 47: + return "MewTel Technology Inc."; case 65535: return "internal use"; default: -- cgit From 3bd9f65df44db713ad911a729d7a934e2d328661 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 3 Jul 2002 22:01:23 +0000 Subject: rssi is signed int --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index d36a43eb..90d148f0 100644 --- a/include/hci.h +++ b/include/hci.h @@ -517,7 +517,7 @@ typedef struct { typedef struct { uint8_t status; uint16_t handle; - uint8_t rssi; + int8_t rssi; } __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 -- cgit From f6f9dcfc8f085e34cf2000507926950794f94fce Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 21 Jul 2002 20:53:12 +0000 Subject: update --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 31c43155..f1da4c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +ver 2.0: + Additional company IDs. + Minor fixes. + ver 2.0-pre10: Fix hci_inquiry function to return errors and accept user buffers. New functions hci_devba, hci_devid, hci_for_each_dev and hci_get_route. -- cgit From d456cf05e47c1b981cf4f9a23914136df3e3b9d4 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 21 Jul 2002 20:54:15 +0000 Subject: Bump version --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index c4c555ef..eb8e5c1b 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ dnl Guess host type. AC_CANONICAL_SYSTEM AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(bluez-libs, 2.0-pre10) +AM_INIT_AUTOMAKE(bluez-libs, 2.0) AC_PREFIX_DEFAULT(/usr) -- cgit From 7a31ba9955325e957677b4b9237155d6ca71d86d Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 19 Aug 2002 16:50:09 +0000 Subject: RFCOMM headers --- include/rfcomm.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 include/rfcomm.h diff --git a/include/rfcomm.h b/include/rfcomm.h new file mode 100644 index 00000000..533ddda5 --- /dev/null +++ b/include/rfcomm.h @@ -0,0 +1,45 @@ +/* + RFCOMM implementation for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002 Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef __RFCOMM_H +#define __RFCOMM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define RFCOMM_PSM 3 + +#define RFCOMM_CONN_TIMEOUT (HZ * 30) +#define RFCOMM_DISC_TIMEOUT (HZ * 5) + +struct sockaddr_rc { + sa_family_t rc_family; + bdaddr_t rc_bdaddr; + int rc_port; +}; + +#endif /* __RFCOMM_H */ -- cgit From 63a52518621efce1ec40afb05b8b698e4d6b9b2f Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 20 Aug 2002 19:52:36 +0000 Subject: port -> channel --- include/rfcomm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rfcomm.h b/include/rfcomm.h index 533ddda5..7da85482 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -39,7 +39,7 @@ extern "C" { struct sockaddr_rc { sa_family_t rc_family; bdaddr_t rc_bdaddr; - int rc_port; + int rc_channel; }; #endif /* __RFCOMM_H */ -- cgit From 803bf105508009f7efc87276a539dda244527690 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Wed, 21 Aug 2002 16:38:15 +0000 Subject: implement hci_{read, write}_current_iac_lap() --- include/hci.h | 16 ++++++++++++++++ include/hci_lib.h | 2 ++ src/hci.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/include/hci.h b/include/hci.h index 90d148f0..e12352b4 100644 --- a/include/hci.h +++ b/include/hci.h @@ -329,6 +329,22 @@ typedef struct { } __attribute__ ((packed)) host_buffer_size_cp; #define HOST_BUFFER_SIZE_CP_SIZE 7 +#define MAX_IAC_LAP 0x40 +#define OCF_READ_CURRENT_IAC_LAP 0x0039 +typedef struct { + uint8_t status; + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) read_current_iac_lap_rp; +#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP + +#define OCF_WRITE_CURRENT_IAC_LAP 0x003A +typedef struct { + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) write_current_iac_lap_cp; +#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP + /* Link Control */ #define OGF_LINK_CTL 0x01 #define OCF_CREATE_CONN 0x0005 diff --git a/include/hci_lib.h b/include/hci_lib.h index b988de5f..afa2fb51 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -70,6 +70,8 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_class_of_dev(int dd, uint8_t *class, int to); +int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); +int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/hci.c b/src/hci.c index 1424ddcd..40a19fb2 100644 --- a/src/hci.c +++ b/src/hci.c @@ -923,3 +923,42 @@ int hci_class_of_dev(int dd, uint8_t *class, int to) return 0; } +int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) +{ + read_current_iac_lap_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_CURRENT_IAC_LAP; + rq.rparam = &rp; + rq.rlen = READ_CURRENT_IAC_LAP_RP_SIZE; + if (0 > hci_send_req(dd, &rq, to)) + return -1; + if (rp.status) { + errno = EIO; + return -1; + } + *num_iac = rp.num_current_iac; + memcpy(lap, rp.lap, 3*rp.num_current_iac); + return 0; +} + +int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) +{ + write_current_iac_lap_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.num_current_iac = num_iac; + memcpy(&cp.lap, lap, 3*num_iac); + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; + rq.cparam = &cp; + rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; + if (0 > hci_send_req(dd, &rq, to)) + return -1; + return 0; +} -- cgit From 9aa01920bf2e6f3b9b23b44d7c5e48dadc2f8da8 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 22 Aug 2002 09:19:29 +0000 Subject: implement hci_{read, write}_class_of_dev() --- include/hci_lib.h | 3 ++- src/hci.c | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index afa2fb51..ba33be73 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -69,7 +69,8 @@ int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); -int hci_class_of_dev(int dd, uint8_t *class, int to); +int hci_read_class_of_dev(int dd, uint8_t *cls, int to); +int hci_write_class_of_dev(int dd, uint32_t cls, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); diff --git a/src/hci.c b/src/hci.c index 40a19fb2..6b60477a 100644 --- a/src/hci.c +++ b/src/hci.c @@ -900,7 +900,7 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) return 0; } -int hci_class_of_dev(int dd, uint8_t *class, int to) +int hci_read_class_of_dev(int dd, uint8_t *cls, int to) { read_class_of_dev_rp rp; struct hci_request rq; @@ -919,10 +919,26 @@ int hci_class_of_dev(int dd, uint8_t *class, int to) return -1; } - memcpy(class, rp.dev_class, 3); + memcpy(cls, rp.dev_class, 3); return 0; } +int hci_write_class_of_dev(int dd, uint32_t cls, int to) +{ + write_class_of_dev_cp cp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + cp.dev_class[0] = cls & 0xff; + cp.dev_class[1] = (cls >> 8) & 0xff; + cp.dev_class[2] = (cls >> 16) & 0xff; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_CLASS_OF_DEV; + rq.cparam = &cp; + rq.clen = WRITE_CLASS_OF_DEV_CP_SIZE; + return hci_send_req(dd, &rq, 1000); +} + int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) { read_current_iac_lap_rp rp; -- cgit From e329c9ff80a76cb34ff616bce80df0d161731d0b Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 22 Aug 2002 10:04:18 +0000 Subject: hci_write_local_name() --- include/hci_lib.h | 5 +++-- src/hci.c | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index ba33be73..4108dc06 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -64,8 +64,9 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); int hci_devid(char *str); -int hci_local_name(int dd, int len, char *name, int to); -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); +int hci_read_local_name(int dd, int len, char *name, int to); +int hci_write_local_name(int dd, char *name, int to); +int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); diff --git a/src/hci.c b/src/hci.c index 6b60477a..7f2c1745 100644 --- a/src/hci.c +++ b/src/hci.c @@ -755,7 +755,7 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) return 0; } -int hci_local_name(int dd, int len, char *name, int to) +int hci_read_local_name(int dd, int len, char *name, int to) { read_local_name_rp rp; struct hci_request rq; @@ -779,7 +779,24 @@ int hci_local_name(int dd, int len, char *name, int to) return 0; } -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) +int hci_write_local_name(int dd, char *name, int to) +{ + change_local_name_cp cp; + struct hci_request rq; + + strncpy(cp.name, name, sizeof(cp.name)); + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_CHANGE_LOCAL_NAME; + rq.cparam = &cp; + rq.clen = CHANGE_LOCAL_NAME_CP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + return 0; +} + +int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) { evt_remote_name_req_complete rn; remote_name_req_cp cp; -- cgit From 66d1c38bdf157527c00cf7bde69e1de7bdd3ea28 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Thu, 22 Aug 2002 17:17:57 +0000 Subject: resurrect hci_local_name(); fix whitespace --- include/hci_lib.h | 2 + src/hci.c | 113 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 61 insertions(+), 54 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 4108dc06..685eb413 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -64,6 +64,8 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); int hci_devid(char *str); +// deprecated: preserve compatibility +int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, char *name, int to); int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); diff --git a/src/hci.c b/src/hci.c index 7f2c1745..a9d3268d 100644 --- a/src/hci.c +++ b/src/hci.c @@ -755,6 +755,11 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) return 0; } +int hci_local_name(int dd, int len, char *name, int to) +{ + return hci_read_local_name(dd, len, name, to); +} + int hci_read_local_name(int dd, int len, char *name, int to) { read_local_name_rp rp; @@ -781,19 +786,19 @@ int hci_read_local_name(int dd, int len, char *name, int to) int hci_write_local_name(int dd, char *name, int to) { - change_local_name_cp cp; - struct hci_request rq; + change_local_name_cp cp; + struct hci_request rq; - strncpy(cp.name, name, sizeof(cp.name)); - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_CHANGE_LOCAL_NAME; - rq.cparam = &cp; - rq.clen = CHANGE_LOCAL_NAME_CP_SIZE; + strncpy(cp.name, name, sizeof(cp.name)); + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_CHANGE_LOCAL_NAME; + rq.cparam = &cp; + rq.clen = CHANGE_LOCAL_NAME_CP_SIZE; - if (hci_send_req(dd, &rq, to) < 0) - return -1; - return 0; + if (hci_send_req(dd, &rq, to) < 0) + return -1; + return 0; } int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) @@ -942,56 +947,56 @@ int hci_read_class_of_dev(int dd, uint8_t *cls, int to) int hci_write_class_of_dev(int dd, uint32_t cls, int to) { - write_class_of_dev_cp cp; - struct hci_request rq; + write_class_of_dev_cp cp; + struct hci_request rq; - memset(&rq, 0, sizeof(rq)); - cp.dev_class[0] = cls & 0xff; - cp.dev_class[1] = (cls >> 8) & 0xff; - cp.dev_class[2] = (cls >> 16) & 0xff; - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_WRITE_CLASS_OF_DEV; - rq.cparam = &cp; - rq.clen = WRITE_CLASS_OF_DEV_CP_SIZE; - return hci_send_req(dd, &rq, 1000); + memset(&rq, 0, sizeof(rq)); + cp.dev_class[0] = cls & 0xff; + cp.dev_class[1] = (cls >> 8) & 0xff; + cp.dev_class[2] = (cls >> 16) & 0xff; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_CLASS_OF_DEV; + rq.cparam = &cp; + rq.clen = WRITE_CLASS_OF_DEV_CP_SIZE; + return hci_send_req(dd, &rq, 1000); } int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) { - read_current_iac_lap_rp rp; - struct hci_request rq; - - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_READ_CURRENT_IAC_LAP; - rq.rparam = &rp; - rq.rlen = READ_CURRENT_IAC_LAP_RP_SIZE; - if (0 > hci_send_req(dd, &rq, to)) - return -1; - if (rp.status) { - errno = EIO; - return -1; - } - *num_iac = rp.num_current_iac; - memcpy(lap, rp.lap, 3*rp.num_current_iac); - return 0; + read_current_iac_lap_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_CURRENT_IAC_LAP; + rq.rparam = &rp; + rq.rlen = READ_CURRENT_IAC_LAP_RP_SIZE; + if (0 > hci_send_req(dd, &rq, to)) + return -1; + if (rp.status) { + errno = EIO; + return -1; + } + *num_iac = rp.num_current_iac; + memcpy(lap, rp.lap, 3*rp.num_current_iac); + return 0; } int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) { - write_current_iac_lap_cp cp; - struct hci_request rq; - - memset(&cp, 0, sizeof(cp)); - cp.num_current_iac = num_iac; - memcpy(&cp.lap, lap, 3*num_iac); - - memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; - rq.cparam = &cp; - rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; - if (0 > hci_send_req(dd, &rq, to)) - return -1; - return 0; + write_current_iac_lap_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.num_current_iac = num_iac; + memcpy(&cp.lap, lap, 3*num_iac); + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; + rq.cparam = &cp; + rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; + if (0 > hci_send_req(dd, &rq, to)) + return -1; + return 0; } -- cgit From 3c7d6997f5434c7fbb188253bb077bcc0585af3f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 23 Aug 2002 15:40:54 +0000 Subject: Add TTY ioctl defines and structures --- include/Makefile.am | 2 +- include/rfcomm.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/include/Makefile.am b/include/Makefile.am index 794a4c55..27a769fa 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h bluetooth: ln -s . bluetooth diff --git a/include/rfcomm.h b/include/rfcomm.h index 7da85482..b7dd179d 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -31,15 +31,69 @@ extern "C" { #endif +/* RFCOMM defaults */ +#define RFCOMM_DEFAULT_MTU 127 + #define RFCOMM_PSM 3 #define RFCOMM_CONN_TIMEOUT (HZ * 30) #define RFCOMM_DISC_TIMEOUT (HZ * 5) +/* RFCOMM socket address */ struct sockaddr_rc { sa_family_t rc_family; bdaddr_t rc_bdaddr; int rc_channel; }; +/* RFCOMM TTY support */ +#define RFCOMM_MAX_DEV 256 + +#define RFCOMM_UNKNOWN 0 +#define RFCOMM_CONNECT 1 +#define RFCOMM_BIND 2 + +#define RFCOMMCONNECT _IOW('R', 201, int) +#define RFCOMMDISCONNECT _IOW('R', 202, int) +#define RFCOMMBIND _IOW('R', 203, int) +#define RFCOMMRELEASE _IOW('R', 204, int) + +#define RFCOMMGETDEVLIST _IOR('R', 211, int) +#define RFCOMMGETDEVINFO _IOR('R', 212, int) + +struct rfcomm_dev_conn_req { + uint16_t dev_id; + bdaddr_t src; + bdaddr_t dst; + uint8_t chn; +}; + +struct rfcomm_dev_disc_req { + uint16_t dev_id; +}; + +struct rfcomm_dev_data_req { + uint16_t dev_id; + uint32_t dev_opt; +}; + +struct rfcomm_dev_list_req { + uint16_t dev_num; + struct rfcomm_dev_data_req dev_req[0]; +}; + +struct rfcomm_dev_info_req { + uint16_t dev_id; + uint8_t type; + uint32_t flags; + uint16_t state; + bdaddr_t src; + bdaddr_t dst; + uint8_t chn; +}; + +#ifdef __cplusplus +} +#endif + #endif /* __RFCOMM_H */ -- cgit From 91dc360626ec7b6b5d4da7dcb0a6287c39f3c9f4 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 12 Sep 2002 01:59:49 +0000 Subject: channel must be uint8 --- include/rfcomm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rfcomm.h b/include/rfcomm.h index b7dd179d..408874f8 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -43,7 +43,7 @@ extern "C" { struct sockaddr_rc { sa_family_t rc_family; bdaddr_t rc_bdaddr; - int rc_channel; + uint8_t rc_channel; }; /* RFCOMM TTY support */ -- cgit From 9a51483b2a1d80512904b1df81a8222afdb3a76a Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 15 Sep 2002 16:30:56 +0000 Subject: Role change event size is 8 --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index e12352b4..ba01bec0 100644 --- a/include/hci.h +++ b/include/hci.h @@ -643,7 +643,7 @@ typedef struct { bdaddr_t bdaddr; uint8_t role; } __attribute__ ((packed)) evt_role_change; -#define EVT_ROLE_CHANGE_SIZE 1 +#define EVT_ROLE_CHANGE_SIZE 8 #define EVT_PIN_CODE_REQ 0x16 typedef struct { -- cgit From a8d88fd7895fa8a4918b31f2654cc702cacb0eee Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 15 Sep 2002 16:35:13 +0000 Subject: disconnect timeo is 20 sec --- include/rfcomm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rfcomm.h b/include/rfcomm.h index 408874f8..e013a046 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -37,7 +37,7 @@ extern "C" { #define RFCOMM_PSM 3 #define RFCOMM_CONN_TIMEOUT (HZ * 30) -#define RFCOMM_DISC_TIMEOUT (HZ * 5) +#define RFCOMM_DISC_TIMEOUT (HZ * 20) /* RFCOMM socket address */ struct sockaddr_rc { -- cgit From fbe20747037da13e1f7e35b87f9ee904fe3c4bab Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sun, 15 Sep 2002 17:17:05 +0000 Subject: update --- AUTHORS | 4 ++++ ChangeLog | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/AUTHORS b/AUTHORS index d9b488f5..61d09d0c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,3 +4,7 @@ Maxim Krasnyansky Marcel Holtmann Various patches, fixes and other contributions. + +Stephen Crane + Support for hci_{read, write}_class_of_dev() and other HCI functions. + diff --git a/ChangeLog b/ChangeLog index f1da4c9c..ca357e62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +ver 2.1: + New HCI functions: + hci_{read, write}_class_of_dev(), + hci_{read, write}_current_iac_lap(), + hci_write_local_name() + Added RFCOMM header file. + Minor fixes. + ver 2.0: Additional company IDs. Minor fixes. -- cgit From 8a3e9d619f548c665569e8c835ed82313db3759b Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 16 Sep 2002 17:32:47 +0000 Subject: update --- configure.in | 2 +- src/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index eb8e5c1b..5c16278d 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ dnl Guess host type. AC_CANONICAL_SYSTEM AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(bluez-libs, 2.0) +AM_INIT_AUTOMAKE(bluez-libs, 2.1) AC_PREFIX_DEFAULT(/usr) diff --git a/src/Makefile.am b/src/Makefile.am index 6359a2b0..794d67d2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,6 +5,6 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c -libbluetooth_la_LDFLAGS = -version-info 1:0:0 +libbluetooth_la_LDFLAGS = -version-info 1:1:0 INCLUDES = -I$(top_srcdir)/include -- cgit From 96cd06b189af2a09bde5d752552f58fd495d5646 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 18 Sep 2002 00:37:04 +0000 Subject: resurrect hci_remote_name() --- include/hci_lib.h | 1 + src/hci.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 685eb413..8f17a8dd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -68,6 +68,7 @@ int hci_devid(char *str); int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, char *name, int to); +int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); diff --git a/src/hci.c b/src/hci.c index a9d3268d..af0ffd65 100644 --- a/src/hci.c +++ b/src/hci.c @@ -801,6 +801,11 @@ int hci_write_local_name(int dd, char *name, int to) return 0; } +int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) +{ + return hci_read_remote_name(dd, ba, len, name, to); +} + int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) { evt_remote_name_req_complete rn; -- cgit From d80fe434621307216d8d6805318c3b76bf54f061 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 18 Sep 2002 00:44:00 +0000 Subject: update --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index ca357e62..55585846 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 2.1.1: + Resurrect hci_remote_name. + ver 2.1: New HCI functions: hci_{read, write}_class_of_dev(), -- cgit From 41f627f92dd0c0d7e1667c1f7cc877a6643c1849 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 18 Sep 2002 00:48:35 +0000 Subject: Bump version --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 5c16278d..1af64e7e 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ dnl Guess host type. AC_CANONICAL_SYSTEM AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(bluez-libs, 2.1) +AM_INIT_AUTOMAKE(bluez-libs, 2.1.1) AC_PREFIX_DEFAULT(/usr) -- cgit From 79cd53450eeb6555077f7ede0b5e02a23d7bebe8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 22 Sep 2002 23:59:17 +0000 Subject: Add HCI_PCI to the device types --- include/hci.h | 1 + src/hci.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/hci.h b/include/hci.h index ba01bec0..e522ee85 100644 --- a/include/hci.h +++ b/include/hci.h @@ -52,6 +52,7 @@ extern "C" { #define HCI_PCCARD 2 #define HCI_UART 3 #define HCI_RS232 4 +#define HCI_PCI 5 /* HCI device flags */ enum { diff --git a/src/hci.c b/src/hci.c index af0ffd65..dcc24666 100644 --- a/src/hci.c +++ b/src/hci.c @@ -146,6 +146,10 @@ char *hci_dtypetostr(int type) return "PCCARD"; case HCI_UART: return "UART"; + case HCI_RS232: + return "RS232"; + case HCI_PCI: + return "PCI"; default: return "UKNW"; } -- cgit From d16c23005aaece1792be1f6377655758fe6fc661 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 30 Sep 2002 06:09:24 +0000 Subject: New RFCOMM ioctl API. --- include/rfcomm.h | 55 ++++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/include/rfcomm.h b/include/rfcomm.h index e013a046..2f26b8b8 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -49,48 +49,37 @@ struct sockaddr_rc { /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -#define RFCOMM_UNKNOWN 0 -#define RFCOMM_CONNECT 1 -#define RFCOMM_BIND 2 - -#define RFCOMMCONNECT _IOW('R', 201, int) -#define RFCOMMDISCONNECT _IOW('R', 202, int) -#define RFCOMMBIND _IOW('R', 203, int) -#define RFCOMMRELEASE _IOW('R', 204, int) - -#define RFCOMMGETDEVLIST _IOR('R', 211, int) -#define RFCOMMGETDEVINFO _IOR('R', 212, int) - -struct rfcomm_dev_conn_req { - uint16_t dev_id; - bdaddr_t src; - bdaddr_t dst; - uint8_t chn; +#define RFCOMMSETMODE _IOW('R', 200, int) +#define RFCOMMCREATEDEV _IOW('R', 201, int) +#define RFCOMMRELEASEDEV _IOW('R', 202, int) +#define RFCOMMGETDEVLIST _IOR('R', 210, int) +#define RFCOMMGETDEVINFO _IOR('R', 211, int) + +struct rfcomm_dev_create_req { + int16_t dev_id; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; -struct rfcomm_dev_disc_req { - uint16_t dev_id; +struct rfcomm_dev_release_req { + int16_t dev_id; }; -struct rfcomm_dev_data_req { - uint16_t dev_id; - uint32_t dev_opt; +struct rfcomm_dev_info { + int16_t id; + uint32_t flags; + uint16_t state; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; struct rfcomm_dev_list_req { - uint16_t dev_num; - struct rfcomm_dev_data_req dev_req[0]; + uint16_t dev_num; + struct rfcomm_dev_info dev_info[0]; }; -struct rfcomm_dev_info_req { - uint16_t dev_id; - uint8_t type; - uint32_t flags; - uint16_t state; - bdaddr_t src; - bdaddr_t dst; - uint8_t chn; -}; #ifdef __cplusplus } -- cgit From 2b6704ff38275b2bb881b349248513f0ae3c1e60 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Tue, 1 Oct 2002 23:26:55 +0000 Subject: TTY ioct API changes --- include/rfcomm.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/include/rfcomm.h b/include/rfcomm.h index 2f26b8b8..cfad4feb 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -49,22 +49,21 @@ struct sockaddr_rc { /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -#define RFCOMMSETMODE _IOW('R', 200, int) -#define RFCOMMCREATEDEV _IOW('R', 201, int) -#define RFCOMMRELEASEDEV _IOW('R', 202, int) +#define RFCOMMCREATEDEV _IOW('R', 200, int) +#define RFCOMMRELEASEDEV _IOW('R', 201, int) #define RFCOMMGETDEVLIST _IOR('R', 210, int) #define RFCOMMGETDEVINFO _IOR('R', 211, int) -struct rfcomm_dev_create_req { +struct rfcomm_dev_req { int16_t dev_id; + uint32_t flags; bdaddr_t src; bdaddr_t dst; uint8_t channel; }; - -struct rfcomm_dev_release_req { - int16_t dev_id; -}; +#define RFCOMM_REUSE_DLC 0 +#define RFCOMM_RELEASE_ONHUP 1 +#define RFCOMM_HANGUP_NOW 2 struct rfcomm_dev_info { int16_t id; -- cgit From 5fddbd5c7ba7414fedd85a52d0e30798f09aafba Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 2 Oct 2002 21:12:36 +0000 Subject: Added TTY_ATTACHED flag --- include/rfcomm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/rfcomm.h b/include/rfcomm.h index cfad4feb..d583f98c 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -64,6 +64,7 @@ struct rfcomm_dev_req { #define RFCOMM_REUSE_DLC 0 #define RFCOMM_RELEASE_ONHUP 1 #define RFCOMM_HANGUP_NOW 2 +#define RFCOMM_TTY_ATTACHED 3 struct rfcomm_dev_info { int16_t id; -- cgit From b7597027bc00feec6a7c90b5bef45f348417781f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 4 Oct 2002 13:34:53 +0000 Subject: Add hci_suspend_dev() and hci_resume_dev() skeleton --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hci.h b/include/hci.h index e522ee85..bd4f692c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -45,6 +45,8 @@ extern "C" { #define HCI_DEV_UNREG 2 #define HCI_DEV_UP 3 #define HCI_DEV_DOWN 4 +#define HCI_DEV_SUSPEND 5 +#define HCI_DEV_RESUME 6 /* HCI device types */ #define HCI_VHCI 0 -- cgit From 5c637d2cdb568e8d3c0cf08a57fca8131ddbe036 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 7 Oct 2002 06:01:46 +0000 Subject: Added link supervision timeout cmd and events. --- include/hci.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/hci.h b/include/hci.h index bd4f692c..9e2848f6 100644 --- a/include/hci.h +++ b/include/hci.h @@ -256,6 +256,21 @@ typedef struct { } __attribute__ ((packed)) write_inq_activity_cp; #define WRITE_INQ_ACTIVITY_CP_SIZE 4 +#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) read_link_supervision_timeout_rp; +#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 + +#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 +typedef struct { + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) write_link_supervision_timeout_cp; +#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 + #define OCF_READ_AUTH_ENABLE 0x001F #define OCF_WRITE_AUTH_ENABLE 0x0020 #define AUTH_DISABLED 0x00 @@ -668,6 +683,14 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_CONN_PTYPE_CHANGED 0x1D +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t ptype; +} __attribute__ ((packed)) evt_conn_ptype_changed; +#define EVT_CONN_PTYPE_CHANGED_SIZE 5 + #define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { uint8_t status; -- cgit From 26fa39157c4c1bfd09368bd93fa825aca93c70a6 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 7 Oct 2002 16:09:09 +0000 Subject: update --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 55585846..8156bcf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +ver 2.2: + Updated RFCOMM header file. + Additional HCI command and event defines. + ver 2.1.1: Resurrect hci_remote_name. -- cgit From 3fb5c4a42fac86d8f1ac9472b1d3b6636d1c243b Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 7 Oct 2002 16:18:13 +0000 Subject: bump version number --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1af64e7e..9a804739 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ dnl Guess host type. AC_CANONICAL_SYSTEM AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(bluez-libs, 2.1.1) +AM_INIT_AUTOMAKE(bluez-libs, 2.2) AC_PREFIX_DEFAULT(/usr) -- cgit From 9b62711dfb2f6fa13d6ddc02a713ba5960926c66 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 17 Oct 2002 14:49:27 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 7097ebf0..7bd06ff0 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -266,6 +266,12 @@ char *bt_compidtostr(int compid) return "Norwood Systems"; case 47: return "MewTel Technology Inc."; + case 48: + return "ST Microelectronics"; + case 49: + return "Synopsys"; + case 50: + return "Red-M (Communications) Ltd"; case 65535: return "internal use"; default: -- cgit From 38b2a7b2c0d00282a52c339145ae55b4a787d6db Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Nov 2002 20:04:43 +0000 Subject: Some more missing HCI commands and correction of the QOS event --- include/hci.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/include/hci.h b/include/hci.h index 9e2848f6..8000e47b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -363,6 +363,13 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_WRITE_SUPERVISION_TIMEOUT 0x0037 +typedef struct { + uint16_t handle; + uint16_t timeout; /* in 0.625 ms units */ +} __attribute__ ((packed)) write_supervision_timeout_cp; +#define WRITE_SUPERVISION_TIMEOUT_CP_SIZE 4 + /* Link Control */ #define OGF_LINK_CTL 0x01 #define OCF_CREATE_CONN 0x0005 @@ -418,6 +425,20 @@ typedef struct { } __attribute__ ((packed)) status_bdaddr_rp; #define STATUS_BDADDR_RP_SIZE 7 +#define OCF_INQUIRY_CANCEL 0x0002 + +#define OCF_PERIODIC_INQUIRY 0x0003 +typedef struct { + uint16_t max_period; /* 1.28s units */ + uint16_t min_period; /* 1.28s units */ + uint8_t lap[3]; + uint8_t length; /* 1.28s units */ + uint8_t num_rsp; +} __attribute__ ((packed)) periodic_inquiry_cp; +#define PERIODIC_INQUIRY_CP_SIZE 9 + +#define OCF_EXIT_PERIODIC_INQUIRY 0x0004 + #define OCF_LINK_KEY_REPLY 0x000B #define OCF_LINK_KEY_NEG_REPLY 0x000C typedef struct { @@ -478,6 +499,24 @@ typedef struct { /* Link Policy */ #define OGF_LINK_POLICY 0x02 + +typedef struct { + uint8_t service_type; /* 1 = best effort */ + uint32_t token_rate; /* Byte per seconds */ + uint32_t peak_bandwidth; /* Byte per seconds */ + uint32_t latency; /* Microseconds */ + uint32_t delay_variation; /* Microseconds */ +} __attribute__ ((packed)) hci_qos; +#define HCI_QOS_CP_SIZE 17 + +#define OCF_QOS_SETUP 0x0007 +typedef struct { + uint16_t handle; + uint8_t flags; /* Reserved */ + hci_qos qos; +} __attribute__ ((packed)) qos_setup_cp; +#define QOS_SETUP_CP_SIZE (3 + HCI_QOS_CP_SIZE) + #define OCF_ROLE_DISCOVERY 0x0009 typedef struct { uint16_t handle; @@ -619,19 +658,19 @@ typedef struct { #define EVT_ENCRYPT_CHANGE_SIZE 5 #define EVT_QOS_SETUP_COMPLETE 0x0D -typedef struct { - uint8_t service_type; - uint32_t token_rate; - uint32_t peak_bandwidth; - uint32_t latency; - uint32_t delay_variation; -} __attribute__ ((packed)) hci_qos; typedef struct { uint8_t status; uint16_t handle; + uint8_t flags; /* Reserved */ hci_qos qos; } __attribute__ ((packed)) evt_qos_setup_complete; -#define EVT_QOS_SETUP_COMPLETE_SIZE 20 +#define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) + +#define EVT_QOS_VIOLATION 0x1E +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) evt_qos_violation; +#define EVT_QOS_VIOLATION_SIZE 2 #define EVT_CMD_COMPLETE 0x0e typedef struct { -- cgit From 4e89f72ef1e8a70c40e5b587589977ee9f665d9b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Nov 2002 20:11:46 +0000 Subject: Remove OCF_WRITE_SUPERVISION_TIMEOUT --- include/hci.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/hci.h b/include/hci.h index 8000e47b..7868366c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -363,13 +363,6 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP -#define OCF_WRITE_SUPERVISION_TIMEOUT 0x0037 -typedef struct { - uint16_t handle; - uint16_t timeout; /* in 0.625 ms units */ -} __attribute__ ((packed)) write_supervision_timeout_cp; -#define WRITE_SUPERVISION_TIMEOUT_CP_SIZE 4 - /* Link Control */ #define OGF_LINK_CTL 0x01 #define OCF_CREATE_CONN 0x0005 -- cgit From e101b08ba577ff8f6a2a789eb67d128977859fd3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Nov 2002 20:27:51 +0000 Subject: Remove the opcode parameter in hci_filter_clear_opcode() --- include/hci_lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 8f17a8dd..e7aa8bcd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -153,7 +153,7 @@ static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) { f->opcode = opcode; } -static inline void hci_filter_clear_opcode(int opcode, struct hci_filter *f) +static inline void hci_filter_clear_opcode(struct hci_filter *f) { f->opcode = 0; } -- cgit From a1e51b622a5d7dad098ed0b856c37c18da495692 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Fri, 22 Nov 2002 21:54:27 +0000 Subject: Fix hci_for_each_dev() to work on big endian machines. --- src/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index dcc24666..89d481b4 100644 --- a/src/hci.c +++ b/src/hci.c @@ -369,7 +369,7 @@ int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg if (s < 0) return -1; - dl = malloc(HCI_MAX_DEV * sizeof(struct hci_dev_req) + sizeof(uint16_t)); + dl = malloc(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl)); if (!dl) { close(s); return -1; -- cgit From 7e64d607acb1f9701381d09ccdeca0793f127592 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 28 Nov 2002 21:26:59 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 7bd06ff0..b60b0191 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -272,6 +272,8 @@ char *bt_compidtostr(int compid) return "Synopsys"; case 50: return "Red-M (Communications) Ltd"; + case 51: + return "Commil Ltd"; case 65535: return "internal use"; default: -- cgit From a0a3d96eed5f186278ea931953d4bcb6cd99cc7a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 2 Dec 2002 20:24:17 +0000 Subject: Fix a typo --- src/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index 89d481b4..42de36e5 100644 --- a/src/hci.c +++ b/src/hci.c @@ -163,7 +163,7 @@ hci_map dev_flags_map[] = { { "RAW", HCI_RAW }, { "PSCAN", HCI_PSCAN }, { "ISCAN", HCI_ISCAN }, - { "IQUIRY", HCI_INQUIRY }, + { "INQUIRY", HCI_INQUIRY }, { "AUTH", HCI_AUTH }, { "ENCRYPT", HCI_ENCRYPT }, { NULL } -- cgit From d6cbeb4c61f5dc0c0d04dd022139b44f81964b18 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 15 Dec 2002 13:18:53 +0000 Subject: Support for voice setting --- include/hci.h | 13 +++++++++++++ include/hci_lib.h | 2 ++ src/hci.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/include/hci.h b/include/hci.h index 7868366c..a00b7218 100644 --- a/include/hci.h +++ b/include/hci.h @@ -338,6 +338,19 @@ typedef struct { } __attribute__ ((packed)) write_class_of_dev_cp; #define WRITE_CLASS_OF_DEV_CP_SIZE 3 +#define OCF_READ_VOICE_SETTING 0x0025 +typedef struct { + uint8_t status; + uint16_t voice_setting; +} __attribute__ ((packed)) read_voice_setting_rp; +#define READ_VOICE_SETTING_RP_SIZE 3 + +#define OCF_WRITE_VOICE_SETTING 0x0026 +typedef struct { + uint16_t voice_setting; +} __attribute__ ((packed)) write_voice_setting_cp; +#define WRITE_VOICE_SETTING_CP_SIZE 2 + #define OCF_HOST_BUFFER_SIZE 0x0033 typedef struct { uint16_t acl_mtu; diff --git a/include/hci_lib.h b/include/hci_lib.h index e7aa8bcd..81d29ecf 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -75,6 +75,8 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); +int hci_read_voice_setting(int dd, uint16_t *vs, int to); +int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); diff --git a/src/hci.c b/src/hci.c index 42de36e5..b8bbc0c2 100644 --- a/src/hci.c +++ b/src/hci.c @@ -970,6 +970,43 @@ int hci_write_class_of_dev(int dd, uint32_t cls, int to) return hci_send_req(dd, &rq, 1000); } +int hci_read_voice_setting(int dd, uint16_t *vs, int to) +{ + read_voice_setting_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_VOICE_SETTING; + rq.rparam = &rp; + rq.rlen = READ_VOICE_SETTING_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *vs = rp.voice_setting; + return 0; +} + +int hci_write_voice_setting(int dd, uint16_t vs, int to) +{ + write_voice_setting_cp cp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + cp.voice_setting = vs; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_VOICE_SETTING; + rq.cparam = &cp; + rq.clen = WRITE_VOICE_SETTING_CP_SIZE; + return hci_send_req(dd, &rq, 1000); +} + int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) { read_current_iac_lap_rp rp; -- cgit From 2ac228bc6fcc7a6f2b1368f39cb392b61c984608 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sat, 21 Dec 2002 05:17:15 +0000 Subject: Add RPM spec file. --- Makefile.am | 2 +- libs.spec | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 libs.spec diff --git a/Makefile.am b/Makefile.am index bc2d6cb2..2f4de561 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,4 +6,4 @@ SUBDIRS := include src DISTCLEANFILES = conftest.c conftest -EXTRA_DIST = ChangeLog +EXTRA_DIST = ChangeLog libs.spec diff --git a/libs.spec b/libs.spec new file mode 100644 index 00000000..7a39fbcf --- /dev/null +++ b/libs.spec @@ -0,0 +1,60 @@ +# Note that this is NOT a relocatable package +%define ver 2.2 +%define RELEASE 1 +%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} +%define prefix /usr + +Summary: BlueZ libraries +Name: bluez-libs +Version: %ver +Release: %rel +Copyright: GPL +Group: Applications/System +Vendor: Official Linux Bluetooth protocol stack +Packager: Sebastian Frankfurt +Source: http://bluez.sourceforge.net/%{name}-%{ver}.tar.gz +BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root +URL: http://bluez.sourceforge.net +Docdir: %{prefix}/share/doc +Requires: glibc >= 2.2.4 +BuildRequires: glibc >= 2.2.4 +BuildRequires: glib-devel >= 1.2 + +%description +Official Linux Bluetooth protocol stack libraries (bluez-libs). + +The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. + +%changelog +* Tue Aug 13 2002 Sebastian Frankfurt +- Initial RPM + +%prep +rm -rf $RPM_BUILD_ROOT +#rm -rf /usr/src/redhat/BUILD/* + +%setup -q + +%build +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} +make + +%install +rm -rf $RPM_BUILD_ROOT +make prefix=$RPM_BUILD_ROOT%{prefix} install + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-, root, root) + +/usr/include/bluetooth/* +/usr/lib/libbluetooth* + +%doc AUTHORS COPYING INSTALL ChangeLog NEWS README + -- cgit From 8b78ba1604231b0660fa50a6f79f6b5f1b5db418 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Sat, 21 Dec 2002 06:58:20 +0000 Subject: RPM description fixes. --- libs.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs.spec b/libs.spec index 7a39fbcf..640fb46a 100644 --- a/libs.spec +++ b/libs.spec @@ -4,7 +4,7 @@ %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr -Summary: BlueZ libraries +Summary: Bluetooth libraries Name: bluez-libs Version: %ver Release: %rel @@ -21,7 +21,7 @@ BuildRequires: glibc >= 2.2.4 BuildRequires: glib-devel >= 1.2 %description -Official Linux Bluetooth protocol stack libraries (bluez-libs). +Bluetooth libraries. The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. -- cgit From b76e31a4c8d609d5334fa8958c53f09b0014aeac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 21 Dec 2002 19:19:17 +0000 Subject: Add the vendor and testing defines --- include/hci.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index a00b7218..8093c35a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -504,7 +504,7 @@ typedef struct { #define READ_REMOTE_VERSION_CP_SIZE 2 /* Link Policy */ -#define OGF_LINK_POLICY 0x02 +#define OGF_LINK_POLICY 0x02 typedef struct { uint8_t service_type; /* 1 = best effort */ @@ -600,6 +600,12 @@ typedef struct { } __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 +/* Testing commands */ +#define OGF_TESTING_CMD 0x3e + +/* Vendor specific commands */ +#define OGF_VENDOR_CMD 0x3f + /* ---- HCI Events ---- */ #define EVT_INQUIRY_COMPLETE 0x01 @@ -777,6 +783,10 @@ typedef struct { uint8_t incomming; } __attribute__ ((packed)) evt_si_security; +#define EVT_TESTING 0xfe + +#define EVT_VENDOR 0xff + /* -------- HCI Packet structures -------- */ #define HCI_TYPE_LEN 1 -- cgit From 66ae4b13f78efe1da096cfbaef8a94088c0b92bb Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 25 Dec 2002 01:05:59 +0000 Subject: Added MAINTAINER_MODE. New version. --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9a804739..2ea71403 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,9 @@ dnl Guess host type. AC_CANONICAL_SYSTEM AC_CANONICAL_HOST -AM_INIT_AUTOMAKE(bluez-libs, 2.2) +AM_MAINTAINER_MODE + +AM_INIT_AUTOMAKE(bluez-libs, 2.3) AC_PREFIX_DEFAULT(/usr) -- cgit From ab94177208705f7b2be0261223d3c251c007c17c Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 25 Dec 2002 01:06:17 +0000 Subject: new version --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8156bcf3..0a0b3982 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 2.3: + Fix hci_for_each_dev() for big endian machines. + Support for voice settings. + RPM package. + ver 2.2: Updated RFCOMM header file. Additional HCI command and event defines. -- cgit From f1d7d2c9d821da65ab03da798ab54884469ee18d Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 25 Dec 2002 01:08:50 +0000 Subject: New version. --- libs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs.spec b/libs.spec index 640fb46a..0eda9c85 100644 --- a/libs.spec +++ b/libs.spec @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 2.2 +%define ver 2.3 %define RELEASE 1 %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr -- cgit From 6a1cfd82efe91f0dc81ca4e3ea50e8c2077f415e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 24 Jan 2003 09:41:07 +0000 Subject: Don't ignore the timeout parameter --- src/hci.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/hci.c b/src/hci.c index b8bbc0c2..ddc15672 100644 --- a/src/hci.c +++ b/src/hci.c @@ -914,7 +914,7 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) rq.rparam = &rp; rq.rlen = READ_LOCAL_VERSION_RP_SIZE; - if (hci_send_req(dd, &rq, 1000) < 0) + if (hci_send_req(dd, &rq, to) < 0) return -1; if (rp.status) { @@ -967,7 +967,7 @@ int hci_write_class_of_dev(int dd, uint32_t cls, int to) rq.ocf = OCF_WRITE_CLASS_OF_DEV; rq.cparam = &cp; rq.clen = WRITE_CLASS_OF_DEV_CP_SIZE; - return hci_send_req(dd, &rq, 1000); + return hci_send_req(dd, &rq, to); } int hci_read_voice_setting(int dd, uint16_t *vs, int to) @@ -1004,7 +1004,7 @@ int hci_write_voice_setting(int dd, uint16_t vs, int to) rq.ocf = OCF_WRITE_VOICE_SETTING; rq.cparam = &cp; rq.clen = WRITE_VOICE_SETTING_CP_SIZE; - return hci_send_req(dd, &rq, 1000); + return hci_send_req(dd, &rq, to); } int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) @@ -1017,14 +1017,17 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) rq.ocf = OCF_READ_CURRENT_IAC_LAP; rq.rparam = &rp; rq.rlen = READ_CURRENT_IAC_LAP_RP_SIZE; - if (0 > hci_send_req(dd, &rq, to)) + + if (hci_send_req(dd, &rq, to) < 0) return -1; + if (rp.status) { errno = EIO; return -1; } + *num_iac = rp.num_current_iac; - memcpy(lap, rp.lap, 3*rp.num_current_iac); + memcpy(lap, rp.lap, rp.num_current_iac * 3); return 0; } @@ -1035,14 +1038,12 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) memset(&cp, 0, sizeof(cp)); cp.num_current_iac = num_iac; - memcpy(&cp.lap, lap, 3*num_iac); + memcpy(&cp.lap, lap, num_iac * 3); memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; rq.cparam = &cp; rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; - if (0 > hci_send_req(dd, &rq, to)) - return -1; - return 0; + return hci_send_req(dd, &rq, to); } -- cgit From be47bbe6b4e691321240443f2915c5fba4a7d748 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 3 Feb 2003 17:26:56 +0000 Subject: hci error codes --- include/hci.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/include/hci.h b/include/hci.h index 8093c35a..3e736558 100644 --- a/include/hci.h +++ b/include/hci.h @@ -124,6 +124,49 @@ enum { #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) +/* HCI Error codes */ +#define HCI_UNKNOWN_COMMAND 0x01 +#define HCI_NO_CONNECTION 0x02 +#define HCI_HARDWARE_FAILURE 0x03 +#define HCI_PAGE_TIMEOUT 0x04 +#define HCI_AUTHENTICATION_FAILURE 0x05 +#define HCI_KEY_MISSING 0x06 +#define HCI_MEMORY_FULL 0x07 +#define HCI_CONNECTION_TIMEOUT 0x08 +#define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 +#define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0a +#define HCI_ACL_CONNECTION_EXISTS 0x0b +#define HCI_COMMAND_DISALLOWED 0x0c +#define HCI_REJECTED_LIMITED_RESOURCES 0x0d +#define HCI_REJECTED_SECURITY 0x0e +#define HCI_REJECTED_PERSONAL 0x0f +#define HCI_HOST_TIMEOUT 0x10 +#define HCI_UNSUPPORTED_FEATURE 0x11 +#define HCI_INVALID_PARAMETERS 0x12 +#define HCI_OE_USER_ENDED_CONNECTION 0x13 +#define HCI_OE_LOW_RESOURCES 0x14 +#define HCI_OE_POWER_OFF 0x15 +#define HCI_CONNECTION_TERMINATED 0x16 +#define HCI_REPEATED_ATTEMPTS 0x17 +#define HCI_PAIRING_NOT_ALLOWED 0x18 +#define HCI_UNKNOWN_LMP_PDU 0x19 +#define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a +#define HCI_SCO_OFFSET_REJECTED 0x1b +#define HCI_SCO_INTERVAL_REJECTED 0x1c +#define HCI_AIR_MODE_REJECTED 0x1d +#define HCI_INVALID_LMP_PARAMETERS 0x1e +#define HCI_UNSPECIFIED_ERROR 0x1f +#define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20 +#define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21 +#define HCI_LMP_RESPONSE_TIMEOUT 0x22 +#define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23 +#define HCI_LMP_PDU_NOT_ALLOWED 0x24 +#define HCI_ENCRYPTION_MODE_NOT_ACCEPTED 0x25 +#define HCI_UNIT_LINK_KEY_USED 0x26 +#define HCI_QOS_NOT_SUPPORTED 0x27 +#define HCI_INSTANT_PASSED 0x28 +#define HCI_PAIRING_NOT_SUPPORTED 0x29 + /* ACL flags */ #define ACL_CONT 0x01 #define ACL_START 0x02 -- cgit From 805b906186b0a5ea0ce77824b4a7c659b6b7b598 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 3 Feb 2003 17:39:11 +0000 Subject: use error codes --- src/bluetooth.c | 69 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/src/bluetooth.c b/src/bluetooth.c index b60b0191..4548b121 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -105,62 +105,61 @@ int bt_error(uint16_t code) switch (code) { case 0: return 0; - case 0x01: + case HCI_UNKNOWN_COMMAND: return EBADRQC; - case 0x02: + case HCI_NO_CONNECTION: return ENOTCONN; - case 0x03: + case HCI_HARDWARE_FAILURE: return EIO; - case 0x04: + case HCI_PAGE_TIMEOUT: return EHOSTDOWN; - case 0x05: + case HCI_AUTHENTICATION_FAILURE: return EACCES; - case 0x06: + case HCI_KEY_MISSING: return EINVAL; - case 0x07: + case HCI_MEMORY_FULL: return ENOMEM; - case 0x08: + case HCI_CONNECTION_TIMEOUT: return ETIMEDOUT; - case 0x09: + case HCI_MAX_NUMBER_OF_CONNECTIONS: + case HCI_MAX_NUMBER_OF_SCO_CONNECTIONS: return EMLINK; - case 0x0a: - return EMLINK; - case 0x0b: + case HCI_ACL_CONNECTION_EXISTS: return EALREADY; - case 0x0c: + case HCI_COMMAND_DISALLOWED: return EBUSY; - case 0x0d: - case 0x0e: - case 0x0f: + case HCI_REJECTED_LIMITED_RESOURCES: + case HCI_REJECTED_SECURITY: + case HCI_REJECTED_PERSONAL: return ECONNREFUSED; - case 0x10: + case HCI_HOST_TIMEOUT: return ETIMEDOUT; - case 0x11: - case 0x27: - case 0x29: - case 0x20: + case HCI_UNSUPPORTED_FEATURE: + case HCI_QOS_NOT_SUPPORTED: + case HCI_PAIRING_NOT_SUPPORTED: + case HCI_UNSUPPORTED_LMP_PARAMETER_VALUE: return EOPNOTSUPP; - case 0x12: + case HCI_INVALID_PARAMETERS: return EINVAL; - case 0x13: - case 0x14: - case 0x15: + case HCI_OE_USER_ENDED_CONNECTION: + case HCI_OE_LOW_RESOURCES: + case HCI_OE_POWER_OFF: return ECONNRESET; - case 0x16: + case HCI_CONNECTION_TERMINATED: return ECONNABORTED; - case 0x17: + case HCI_REPEATED_ATTEMPTS: return ELOOP; - case 0x18: + case HCI_PAIRING_NOT_ALLOWED: return EACCES; - case 0x1a: + case HCI_UNSUPPORTED_REMOTE_FEATURE: return EPROTONOSUPPORT; - case 0x1b: + case HCI_SCO_OFFSET_REJECTED: return ECONNREFUSED; - case 0x19: - case 0x1e: - case 0x23: - case 0x24: - case 0x25: + case HCI_UNKNOWN_LMP_PDU: + case HCI_INVALID_LMP_PARAMETERS: + case HCI_LMP_ERROR_TRANSACTION_COLLISION: + case HCI_LMP_PDU_NOT_ALLOWED: + case HCI_ENCRYPTION_MODE_NOT_ACCEPTED: return EPROTO; default: return ENOSYS; -- cgit From bff9ecffc1771df893e0cccc59fe708cf9ba43bb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 4 Feb 2003 00:30:39 +0000 Subject: Whitespace cleanup --- include/hci.h | 74 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/include/hci.h b/include/hci.h index 3e736558..8168a492 100644 --- a/include/hci.h +++ b/include/hci.h @@ -125,47 +125,47 @@ enum { #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) /* HCI Error codes */ -#define HCI_UNKNOWN_COMMAND 0x01 -#define HCI_NO_CONNECTION 0x02 -#define HCI_HARDWARE_FAILURE 0x03 -#define HCI_PAGE_TIMEOUT 0x04 -#define HCI_AUTHENTICATION_FAILURE 0x05 -#define HCI_KEY_MISSING 0x06 -#define HCI_MEMORY_FULL 0x07 -#define HCI_CONNECTION_TIMEOUT 0x08 -#define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 +#define HCI_UNKNOWN_COMMAND 0x01 +#define HCI_NO_CONNECTION 0x02 +#define HCI_HARDWARE_FAILURE 0x03 +#define HCI_PAGE_TIMEOUT 0x04 +#define HCI_AUTHENTICATION_FAILURE 0x05 +#define HCI_KEY_MISSING 0x06 +#define HCI_MEMORY_FULL 0x07 +#define HCI_CONNECTION_TIMEOUT 0x08 +#define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 #define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS 0x0a -#define HCI_ACL_CONNECTION_EXISTS 0x0b -#define HCI_COMMAND_DISALLOWED 0x0c -#define HCI_REJECTED_LIMITED_RESOURCES 0x0d -#define HCI_REJECTED_SECURITY 0x0e -#define HCI_REJECTED_PERSONAL 0x0f -#define HCI_HOST_TIMEOUT 0x10 -#define HCI_UNSUPPORTED_FEATURE 0x11 -#define HCI_INVALID_PARAMETERS 0x12 -#define HCI_OE_USER_ENDED_CONNECTION 0x13 -#define HCI_OE_LOW_RESOURCES 0x14 -#define HCI_OE_POWER_OFF 0x15 -#define HCI_CONNECTION_TERMINATED 0x16 -#define HCI_REPEATED_ATTEMPTS 0x17 -#define HCI_PAIRING_NOT_ALLOWED 0x18 -#define HCI_UNKNOWN_LMP_PDU 0x19 -#define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a -#define HCI_SCO_OFFSET_REJECTED 0x1b -#define HCI_SCO_INTERVAL_REJECTED 0x1c -#define HCI_AIR_MODE_REJECTED 0x1d -#define HCI_INVALID_LMP_PARAMETERS 0x1e -#define HCI_UNSPECIFIED_ERROR 0x1f +#define HCI_ACL_CONNECTION_EXISTS 0x0b +#define HCI_COMMAND_DISALLOWED 0x0c +#define HCI_REJECTED_LIMITED_RESOURCES 0x0d +#define HCI_REJECTED_SECURITY 0x0e +#define HCI_REJECTED_PERSONAL 0x0f +#define HCI_HOST_TIMEOUT 0x10 +#define HCI_UNSUPPORTED_FEATURE 0x11 +#define HCI_INVALID_PARAMETERS 0x12 +#define HCI_OE_USER_ENDED_CONNECTION 0x13 +#define HCI_OE_LOW_RESOURCES 0x14 +#define HCI_OE_POWER_OFF 0x15 +#define HCI_CONNECTION_TERMINATED 0x16 +#define HCI_REPEATED_ATTEMPTS 0x17 +#define HCI_PAIRING_NOT_ALLOWED 0x18 +#define HCI_UNKNOWN_LMP_PDU 0x19 +#define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1a +#define HCI_SCO_OFFSET_REJECTED 0x1b +#define HCI_SCO_INTERVAL_REJECTED 0x1c +#define HCI_AIR_MODE_REJECTED 0x1d +#define HCI_INVALID_LMP_PARAMETERS 0x1e +#define HCI_UNSPECIFIED_ERROR 0x1f #define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20 -#define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21 -#define HCI_LMP_RESPONSE_TIMEOUT 0x22 +#define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21 +#define HCI_LMP_RESPONSE_TIMEOUT 0x22 #define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23 -#define HCI_LMP_PDU_NOT_ALLOWED 0x24 +#define HCI_LMP_PDU_NOT_ALLOWED 0x24 #define HCI_ENCRYPTION_MODE_NOT_ACCEPTED 0x25 -#define HCI_UNIT_LINK_KEY_USED 0x26 -#define HCI_QOS_NOT_SUPPORTED 0x27 -#define HCI_INSTANT_PASSED 0x28 -#define HCI_PAIRING_NOT_SUPPORTED 0x29 +#define HCI_UNIT_LINK_KEY_USED 0x26 +#define HCI_QOS_NOT_SUPPORTED 0x27 +#define HCI_INSTANT_PASSED 0x28 +#define HCI_PAIRING_NOT_SUPPORTED 0x29 /* ACL flags */ #define ACL_CONT 0x01 -- cgit From 109bfa547ab9e24672472371e2183dcec24d0058 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Tue, 11 Feb 2003 10:22:23 +0000 Subject: add const to fn sigs; fns to auth and enc links --- include/bluetooth.h | 14 +++++++------- include/hci.h | 2 +- include/hci_lib.h | 14 ++++++++------ src/bluetooth.c | 18 +++++++++--------- src/hci.c | 39 +++++++++++++++++++++++++++++++++------ 5 files changed, 58 insertions(+), 29 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index b93c4e35..93a6f628 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -91,20 +91,20 @@ typedef struct { #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) /* Copy, swap, convert BD Address */ -static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) +static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2) { return memcmp(ba1, ba2, sizeof(bdaddr_t)); } -static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) +static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src) { memcpy(dst, src, sizeof(bdaddr_t)); } -void baswap(bdaddr_t *dst, bdaddr_t *src); -bdaddr_t *strtoba(char *str); -char *batostr(bdaddr_t *ba); -int ba2str(bdaddr_t *ba, char *str); -int str2ba(char *str, bdaddr_t *ba); +void baswap(bdaddr_t *dst, const bdaddr_t *src); +bdaddr_t *strtoba(const char *str); +char *batostr(const bdaddr_t *ba); +int ba2str(const bdaddr_t *ba, char *str); +int str2ba(const char *str, bdaddr_t *ba); int bt_error(uint16_t code); char *bt_compidtostr(int id); diff --git a/include/hci.h b/include/hci.h index 8168a492..212db12b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -823,7 +823,7 @@ typedef struct { uint16_t event; uint16_t proto; uint16_t subproto; - uint8_t incomming; + uint8_t incoming; } __attribute__ ((packed)) evt_si_security; #define EVT_TESTING 0xfe diff --git a/include/hci_lib.h b/include/hci_lib.h index 81d29ecf..d6d76214 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -56,20 +56,20 @@ int hci_close_dev(int dd); 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); -int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); +int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); -int hci_inquiry(int dev_id, int len, int num_rsp, uint8_t *lap, inquiry_info **ii, long flags); +int hci_inquiry(int dev_id, int len, int num_rsp, const uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); -int hci_devid(char *str); +int hci_devid(const char *str); // deprecated: preserve compatibility int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); -int hci_write_local_name(int dd, char *name, int to); -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); -int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to); +int hci_write_local_name(int dd, const char *name, int to); +int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); +int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); @@ -79,6 +79,8 @@ int hci_read_voice_setting(int dd, uint16_t *vs, int to); int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); +int hci_authenticate_link(int dd, uint16_t handle, int to); +int hci_encrypt_link(int dd, uint16_t handle, int on, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/bluetooth.c b/src/bluetooth.c index 4548b121..bc0eb238 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -35,16 +35,16 @@ #include #include -void baswap(bdaddr_t *dst, bdaddr_t *src) +void baswap(bdaddr_t *dst, const bdaddr_t *src) { - register unsigned char * d = (unsigned char *)dst; - register unsigned char * s = (unsigned char *)src; + register unsigned char *d = (unsigned char *)dst; + register const unsigned char *s = (const unsigned char *)src; register int i; for(i=0; i<6; i++) d[i] = s[5-i]; } -char *batostr(bdaddr_t *ba) +char *batostr(const bdaddr_t *ba) { char *str = malloc(18); if (!str) @@ -56,9 +56,9 @@ char *batostr(bdaddr_t *ba) return str; } -bdaddr_t *strtoba(char *str) +bdaddr_t *strtoba(const char *str) { - char *ptr = str; + const char *ptr = str; int i; uint8_t *ba = malloc(sizeof(bdaddr_t)); @@ -74,7 +74,7 @@ bdaddr_t *strtoba(char *str) return (bdaddr_t *) ba; } -int ba2str(bdaddr_t *ba, char *str) +int ba2str(const bdaddr_t *ba, char *str) { uint8_t b[6]; @@ -83,10 +83,10 @@ int ba2str(bdaddr_t *ba, char *str) b[0], b[1], b[2], b[3], b[4], b[5]); } -int str2ba(char *str, bdaddr_t *ba) +int str2ba(const char *str, bdaddr_t *ba) { uint8_t b[6]; - char *ptr = str; + const char *ptr = str; int i; for (i=0; i < 6; i++) { diff --git a/src/hci.c b/src/hci.c index ddc15672..abcfb447 100644 --- a/src/hci.c +++ b/src/hci.c @@ -419,7 +419,7 @@ int hci_get_route(bdaddr_t *bdaddr) return hci_for_each_dev(HCI_UP, NULL, 0); } -int hci_devid(char *str) +int hci_devid(const char *str) { bdaddr_t ba; int id = -1; @@ -467,7 +467,7 @@ int hci_devba(int dev_id, bdaddr_t *ba) return 0; } -int hci_inquiry(int dev_id, int len, int nrsp, uint8_t *lap, inquiry_info **ii, long flags) +int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info **ii, long flags) { struct hci_inquiry_req *ir; void *buf; @@ -697,7 +697,7 @@ done: return 0; } -int hci_create_connection(int dd, bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to) +int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to) { evt_conn_complete rp; create_conn_cp cp; @@ -788,7 +788,7 @@ int hci_read_local_name(int dd, int len, char *name, int to) return 0; } -int hci_write_local_name(int dd, char *name, int to) +int hci_write_local_name(int dd, const char *name, int to) { change_local_name_cp cp; struct hci_request rq; @@ -805,12 +805,12 @@ int hci_write_local_name(int dd, char *name, int to) return 0; } -int hci_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) +int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to) { return hci_read_remote_name(dd, ba, len, name, to); } -int hci_read_remote_name(int dd, bdaddr_t *ba, int len, char *name, int to) +int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to) { evt_remote_name_req_complete rn; remote_name_req_cp cp; @@ -1047,3 +1047,30 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; return hci_send_req(dd, &rq, to); } + +int hci_authenticate_link(int dd, uint16_t handle, int to) +{ + auth_requested_cp cp; + struct hci_request rq; + + cp.handle = handle; + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_AUTH_REQUESTED; + rq.cparam = &cp; + rq.clen = AUTH_REQUESTED_CP_SIZE; + return hci_send_req(dd, &rq, to); +} + +int hci_encrypt_link(int dd, uint16_t handle, int on, int to) +{ + set_conn_encrypt_cp cp; + struct hci_request rq; + + cp.handle = handle; + cp.encrypt = on; + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_SET_CONN_ENCRYPT; + rq.cparam = &cp; + rq.clen = SET_CONN_ENCRYPT_CP_SIZE; + return hci_send_req(dd, &rq, to); +} -- cgit From dcaa587850c70d3a8efaf39a756207062e6a7ed6 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 20 Mar 2003 19:30:29 +0000 Subject: New version. --- ChangeLog | 4 ++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a0b3982..6828a75e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +ver 2.4: + Added const qualifiers to appropriate function arguments. + Minor fixes. + ver 2.3: Fix hci_for_each_dev() for big endian machines. Support for voice settings. diff --git a/configure.in b/configure.in index 2ea71403..d05b31ce 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,7 @@ AC_CANONICAL_HOST AM_MAINTAINER_MODE -AM_INIT_AUTOMAKE(bluez-libs, 2.3) +AM_INIT_AUTOMAKE(bluez-libs, 2.4) AC_PREFIX_DEFAULT(/usr) diff --git a/src/Makefile.am b/src/Makefile.am index 794d67d2..ac3e7279 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,6 +5,6 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c -libbluetooth_la_LDFLAGS = -version-info 1:1:0 +libbluetooth_la_LDFLAGS = -version-info 1:2:0 INCLUDES = -I$(top_srcdir)/include -- cgit From a942007d8dcf712b7b764b11ee95d7675d9dbc73 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 20 Mar 2003 19:34:14 +0000 Subject: new version --- libs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs.spec b/libs.spec index 0eda9c85..41a4eca1 100644 --- a/libs.spec +++ b/libs.spec @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 2.3 +%define ver 2.4 %define RELEASE 1 %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr -- cgit From 8ab4acd91521e11b769c8b1d2c89a40cf9077396 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 21 Mar 2003 14:13:46 +0000 Subject: Use R1 for default value of pscan_rep_mode --- src/hci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hci.c b/src/hci.c index abcfb447..312c748e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -703,11 +703,12 @@ int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t c create_conn_cp cp; struct hci_request rq; - memset(&cp, 0, sizeof(cp)); - bacpy(&cp.bdaddr, ba); - cp.pkt_type = ptype; - cp.clock_offset = clkoffset; - cp.role_switch = rswitch; + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.bdaddr, ba); + cp.pkt_type = ptype; + cp.pscan_rep_mode = 0x01; + cp.clock_offset = clkoffset; + cp.role_switch = rswitch; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; -- cgit From bfcbbde6d7baebca27c6e93f02f6279e5f36c866 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 21 Mar 2003 14:26:12 +0000 Subject: Use R1 for default value of pscan_rep_mode --- src/hci.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/hci.c b/src/hci.c index 312c748e..5c58b129 100644 --- a/src/hci.c +++ b/src/hci.c @@ -800,7 +800,7 @@ int hci_write_local_name(int dd, const char *name, int to) rq.ocf = OCF_CHANGE_LOCAL_NAME; rq.cparam = &cp; rq.clen = CHANGE_LOCAL_NAME_CP_SIZE; - + if (hci_send_req(dd, &rq, to) < 0) return -1; return 0; @@ -819,6 +819,7 @@ int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); + cp.pscan_rep_mode = 0x01; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; @@ -847,10 +848,10 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) evt_read_remote_features_complete rp; read_remote_features_cp cp; struct hci_request rq; - + memset(&cp, 0, sizeof(cp)); cp.handle = handle; - + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_FEATURES; @@ -859,15 +860,15 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) rq.clen = READ_REMOTE_FEATURES_CP_SIZE; rq.rparam = &rp; rq.rlen = EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE; - + if (hci_send_req(dd, &rq, to) < 0) return -1; - + if (rp.status) { errno = EIO; return -1; } - + memcpy(features, rp.features, 8); return 0; } @@ -877,10 +878,10 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in evt_read_remote_version_complete rp; read_remote_version_cp cp; struct hci_request rq; - + memset(&cp, 0, sizeof(cp)); cp.handle = handle; - + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_READ_REMOTE_VERSION; @@ -889,15 +890,15 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in rq.clen = READ_REMOTE_VERSION_CP_SIZE; rq.rparam = &rp; rq.rlen = EVT_READ_REMOTE_VERSION_COMPLETE_SIZE; - + if (hci_send_req(dd, &rq, to) < 0) return -1; - + if (rp.status) { errno = EIO; return -1; } - + ver->manufacturer = btohs(rp.manufacturer); ver->lmp_ver = rp.lmp_ver; ver->lmp_subver = btohs(rp.lmp_subver); @@ -928,7 +929,6 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) ver->hci_rev = btohs(rp.hci_rev); ver->lmp_ver = rp.lmp_ver; ver->lmp_subver = btohs(rp.lmp_subver); - return 0; } -- cgit From 1c9576607a611e033e0bac0f56d91146c120a16d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 22 Mar 2003 08:00:36 +0000 Subject: Support for reading the clock offset --- include/hci.h | 14 ++++++++++++++ include/hci_lib.h | 1 + src/hci.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/include/hci.h b/include/hci.h index 212db12b..904bc5c8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -546,6 +546,12 @@ typedef struct { } __attribute__ ((packed)) read_remote_version_cp; #define READ_REMOTE_VERSION_CP_SIZE 2 +#define OCF_READ_CLOCK_OFFSET 0x001F +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) read_clock_offset_cp; +#define READ_CLOCK_OFFSET_CP_SIZE 2 + /* Link Policy */ #define OGF_LINK_POLICY 0x02 @@ -777,6 +783,14 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t clock_offset; +} __attribute__ ((packed)) evt_read_clock_offset_complete; +#define EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE 5 + #define EVT_CONN_PTYPE_CHANGED 0x1D typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index d6d76214..79866a45 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -72,6 +72,7 @@ int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); +int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); diff --git a/src/hci.c b/src/hci.c index 5c58b129..9a5c7dfe 100644 --- a/src/hci.c +++ b/src/hci.c @@ -905,6 +905,36 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in return 0; } +int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to) +{ + evt_read_clock_offset_complete rp; + read_clock_offset_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = handle; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_READ_CLOCK_OFFSET; + rq.event = EVT_READ_CLOCK_OFFSET_COMPLETE; + rq.cparam = &cp; + rq.clen = READ_CLOCK_OFFSET_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *clkoffset = rp.clock_offset; + return 0; +} + int hci_read_local_version(int dd, struct hci_version *ver, int to) { read_local_version_rp rp; -- cgit From c2052ebcf1f91984d3b2ef12a589445f4dd89d44 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Mar 2003 10:05:12 +0000 Subject: Detect ld and ar --- configure.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index d05b31ce..b3b8568f 100644 --- a/configure.in +++ b/configure.in @@ -22,8 +22,9 @@ CFLAGS="-Wall -g -O2" AC_PROG_CC AC_PROG_INSTALL +AC_CHECK_TOOL(LD, ld, ld) +AC_CHECK_TOOL(AR, ar, ar) + AM_PROG_LIBTOOL -#AC_CHECK_TOOL(LD, ld, ld) -#AC_CHECK_TOOL(AR, ar, ar) AC_OUTPUT(Makefile include/Makefile src/Makefile) -- cgit From be609d042ad549ec27de081cd81a7001fb307581 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 Apr 2003 01:13:10 +0000 Subject: Add HCI defines for park, sniff and hold mode --- include/hci.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/include/hci.h b/include/hci.h index 904bc5c8..531d4e1d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -421,6 +421,7 @@ typedef struct { /* Link Control */ #define OGF_LINK_CTL 0x01 + #define OCF_CREATE_CONN 0x0005 typedef struct { bdaddr_t bdaddr; @@ -555,6 +556,36 @@ typedef struct { /* Link Policy */ #define OGF_LINK_POLICY 0x02 +#define OCF_SNIFF_MODE 0x0003 +typedef struct { + uint16_t handle; + uint16_t interval_max; + uint16_t interval_min; + uint16_t attempt_window; + uint16_t timeout; +} __attribute__ ((packed)) sniff_mode_cp; +#define SNIFF_MODE_CP_SIZE 10 + +#define OCF_EXIT_SNIFF_MODE 0x0004 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) exit_sniff_mode_cp; +#define EXIT_SNIFF_MODE_CP_SIZE 2 + +#define OCF_PARK_MODE 0x0005 +typedef struct { + uint16_t handle; + uint16_t beacon_max; + uint16_t beacon_min; +} __attribute__ ((packed)) park_mode_cp; +#define PARK_MODE_CP_SIZE 6 + +#define OCF_EXIT_PARK_MODE 0x0006 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) exit_park_mode_cp; +#define EXIT_PARK_MODE_CP_SIZE 2 + typedef struct { uint8_t service_type; /* 1 = best effort */ uint32_t token_rate; /* Byte per seconds */ @@ -727,6 +758,15 @@ typedef struct { } __attribute__ ((packed)) evt_qos_setup_complete; #define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) +#define EVT_MODE_CHANGE 0x14 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t mode; + uint16_t interval; +} __attribute__ ((packed)) evt_mode_change; +#define EVT_MODE_CHANGE_SIZE 6 + #define EVT_QOS_VIOLATION 0x1E typedef struct { uint16_t handle; -- cgit From 6cd70af01a46b7e543c50d0646b877c38b3257f4 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 19 May 2003 17:47:22 +0000 Subject: fix auth and encrypt --- src/hci.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index 9a5c7dfe..e6cf48c4 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1082,6 +1082,7 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) int hci_authenticate_link(int dd, uint16_t handle, int to) { auth_requested_cp cp; + evt_auth_complete rp; struct hci_request rq; cp.handle = handle; @@ -1089,12 +1090,22 @@ int hci_authenticate_link(int dd, uint16_t handle, int to) rq.ocf = OCF_AUTH_REQUESTED; rq.cparam = &cp; rq.clen = AUTH_REQUESTED_CP_SIZE; - return hci_send_req(dd, &rq, to); + rq.rparam = &rp; + rq.event = EVT_AUTH_COMPLETE; + rq.rlen = EVT_AUTH_COMPLETE_SIZE; + if (hci_send_req(dd, &rq, to) < 0) + return -1; + if (rp.status) { + errno = EIO; + return -1; + } + return 0; } int hci_encrypt_link(int dd, uint16_t handle, int on, int to) { set_conn_encrypt_cp cp; + evt_encrypt_change rp; struct hci_request rq; cp.handle = handle; @@ -1103,5 +1114,14 @@ int hci_encrypt_link(int dd, uint16_t handle, int on, int to) rq.ocf = OCF_SET_CONN_ENCRYPT; rq.cparam = &cp; rq.clen = SET_CONN_ENCRYPT_CP_SIZE; - return hci_send_req(dd, &rq, to); + rq.event = EVT_ENCRYPT_CHANGE; + rq.rlen = EVT_ENCRYPT_CHANGE_SIZE; + rq.rparam = &rp; + if (hci_send_req(dd, &rq, to) < 0) + return -1; + if (rp.status) { + errno = EIO; + return -1; + } + return 0; } -- cgit From 2c375c1f2c5cff353e2f767ac14f8251452392e9 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Tue, 20 May 2003 11:33:53 +0000 Subject: add role switch --- include/hci_lib.h | 2 ++ src/hci.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 79866a45..31995411 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -82,6 +82,8 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, int on, int to); +// role == 0 is master, 1 is slave +int hci_switch_role(int dd, bdaddr_t peer, int role, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/hci.c b/src/hci.c index e6cf48c4..6d313d21 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1125,3 +1125,27 @@ int hci_encrypt_link(int dd, uint16_t handle, int on, int to) } return 0; } + +int hci_switch_role(int dd, bdaddr_t peer, int role, int to) +{ + switch_role_cp cp; + evt_role_change rp; + struct hci_request rq; + + cp.bdaddr = peer; + cp.role = role; + rq.ogf = OGF_LINK_POLICY; + rq.ocf = OCF_SWITCH_ROLE; + rq.cparam = &cp; + rq.clen = SWITCH_ROLE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_ROLE_CHANGE_SIZE; + rq.event = EVT_ROLE_CHANGE; + if (hci_send_req(dd, &rq, to) < 0) + return -1; + if (rp.status) { + errno = EIO; + return -1; + } + return 0; +} -- cgit From c12c507c9a494cd70e82b01c9856d92ebf36f165 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 26 May 2003 13:10:49 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index bc0eb238..baaf9f7c 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -273,6 +273,8 @@ char *bt_compidtostr(int compid) return "Red-M (Communications) Ltd"; case 51: return "Commil Ltd"; + case 52: + return "Computer Access Technology Corporation (CATC)"; case 65535: return "internal use"; default: -- cgit From 742d032d41631219ddbd39f39b7c70419064acc1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 28 May 2003 23:59:55 +0000 Subject: Add definition of LM_RELIABLE flag --- include/hci.h | 1 + include/l2cap.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/hci.h b/include/hci.h index 531d4e1d..e96eee9e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -213,6 +213,7 @@ enum { #define HCI_LM_AUTH 0x0002 #define HCI_LM_ENCRYPT 0x0004 #define HCI_LM_TRUSTED 0x0008 +#define HCI_LM_RELIABLE 0x0010 /* ----- HCI Commands ----- */ /* OGF & OCF values */ diff --git a/include/l2cap.h b/include/l2cap.h index 25178401..dec00efc 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -64,6 +64,7 @@ struct l2cap_conninfo { #define L2CAP_LM_AUTH 0x0002 #define L2CAP_LM_ENCRYPT 0x0004 #define L2CAP_LM_TRUSTED 0x0008 +#define L2CAP_LM_RELIABLE 0x0010 #define L2CAP_QOS 0x04 struct l2cap_qos { -- cgit From 8095772fc06beb7d21bb02c0cc0a2157734e5919 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 3 Jun 2003 14:04:01 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index baaf9f7c..f2c13a24 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -275,6 +275,8 @@ char *bt_compidtostr(int compid) return "Commil Ltd"; case 52: return "Computer Access Technology Corporation (CATC)"; + case 53: + return "Eclipse (HQ Espana) S.L."; case 65535: return "internal use"; default: -- cgit From 5206dbb419458caad6664aef67e34dba8be3fefa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 5 Jun 2003 06:25:32 +0000 Subject: Cleanup --- include/rfcomm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rfcomm.h b/include/rfcomm.h index d583f98c..f04ace71 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -1,6 +1,7 @@ /* - RFCOMM implementation for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002 Maxim Krasnyansky + RFCOMM protocol definition for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002-2003 Maxim Krasnyansky + Copyright (C) 2002-2003 Marcel Holtmann This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as @@ -80,7 +81,6 @@ struct rfcomm_dev_list_req { struct rfcomm_dev_info dev_info[0]; }; - #ifdef __cplusplus } #endif -- cgit From fccacdc27dffbc563a4cfe2e1aa9ed987a1bfca1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 5 Jun 2003 06:38:18 +0000 Subject: Add protocol number for CMTP --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 93a6f628..c09e99d4 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -48,6 +48,7 @@ extern "C" { #define BTPROTO_SCO 2 #define BTPROTO_RFCOMM 3 #define BTPROTO_BNEP 4 +#define BTPROTO_CMTP 5 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From 95989cae022b8bd39e3e45e5bc92eaf8c6b5d0ab Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jun 2003 11:19:19 +0000 Subject: Add HCI defines for transmit power level --- include/hci.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/hci.h b/include/hci.h index e96eee9e..746bb66c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -395,6 +395,19 @@ typedef struct { } __attribute__ ((packed)) write_voice_setting_cp; #define WRITE_VOICE_SETTING_CP_SIZE 2 +#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D +typedef struct { + uint16_t handle; + uint8_t type; +} __attribute__ ((packed)) read_transmit_power_level_cp; +#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3 +typedef struct { + uint8_t status; + uint16_t handle; + int8_t level; +} __attribute__ ((packed)) read_transmit_power_level_rp; +#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 + #define OCF_HOST_BUFFER_SIZE 0x0033 typedef struct { uint16_t acl_mtu; -- cgit From 78410fbc646a08b98487096e93e7bde4189314ae Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jun 2003 13:09:02 +0000 Subject: Add functions for park mode --- include/hci.h | 20 ++++-- src/hci.c | 226 +++++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 157 insertions(+), 89 deletions(-) diff --git a/include/hci.h b/include/hci.h index 746bb66c..4e881275 100644 --- a/include/hci.h +++ b/include/hci.h @@ -568,14 +568,22 @@ typedef struct { #define READ_CLOCK_OFFSET_CP_SIZE 2 /* Link Policy */ -#define OGF_LINK_POLICY 0x02 +#define OGF_LINK_POLICY 0x02 + +#define OCF_HOLD_MODE 0x0001 +typedef struct { + uint16_t handle; + uint16_t max_interval; + uint16_t min_interval; +} __attribute__ ((packed)) hold_mode_cp; +#define HOLD_MODE_CP_SIZE 6 #define OCF_SNIFF_MODE 0x0003 typedef struct { uint16_t handle; - uint16_t interval_max; - uint16_t interval_min; - uint16_t attempt_window; + uint16_t max_interval; + uint16_t min_interval; + uint16_t attempt; uint16_t timeout; } __attribute__ ((packed)) sniff_mode_cp; #define SNIFF_MODE_CP_SIZE 10 @@ -589,8 +597,8 @@ typedef struct { #define OCF_PARK_MODE 0x0005 typedef struct { uint16_t handle; - uint16_t beacon_max; - uint16_t beacon_min; + uint16_t max_interval; + uint16_t min_interval; } __attribute__ ((packed)) park_mode_cp; #define PARK_MODE_CP_SIZE 6 diff --git a/src/hci.c b/src/hci.c index 6d313d21..676b8af8 100644 --- a/src/hci.c +++ b/src/hci.c @@ -39,9 +39,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -699,9 +699,9 @@ done: int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to) { - evt_conn_complete rp; - create_conn_cp cp; - struct hci_request rq; + evt_conn_complete rp; + create_conn_cp cp; + struct hci_request rq; memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); @@ -711,21 +711,21 @@ int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t c cp.role_switch = rswitch; memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_LINK_CTL; - rq.ocf = OCF_CREATE_CONN; - rq.event = EVT_CONN_COMPLETE; - rq.cparam = &cp; - rq.clen = CREATE_CONN_CP_SIZE; - rq.rparam = &rp; - rq.rlen = EVT_CONN_COMPLETE_SIZE; - - if (hci_send_req(dd, &rq, to) < 0) - return -1; - - if (rp.status) { - errno = EIO; - return -1; - } + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_CREATE_CONN; + rq.event = EVT_CONN_COMPLETE; + rq.cparam = &cp; + rq.clen = CREATE_CONN_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_CONN_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } *handle = rp.handle; return 0; @@ -733,31 +733,31 @@ int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t c int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) { - evt_disconn_complete rp; - disconnect_cp cp; - struct hci_request rq; + evt_disconn_complete rp; + disconnect_cp cp; + struct hci_request rq; - memset(&cp, 0, sizeof(cp)); - cp.handle = handle; - cp.reason = reason; + memset(&cp, 0, sizeof(cp)); + cp.handle = handle; + cp.reason = reason; memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_LINK_CTL; - rq.ocf = OCF_DISCONNECT; - rq.event = EVT_DISCONN_COMPLETE; - rq.cparam = &cp; - rq.clen = DISCONNECT_CP_SIZE; - rq.rparam = &rp; - rq.rlen = EVT_DISCONN_COMPLETE_SIZE; - - if (hci_send_req(dd, &rq, to) < 0) - return -1; - - if (rp.status) { - errno = EIO; - return -1; - } - return 0; + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_DISCONNECT; + rq.event = EVT_DISCONN_COMPLETE; + rq.cparam = &cp; + rq.clen = DISCONNECT_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_DISCONN_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + return 0; } int hci_local_name(int dd, int len, char *name, int to) @@ -775,7 +775,7 @@ int hci_read_local_name(int dd, int len, char *name, int to) rq.ocf = OCF_READ_LOCAL_NAME; rq.rparam = &rp; rq.rlen = READ_LOCAL_NAME_RP_SIZE; - + if (hci_send_req(dd, &rq, to) < 0) return -1; @@ -796,10 +796,10 @@ int hci_write_local_name(int dd, const char *name, int to) strncpy(cp.name, name, sizeof(cp.name)); memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_CHANGE_LOCAL_NAME; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_CHANGE_LOCAL_NAME; rq.cparam = &cp; - rq.clen = CHANGE_LOCAL_NAME_CP_SIZE; + rq.clen = CHANGE_LOCAL_NAME_CP_SIZE; if (hci_send_req(dd, &rq, to) < 0) return -1; @@ -862,11 +862,11 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) rq.rlen = EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE; if (hci_send_req(dd, &rq, to) < 0) - return -1; + return -1; if (rp.status) { - errno = EIO; - return -1; + errno = EIO; + return -1; } memcpy(features, rp.features, 8); @@ -955,10 +955,10 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) } ver->manufacturer = btohs(rp.manufacturer); - ver->hci_ver = rp.hci_ver; - ver->hci_rev = btohs(rp.hci_rev); - ver->lmp_ver = rp.lmp_ver; - ver->lmp_subver = btohs(rp.lmp_subver); + ver->hci_ver = rp.hci_ver; + ver->hci_rev = btohs(rp.hci_rev); + ver->lmp_ver = rp.lmp_ver; + ver->lmp_subver = btohs(rp.lmp_subver); return 0; } @@ -994,10 +994,10 @@ int hci_write_class_of_dev(int dd, uint32_t cls, int to) cp.dev_class[0] = cls & 0xff; cp.dev_class[1] = (cls >> 8) & 0xff; cp.dev_class[2] = (cls >> 16) & 0xff; - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_WRITE_CLASS_OF_DEV; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_CLASS_OF_DEV; rq.cparam = &cp; - rq.clen = WRITE_CLASS_OF_DEV_CP_SIZE; + rq.clen = WRITE_CLASS_OF_DEV_CP_SIZE; return hci_send_req(dd, &rq, to); } @@ -1020,8 +1020,8 @@ int hci_read_voice_setting(int dd, uint16_t *vs, int to) return -1; } - *vs = rp.voice_setting; - return 0; + *vs = rp.voice_setting; + return 0; } int hci_write_voice_setting(int dd, uint16_t vs, int to) @@ -1031,10 +1031,10 @@ int hci_write_voice_setting(int dd, uint16_t vs, int to) memset(&rq, 0, sizeof(rq)); cp.voice_setting = vs; - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_WRITE_VOICE_SETTING; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_VOICE_SETTING; rq.cparam = &cp; - rq.clen = WRITE_VOICE_SETTING_CP_SIZE; + rq.clen = WRITE_VOICE_SETTING_CP_SIZE; return hci_send_req(dd, &rq, to); } @@ -1044,10 +1044,10 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) struct hci_request rq; memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_READ_CURRENT_IAC_LAP; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_CURRENT_IAC_LAP; rq.rparam = &rp; - rq.rlen = READ_CURRENT_IAC_LAP_RP_SIZE; + rq.rlen = READ_CURRENT_IAC_LAP_RP_SIZE; if (hci_send_req(dd, &rq, to) < 0) return -1; @@ -1072,10 +1072,10 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) memcpy(&cp.lap, lap, num_iac * 3); memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_HOST_CTL; - rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; rq.cparam = &cp; - rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; + rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; return hci_send_req(dd, &rq, to); } @@ -1086,13 +1086,13 @@ int hci_authenticate_link(int dd, uint16_t handle, int to) struct hci_request rq; cp.handle = handle; - rq.ogf = OGF_LINK_CTL; - rq.ocf = OCF_AUTH_REQUESTED; + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_AUTH_REQUESTED; rq.cparam = &cp; - rq.clen = AUTH_REQUESTED_CP_SIZE; + rq.clen = AUTH_REQUESTED_CP_SIZE; rq.rparam = &rp; - rq.event = EVT_AUTH_COMPLETE; - rq.rlen = EVT_AUTH_COMPLETE_SIZE; + rq.event = EVT_AUTH_COMPLETE; + rq.rlen = EVT_AUTH_COMPLETE_SIZE; if (hci_send_req(dd, &rq, to) < 0) return -1; if (rp.status) { @@ -1108,14 +1108,14 @@ int hci_encrypt_link(int dd, uint16_t handle, int on, int to) evt_encrypt_change rp; struct hci_request rq; - cp.handle = handle; + cp.handle = handle; cp.encrypt = on; - rq.ogf = OGF_LINK_CTL; - rq.ocf = OCF_SET_CONN_ENCRYPT; + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_SET_CONN_ENCRYPT; rq.cparam = &cp; - rq.clen = SET_CONN_ENCRYPT_CP_SIZE; - rq.event = EVT_ENCRYPT_CHANGE; - rq.rlen = EVT_ENCRYPT_CHANGE_SIZE; + rq.clen = SET_CONN_ENCRYPT_CP_SIZE; + rq.event = EVT_ENCRYPT_CHANGE; + rq.rlen = EVT_ENCRYPT_CHANGE_SIZE; rq.rparam = &rp; if (hci_send_req(dd, &rq, to) < 0) return -1; @@ -1133,19 +1133,79 @@ int hci_switch_role(int dd, bdaddr_t peer, int role, int to) struct hci_request rq; cp.bdaddr = peer; - cp.role = role; - rq.ogf = OGF_LINK_POLICY; - rq.ocf = OCF_SWITCH_ROLE; + cp.role = role; + rq.ogf = OGF_LINK_POLICY; + rq.ocf = OCF_SWITCH_ROLE; + rq.cparam = &cp; + rq.clen = SWITCH_ROLE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_ROLE_CHANGE_SIZE; + rq.event = EVT_ROLE_CHANGE; + if (hci_send_req(dd, &rq, to) < 0) + return -1; + if (rp.status) { + errno = EIO; + return -1; + } + return 0; +} + +int hci_park_mode (int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to) +{ + park_mode_cp cp; + evt_mode_change rp; + struct hci_request rq; + + memset(&cp, 0, sizeof (cp)); + cp.handle = handle; + cp.max_interval = max_interval; + cp.min_interval = min_interval; + + memset(&rq, 0, sizeof (rq)); + rq.ogf = OGF_LINK_POLICY; + rq.ocf = OCF_PARK_MODE; + rq.event = EVT_MODE_CHANGE; rq.cparam = &cp; - rq.clen = SWITCH_ROLE_CP_SIZE; + rq.clen = PARK_MODE_CP_SIZE; rq.rparam = &rp; - rq.rlen = EVT_ROLE_CHANGE_SIZE; - rq.event = EVT_ROLE_CHANGE; + rq.rlen = EVT_MODE_CHANGE_SIZE; + if (hci_send_req(dd, &rq, to) < 0) return -1; + if (rp.status) { errno = EIO; return -1; } + + return 0; +} + +int hci_exit_park_mode(int dd, uint16_t handle, int to) +{ + exit_park_mode_cp cp; + evt_mode_change rp; + struct hci_request rq; + + memset(&cp, 0, sizeof (cp)); + cp.handle = handle; + + memset (&rq, 0, sizeof (rq)); + rq.ogf = OGF_LINK_POLICY; + rq.ocf = OCF_EXIT_PARK_MODE; + rq.event = EVT_MODE_CHANGE; + rq.cparam = &cp; + rq.clen = EXIT_PARK_MODE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_MODE_CHANGE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + return 0; } -- cgit From 5624d6cc20e5fb63d4b34b672b2421eb38b849e5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jun 2003 21:17:37 +0000 Subject: Add functions for park mode --- include/hci_lib.h | 2 ++ src/hci.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 31995411..6b7b6f63 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -84,6 +84,8 @@ int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, int on, int to); // role == 0 is master, 1 is slave int hci_switch_role(int dd, bdaddr_t peer, int role, int to); +int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); +int hci_exit_park_mode(int dd, uint16_t handle, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/hci.c b/src/hci.c index 676b8af8..b01dec97 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1150,7 +1150,7 @@ int hci_switch_role(int dd, bdaddr_t peer, int role, int to) return 0; } -int hci_park_mode (int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to) +int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to) { park_mode_cp cp; evt_mode_change rp; -- cgit From 30bc21fa83734b36204d85ec00481ee836ef13d5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 2 Jul 2003 23:49:47 +0000 Subject: Sort HCI commands --- include/hci.h | 630 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 316 insertions(+), 314 deletions(-) diff --git a/include/hci.h b/include/hci.h index 4e881275..99f01f7f 100644 --- a/include/hci.h +++ b/include/hci.h @@ -216,361 +216,147 @@ enum { #define HCI_LM_RELIABLE 0x0010 /* ----- HCI Commands ----- */ -/* OGF & OCF values */ -/* Informational Parameters */ -#define OGF_INFO_PARAM 0x04 - -#define OCF_READ_LOCAL_VERSION 0x0001 -typedef struct { - uint8_t status; - uint8_t hci_ver; - uint16_t hci_rev; - uint8_t lmp_ver; - uint16_t manufacturer; - uint16_t lmp_subver; -} __attribute__ ((packed)) read_local_version_rp; -#define READ_LOCAL_VERSION_RP_SIZE 9 +/* Link Control */ +#define OGF_LINK_CTL 0x01 -#define OCF_READ_LOCAL_FEATURES 0x0003 +#define OCF_INQUIRY 0x0001 typedef struct { - uint8_t status; - uint8_t features[8]; -} __attribute__ ((packed)) read_local_features_rp; + uint8_t lap[3]; + uint8_t length; /* 1.28s units */ + uint8_t num_rsp; +} __attribute__ ((packed)) inquiry_cp; +#define INQUIRY_CP_SIZE 5 -#define OCF_READ_BUFFER_SIZE 0x0005 typedef struct { uint8_t status; - uint16_t acl_mtu; - uint8_t sco_mtu; - uint16_t acl_max_pkt; - uint16_t sco_max_pkt; -} __attribute__ ((packed)) read_buffer_size_rp; - -#define OCF_READ_BD_ADDR 0x0009 -typedef struct { - uint8_t status; bdaddr_t bdaddr; -} __attribute__ ((packed)) read_bd_addr_rp; - -/* Host Controller and Baseband */ -#define OGF_HOST_CTL 0x03 -#define OCF_RESET 0x0003 - -#define OCF_READ_PAGE_TIMEOUT 0x0017 -typedef struct { - uint8_t status; - uint16_t timeout; -} __attribute__ ((packed)) read_page_timeout_rp; -#define READ_PAGE_TIMEOUT_RP_SIZE 3 - -#define OCF_WRITE_PAGE_TIMEOUT 0x0018 -typedef struct { - uint16_t timeout; -} __attribute__ ((packed)) write_page_timeout_cp; -#define WRITE_PAGE_TIMEOUT_CP_SIZE 2 - -#define OCF_READ_PAGE_ACTIVITY 0x001B -typedef struct { - uint8_t status; - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) read_page_activity_rp; -#define READ_PAGE_ACTIVITY_RP_SIZE 5 - -#define OCF_WRITE_PAGE_ACTIVITY 0x001C -typedef struct { - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) write_page_activity_cp; -#define WRITE_PAGE_ACTIVITY_CP_SIZE 4 - -#define OCF_READ_INQ_ACTIVITY 0x001D -typedef struct { - uint8_t status; - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) read_inq_activity_rp; -#define READ_INQ_ACTIVITY_RP_SIZE 5 - -#define OCF_WRITE_INQ_ACTIVITY 0x001E -typedef struct { - uint16_t interval; - uint16_t window; -} __attribute__ ((packed)) write_inq_activity_cp; -#define WRITE_INQ_ACTIVITY_CP_SIZE 4 - -#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 -typedef struct { - uint8_t status; - uint16_t handle; - uint16_t link_sup_to; -} __attribute__ ((packed)) read_link_supervision_timeout_rp; -#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 - -#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 -typedef struct { - uint16_t handle; - uint16_t link_sup_to; -} __attribute__ ((packed)) write_link_supervision_timeout_cp; -#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 - -#define OCF_READ_AUTH_ENABLE 0x001F -#define OCF_WRITE_AUTH_ENABLE 0x0020 - #define AUTH_DISABLED 0x00 - #define AUTH_ENABLED 0x01 - -#define OCF_READ_ENCRYPT_MODE 0x0021 -#define OCF_WRITE_ENCRYPT_MODE 0x0022 - #define ENCRYPT_DISABLED 0x00 - #define ENCRYPT_P2P 0x01 - #define ENCRYPT_BOTH 0x02 - -#define OCF_WRITE_CA_TIMEOUT 0x0016 -#define OCF_WRITE_PG_TIMEOUT 0x0018 - -#define OCF_WRITE_SCAN_ENABLE 0x001A - #define SCAN_DISABLED 0x00 - #define SCAN_INQUIRY 0x01 - #define SCAN_PAGE 0x02 - -#define OCF_SET_EVENT_FLT 0x0005 -typedef struct { - uint8_t flt_type; - uint8_t cond_type; - uint8_t condition[0]; -} __attribute__ ((packed)) set_event_flt_cp; -#define SET_EVENT_FLT_CP_SIZE 2 - -/* Filter types */ -#define FLT_CLEAR_ALL 0x00 -#define FLT_INQ_RESULT 0x01 -#define FLT_CONN_SETUP 0x02 - -/* CONN_SETUP Condition types */ -#define CONN_SETUP_ALLOW_ALL 0x00 -#define CONN_SETUP_ALLOW_CLASS 0x01 -#define CONN_SETUP_ALLOW_BDADDR 0x02 - -/* CONN_SETUP Conditions */ -#define CONN_SETUP_AUTO_OFF 0x01 -#define CONN_SETUP_AUTO_ON 0x02 - -#define OCF_CHANGE_LOCAL_NAME 0x0013 -typedef struct { - uint8_t name[248]; -} __attribute__ ((packed)) change_local_name_cp; -#define CHANGE_LOCAL_NAME_CP_SIZE 248 - -#define OCF_READ_LOCAL_NAME 0x0014 -typedef struct { - uint8_t status; - uint8_t name[248]; -} __attribute__ ((packed)) read_local_name_rp; -#define READ_LOCAL_NAME_RP_SIZE 249 - -#define OCF_READ_CLASS_OF_DEV 0x0023 -typedef struct { - uint8_t status; - uint8_t dev_class[3]; -} __attribute__ ((packed)) read_class_of_dev_rp; -#define READ_CLASS_OF_DEV_RP_SIZE 4 - -#define OCF_WRITE_CLASS_OF_DEV 0x0024 -typedef struct { - uint8_t dev_class[3]; -} __attribute__ ((packed)) write_class_of_dev_cp; -#define WRITE_CLASS_OF_DEV_CP_SIZE 3 - -#define OCF_READ_VOICE_SETTING 0x0025 -typedef struct { - uint8_t status; - uint16_t voice_setting; -} __attribute__ ((packed)) read_voice_setting_rp; -#define READ_VOICE_SETTING_RP_SIZE 3 - -#define OCF_WRITE_VOICE_SETTING 0x0026 -typedef struct { - uint16_t voice_setting; -} __attribute__ ((packed)) write_voice_setting_cp; -#define WRITE_VOICE_SETTING_CP_SIZE 2 - -#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D -typedef struct { - uint16_t handle; - uint8_t type; -} __attribute__ ((packed)) read_transmit_power_level_cp; -#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3 -typedef struct { - uint8_t status; - uint16_t handle; - int8_t level; -} __attribute__ ((packed)) read_transmit_power_level_rp; -#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 +} __attribute__ ((packed)) status_bdaddr_rp; +#define STATUS_BDADDR_RP_SIZE 7 -#define OCF_HOST_BUFFER_SIZE 0x0033 -typedef struct { - uint16_t acl_mtu; - uint8_t sco_mtu; - uint16_t acl_max_pkt; - uint16_t sco_max_pkt; -} __attribute__ ((packed)) host_buffer_size_cp; -#define HOST_BUFFER_SIZE_CP_SIZE 7 +#define OCF_INQUIRY_CANCEL 0x0002 -#define MAX_IAC_LAP 0x40 -#define OCF_READ_CURRENT_IAC_LAP 0x0039 +#define OCF_PERIODIC_INQUIRY 0x0003 typedef struct { - uint8_t status; - uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; -} __attribute__ ((packed)) read_current_iac_lap_rp; -#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP - -#define OCF_WRITE_CURRENT_IAC_LAP 0x003A -typedef struct { - uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; -} __attribute__ ((packed)) write_current_iac_lap_cp; -#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP + uint16_t max_period; /* 1.28s units */ + uint16_t min_period; /* 1.28s units */ + uint8_t lap[3]; + uint8_t length; /* 1.28s units */ + uint8_t num_rsp; +} __attribute__ ((packed)) periodic_inquiry_cp; +#define PERIODIC_INQUIRY_CP_SIZE 9 -/* Link Control */ -#define OGF_LINK_CTL 0x01 +#define OCF_EXIT_PERIODIC_INQUIRY 0x0004 -#define OCF_CREATE_CONN 0x0005 +#define OCF_CREATE_CONN 0x0005 typedef struct { bdaddr_t bdaddr; - uint16_t pkt_type; - uint8_t pscan_rep_mode; - uint8_t pscan_mode; - uint16_t clock_offset; - uint8_t role_switch; + uint16_t pkt_type; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; + uint16_t clock_offset; + uint8_t role_switch; } __attribute__ ((packed)) create_conn_cp; #define CREATE_CONN_CP_SIZE 13 -#define OCF_ACCEPT_CONN_REQ 0x0009 -typedef struct { - bdaddr_t bdaddr; - uint8_t role; -} __attribute__ ((packed)) accept_conn_req_cp; -#define ACCEPT_CONN_REQ_CP_SIZE 7 - -#define OCF_REJECT_CONN_REQ 0x000a -typedef struct { - bdaddr_t bdaddr; - uint8_t reason; -} __attribute__ ((packed)) reject_conn_req_cp; -#define REJECT_CONN_REQ_CP_SIZE 7 - -#define OCF_DISCONNECT 0x0006 +#define OCF_DISCONNECT 0x0006 typedef struct { - uint16_t handle; - uint8_t reason; + uint16_t handle; + uint8_t reason; } __attribute__ ((packed)) disconnect_cp; #define DISCONNECT_CP_SIZE 3 -#define OCF_ADD_SCO 0x0007 +#define OCF_ADD_SCO 0x0007 typedef struct { - uint16_t handle; - uint16_t pkt_type; + uint16_t handle; + uint16_t pkt_type; } __attribute__ ((packed)) add_sco_cp; #define ADD_SCO_CP_SIZE 4 -#define OCF_INQUIRY 0x0001 -typedef struct { - uint8_t lap[3]; - uint8_t length; - uint8_t num_rsp; -} __attribute__ ((packed)) inquiry_cp; -#define INQUIRY_CP_SIZE 5 - +#define OCF_ACCEPT_CONN_REQ 0x0009 typedef struct { - uint8_t status; bdaddr_t bdaddr; -} __attribute__ ((packed)) status_bdaddr_rp; -#define STATUS_BDADDR_RP_SIZE 7 - -#define OCF_INQUIRY_CANCEL 0x0002 + uint8_t role; +} __attribute__ ((packed)) accept_conn_req_cp; +#define ACCEPT_CONN_REQ_CP_SIZE 7 -#define OCF_PERIODIC_INQUIRY 0x0003 +#define OCF_REJECT_CONN_REQ 0x000a typedef struct { - uint16_t max_period; /* 1.28s units */ - uint16_t min_period; /* 1.28s units */ - uint8_t lap[3]; - uint8_t length; /* 1.28s units */ - uint8_t num_rsp; -} __attribute__ ((packed)) periodic_inquiry_cp; -#define PERIODIC_INQUIRY_CP_SIZE 9 - -#define OCF_EXIT_PERIODIC_INQUIRY 0x0004 + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) reject_conn_req_cp; +#define REJECT_CONN_REQ_CP_SIZE 7 -#define OCF_LINK_KEY_REPLY 0x000B -#define OCF_LINK_KEY_NEG_REPLY 0x000C +#define OCF_LINK_KEY_REPLY 0x000B typedef struct { bdaddr_t bdaddr; - uint8_t link_key[16]; + uint8_t link_key[16]; } __attribute__ ((packed)) link_key_reply_cp; #define LINK_KEY_REPLY_CP_SIZE 22 -#define OCF_PIN_CODE_REPLY 0x000D -#define OCF_PIN_CODE_NEG_REPLY 0x000E +#define OCF_LINK_KEY_NEG_REPLY 0x000C + +#define OCF_PIN_CODE_REPLY 0x000D typedef struct { bdaddr_t bdaddr; - uint8_t pin_len; - uint8_t pin_code[16]; + uint8_t pin_len; + uint8_t pin_code[16]; } __attribute__ ((packed)) pin_code_reply_cp; #define PIN_CODE_REPLY_CP_SIZE 23 -#define OCF_SET_CONN_PTYPE 0x000F +#define OCF_PIN_CODE_NEG_REPLY 0x000E + +#define OCF_SET_CONN_PTYPE 0x000F typedef struct { uint16_t handle; uint16_t pkt_type; } __attribute__ ((packed)) set_conn_ptype_cp; #define SET_CONN_PTYPE_CP_SIZE 4 -#define OCF_AUTH_REQUESTED 0x0011 +#define OCF_AUTH_REQUESTED 0x0011 typedef struct { uint16_t handle; } __attribute__ ((packed)) auth_requested_cp; #define AUTH_REQUESTED_CP_SIZE 2 -#define OCF_SET_CONN_ENCRYPT 0x0013 +#define OCF_SET_CONN_ENCRYPT 0x0013 typedef struct { uint16_t handle; - uint8_t encrypt; + uint8_t encrypt; } __attribute__ ((packed)) set_conn_encrypt_cp; #define SET_CONN_ENCRYPT_CP_SIZE 3 -#define OCF_REMOTE_NAME_REQ 0x0019 +#define OCF_REMOTE_NAME_REQ 0x0019 typedef struct { bdaddr_t bdaddr; - uint8_t pscan_rep_mode; - uint8_t pscan_mode; + uint8_t pscan_rep_mode; + uint8_t pscan_mode; uint16_t clock_offset; } __attribute__ ((packed)) remote_name_req_cp; #define REMOTE_NAME_REQ_CP_SIZE 10 -#define OCF_READ_REMOTE_FEATURES 0x001B +#define OCF_READ_REMOTE_FEATURES 0x001B typedef struct { uint16_t handle; } __attribute__ ((packed)) read_remote_features_cp; #define READ_REMOTE_FEATURES_CP_SIZE 2 -#define OCF_READ_REMOTE_VERSION 0x001D +#define OCF_READ_REMOTE_VERSION 0x001D typedef struct { uint16_t handle; } __attribute__ ((packed)) read_remote_version_cp; #define READ_REMOTE_VERSION_CP_SIZE 2 -#define OCF_READ_CLOCK_OFFSET 0x001F +#define OCF_READ_CLOCK_OFFSET 0x001F typedef struct { uint16_t handle; } __attribute__ ((packed)) read_clock_offset_cp; #define READ_CLOCK_OFFSET_CP_SIZE 2 /* Link Policy */ -#define OGF_LINK_POLICY 0x02 +#define OGF_LINK_POLICY 0x02 -#define OCF_HOLD_MODE 0x0001 +#define OCF_HOLD_MODE 0x0001 typedef struct { uint16_t handle; uint16_t max_interval; @@ -578,7 +364,7 @@ typedef struct { } __attribute__ ((packed)) hold_mode_cp; #define HOLD_MODE_CP_SIZE 6 -#define OCF_SNIFF_MODE 0x0003 +#define OCF_SNIFF_MODE 0x0003 typedef struct { uint16_t handle; uint16_t max_interval; @@ -588,13 +374,13 @@ typedef struct { } __attribute__ ((packed)) sniff_mode_cp; #define SNIFF_MODE_CP_SIZE 10 -#define OCF_EXIT_SNIFF_MODE 0x0004 +#define OCF_EXIT_SNIFF_MODE 0x0004 typedef struct { uint16_t handle; } __attribute__ ((packed)) exit_sniff_mode_cp; #define EXIT_SNIFF_MODE_CP_SIZE 2 -#define OCF_PARK_MODE 0x0005 +#define OCF_PARK_MODE 0x0005 typedef struct { uint16_t handle; uint16_t max_interval; @@ -602,22 +388,21 @@ typedef struct { } __attribute__ ((packed)) park_mode_cp; #define PARK_MODE_CP_SIZE 6 -#define OCF_EXIT_PARK_MODE 0x0006 +#define OCF_EXIT_PARK_MODE 0x0006 typedef struct { uint16_t handle; } __attribute__ ((packed)) exit_park_mode_cp; #define EXIT_PARK_MODE_CP_SIZE 2 +#define OCF_QOS_SETUP 0x0007 typedef struct { - uint8_t service_type; /* 1 = best effort */ + uint8_t service_type; /* 1 = best effort */ uint32_t token_rate; /* Byte per seconds */ uint32_t peak_bandwidth; /* Byte per seconds */ uint32_t latency; /* Microseconds */ uint32_t delay_variation; /* Microseconds */ } __attribute__ ((packed)) hci_qos; #define HCI_QOS_CP_SIZE 17 - -#define OCF_QOS_SETUP 0x0007 typedef struct { uint16_t handle; uint8_t flags; /* Reserved */ @@ -625,19 +410,26 @@ typedef struct { } __attribute__ ((packed)) qos_setup_cp; #define QOS_SETUP_CP_SIZE (3 + HCI_QOS_CP_SIZE) -#define OCF_ROLE_DISCOVERY 0x0009 +#define OCF_ROLE_DISCOVERY 0x0009 typedef struct { uint16_t handle; } __attribute__ ((packed)) role_discovery_cp; #define ROLE_DISCOVERY_CP_SIZE 2 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t role; + uint8_t role; } __attribute__ ((packed)) role_discovery_rp; #define ROLE_DISCOVERY_RP_SIZE 4 -#define OCF_READ_LINK_POLICY 0x000C +#define OCF_SWITCH_ROLE 0x000B +typedef struct { + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) switch_role_cp; +#define SWITCH_ROLE_CP_SIZE 7 + +#define OCF_READ_LINK_POLICY 0x000C typedef struct { uint16_t handle; } __attribute__ ((packed)) read_link_policy_cp; @@ -649,14 +441,7 @@ typedef struct { } __attribute__ ((packed)) read_link_policy_rp; #define READ_LINK_POLICY_RP_SIZE 5 -#define OCF_SWITCH_ROLE 0x000B -typedef struct { - bdaddr_t bdaddr; - uint8_t role; -} __attribute__ ((packed)) switch_role_cp; -#define SWITCH_ROLE_CP_SIZE 7 - -#define OCF_WRITE_LINK_POLICY 0x000D +#define OCF_WRITE_LINK_POLICY 0x000D typedef struct { uint16_t handle; uint16_t policy; @@ -668,47 +453,264 @@ typedef struct { } __attribute__ ((packed)) write_link_policy_rp; #define WRITE_LINK_POLICY_RP_SIZE 3 +/* Host Controller and Baseband */ +#define OGF_HOST_CTL 0x03 + +#define OCF_RESET 0x0003 + +#define OCF_SET_EVENT_FLT 0x0005 +typedef struct { + uint8_t flt_type; + uint8_t cond_type; + uint8_t condition[0]; +} __attribute__ ((packed)) set_event_flt_cp; +#define SET_EVENT_FLT_CP_SIZE 2 + +/* Filter types */ +#define FLT_CLEAR_ALL 0x00 +#define FLT_INQ_RESULT 0x01 +#define FLT_CONN_SETUP 0x02 +/* CONN_SETUP Condition types */ +#define CONN_SETUP_ALLOW_ALL 0x00 +#define CONN_SETUP_ALLOW_CLASS 0x01 +#define CONN_SETUP_ALLOW_BDADDR 0x02 +/* CONN_SETUP Conditions */ +#define CONN_SETUP_AUTO_OFF 0x01 +#define CONN_SETUP_AUTO_ON 0x02 + +#define OCF_CHANGE_LOCAL_NAME 0x0013 +typedef struct { + uint8_t name[248]; +} __attribute__ ((packed)) change_local_name_cp; +#define CHANGE_LOCAL_NAME_CP_SIZE 248 + +#define OCF_READ_LOCAL_NAME 0x0014 +typedef struct { + uint8_t status; + uint8_t name[248]; +} __attribute__ ((packed)) read_local_name_rp; +#define READ_LOCAL_NAME_RP_SIZE 249 + +#define OCF_WRITE_CA_TIMEOUT 0x0016 +#define OCF_WRITE_PG_TIMEOUT 0x0018 + +#define OCF_READ_PAGE_TIMEOUT 0x0017 +typedef struct { + uint8_t status; + uint16_t timeout; +} __attribute__ ((packed)) read_page_timeout_rp; +#define READ_PAGE_TIMEOUT_RP_SIZE 3 + +#define OCF_WRITE_PAGE_TIMEOUT 0x0018 +typedef struct { + uint16_t timeout; +} __attribute__ ((packed)) write_page_timeout_cp; +#define WRITE_PAGE_TIMEOUT_CP_SIZE 2 + +#define OCF_WRITE_SCAN_ENABLE 0x001A + #define SCAN_DISABLED 0x00 + #define SCAN_INQUIRY 0x01 + #define SCAN_PAGE 0x02 + +#define OCF_READ_PAGE_ACTIVITY 0x001B +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_page_activity_rp; +#define READ_PAGE_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_PAGE_ACTIVITY 0x001C +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_page_activity_cp; +#define WRITE_PAGE_ACTIVITY_CP_SIZE 4 + +#define OCF_READ_INQ_ACTIVITY 0x001D +typedef struct { + uint8_t status; + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) read_inq_activity_rp; +#define READ_INQ_ACTIVITY_RP_SIZE 5 + +#define OCF_WRITE_INQ_ACTIVITY 0x001E +typedef struct { + uint16_t interval; + uint16_t window; +} __attribute__ ((packed)) write_inq_activity_cp; +#define WRITE_INQ_ACTIVITY_CP_SIZE 4 + +#define OCF_READ_AUTH_ENABLE 0x001F + +#define OCF_WRITE_AUTH_ENABLE 0x0020 + #define AUTH_DISABLED 0x00 + #define AUTH_ENABLED 0x01 + +#define OCF_READ_ENCRYPT_MODE 0x0021 + +#define OCF_WRITE_ENCRYPT_MODE 0x0022 + #define ENCRYPT_DISABLED 0x00 + #define ENCRYPT_P2P 0x01 + #define ENCRYPT_BOTH 0x02 + +#define OCF_READ_CLASS_OF_DEV 0x0023 +typedef struct { + uint8_t status; + uint8_t dev_class[3]; +} __attribute__ ((packed)) read_class_of_dev_rp; +#define READ_CLASS_OF_DEV_RP_SIZE 4 + +#define OCF_WRITE_CLASS_OF_DEV 0x0024 +typedef struct { + uint8_t dev_class[3]; +} __attribute__ ((packed)) write_class_of_dev_cp; +#define WRITE_CLASS_OF_DEV_CP_SIZE 3 + +#define OCF_READ_VOICE_SETTING 0x0025 +typedef struct { + uint8_t status; + uint16_t voice_setting; +} __attribute__ ((packed)) read_voice_setting_rp; +#define READ_VOICE_SETTING_RP_SIZE 3 + +#define OCF_WRITE_VOICE_SETTING 0x0026 +typedef struct { + uint16_t voice_setting; +} __attribute__ ((packed)) write_voice_setting_cp; +#define WRITE_VOICE_SETTING_CP_SIZE 2 + +#define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D +typedef struct { + uint16_t handle; + uint8_t type; +} __attribute__ ((packed)) read_transmit_power_level_cp; +#define READ_TRANSMIT_POWER_LEVEL_CP_SIZE 3 +typedef struct { + uint8_t status; + uint16_t handle; + int8_t level; +} __attribute__ ((packed)) read_transmit_power_level_rp; +#define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 + +#define OCF_HOST_BUFFER_SIZE 0x0033 +typedef struct { + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) host_buffer_size_cp; +#define HOST_BUFFER_SIZE_CP_SIZE 7 + +#define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) read_link_supervision_timeout_rp; +#define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 + +#define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 +typedef struct { + uint16_t handle; + uint16_t link_sup_to; +} __attribute__ ((packed)) write_link_supervision_timeout_cp; +#define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 + +#define MAX_IAC_LAP 0x40 +#define OCF_READ_CURRENT_IAC_LAP 0x0039 +typedef struct { + uint8_t status; + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) read_current_iac_lap_rp; +#define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP + +#define OCF_WRITE_CURRENT_IAC_LAP 0x003A +typedef struct { + uint8_t num_current_iac; + uint8_t lap[3][MAX_IAC_LAP]; +} __attribute__ ((packed)) write_current_iac_lap_cp; +#define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP + +/* Informational Parameters */ +#define OGF_INFO_PARAM 0x04 + +#define OCF_READ_LOCAL_VERSION 0x0001 +typedef struct { + uint8_t status; + uint8_t hci_ver; + uint16_t hci_rev; + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) read_local_version_rp; +#define READ_LOCAL_VERSION_RP_SIZE 9 + +#define OCF_READ_LOCAL_FEATURES 0x0003 +typedef struct { + uint8_t status; + uint8_t features[8]; +} __attribute__ ((packed)) read_local_features_rp; + +#define OCF_READ_BUFFER_SIZE 0x0005 +typedef struct { + uint8_t status; + uint16_t acl_mtu; + uint8_t sco_mtu; + uint16_t acl_max_pkt; + uint16_t sco_max_pkt; +} __attribute__ ((packed)) read_buffer_size_rp; + +#define OCF_READ_BD_ADDR 0x0009 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) read_bd_addr_rp; + /* Status params */ -#define OGF_STATUS_PARAM 0x05 +#define OGF_STATUS_PARAM 0x05 -#define OCF_READ_FAILED_CONTACT_COUNTER 0x0001 +#define OCF_READ_FAILED_CONTACT_COUNTER 0x0001 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t counter; + uint8_t counter; } __attribute__ ((packed)) read_failed_contact_counter_rp; #define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4 - -#define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 + +#define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; } __attribute__ ((packed)) reset_failed_contact_counter_rp; -#define OCF_RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 - -#define OCF_GET_LINK_QUALITY 0x0003 +#define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 + +#define OCF_GET_LINK_QUALITY 0x0003 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t link_quality; + uint8_t link_quality; } __attribute__ ((packed)) get_link_quality_rp; #define GET_LINK_QUALITY_RP_SIZE 4 - -#define OCF_READ_RSSI 0x0005 + +#define OCF_READ_RSSI 0x0005 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - int8_t rssi; + int8_t rssi; } __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 - + /* Testing commands */ -#define OGF_TESTING_CMD 0x3e +#define OGF_TESTING_CMD 0x3e /* Vendor specific commands */ -#define OGF_VENDOR_CMD 0x3f +#define OGF_VENDOR_CMD 0x3f /* ---- HCI Events ---- */ + #define EVT_INQUIRY_COMPLETE 0x01 #define EVT_INQUIRY_RESULT 0x02 -- cgit From 630afac09ee16b0e398b2ab87beba55dec8d7f89 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Jul 2003 00:02:25 +0000 Subject: Sort HCI events --- include/hci.h | 176 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/include/hci.h b/include/hci.h index 99f01f7f..89ef19b6 100644 --- a/include/hci.h +++ b/include/hci.h @@ -280,7 +280,7 @@ typedef struct { } __attribute__ ((packed)) accept_conn_req_cp; #define ACCEPT_CONN_REQ_CP_SIZE 7 -#define OCF_REJECT_CONN_REQ 0x000a +#define OCF_REJECT_CONN_REQ 0x000A typedef struct { bdaddr_t bdaddr; uint8_t reason; @@ -711,143 +711,155 @@ typedef struct { /* ---- HCI Events ---- */ -#define EVT_INQUIRY_COMPLETE 0x01 +#define EVT_INQUIRY_COMPLETE 0x01 -#define EVT_INQUIRY_RESULT 0x02 +#define EVT_INQUIRY_RESULT 0x02 typedef struct { bdaddr_t bdaddr; - uint8_t pscan_rep_mode; - uint8_t pscan_period_mode; - uint8_t pscan_mode; - uint8_t dev_class[3]; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t pscan_mode; + uint8_t dev_class[3]; uint16_t clock_offset; } __attribute__ ((packed)) inquiry_info; #define INQUIRY_INFO_SIZE 14 -#define EVT_CONN_COMPLETE 0x03 +#define EVT_CONN_COMPLETE 0x03 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; bdaddr_t bdaddr; - uint8_t link_type; - uint8_t encr_mode; + uint8_t link_type; + uint8_t encr_mode; } __attribute__ ((packed)) evt_conn_complete; #define EVT_CONN_COMPLETE_SIZE 13 -#define EVT_CONN_REQUEST 0x04 +#define EVT_CONN_REQUEST 0x04 typedef struct { bdaddr_t bdaddr; - uint8_t dev_class[3]; + uint8_t dev_class[3]; uint8_t link_type; } __attribute__ ((packed)) evt_conn_request; #define EVT_CONN_REQUEST_SIZE 10 -#define EVT_DISCONN_COMPLETE 0x05 +#define EVT_DISCONN_COMPLETE 0x05 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t reason; + uint8_t reason; } __attribute__ ((packed)) evt_disconn_complete; #define EVT_DISCONN_COMPLETE_SIZE 4 -#define EVT_AUTH_COMPLETE 0x06 +#define EVT_AUTH_COMPLETE 0x06 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; } __attribute__ ((packed)) evt_auth_complete; #define EVT_AUTH_COMPLETE_SIZE 3 #define EVT_REMOTE_NAME_REQ_COMPLETE 0x07 typedef struct { - uint8_t status; + uint8_t status; bdaddr_t bdaddr; - uint8_t name[248]; + uint8_t name[248]; } __attribute__ ((packed)) evt_remote_name_req_complete; #define EVT_REMOTE_NAME_REQ_COMPLETE_SIZE 255 -#define EVT_ENCRYPT_CHANGE 0x08 +#define EVT_ENCRYPT_CHANGE 0x08 typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t encrypt; + uint8_t encrypt; } __attribute__ ((packed)) evt_encrypt_change; #define EVT_ENCRYPT_CHANGE_SIZE 5 -#define EVT_QOS_SETUP_COMPLETE 0x0D +#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { - uint8_t status; + uint8_t status; uint16_t handle; - uint8_t flags; /* Reserved */ - hci_qos qos; -} __attribute__ ((packed)) evt_qos_setup_complete; -#define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) + uint8_t features[8]; +} __attribute__ ((packed)) evt_read_remote_features_complete; +#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11 -#define EVT_MODE_CHANGE 0x14 +#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C typedef struct { uint8_t status; uint16_t handle; - uint8_t mode; - uint16_t interval; -} __attribute__ ((packed)) evt_mode_change; -#define EVT_MODE_CHANGE_SIZE 6 + uint8_t lmp_ver; + uint16_t manufacturer; + uint16_t lmp_subver; +} __attribute__ ((packed)) evt_read_remote_version_complete; +#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8 -#define EVT_QOS_VIOLATION 0x1E +#define EVT_QOS_SETUP_COMPLETE 0x0D typedef struct { + uint8_t status; uint16_t handle; -} __attribute__ ((packed)) evt_qos_violation; -#define EVT_QOS_VIOLATION_SIZE 2 + uint8_t flags; /* Reserved */ + hci_qos qos; +} __attribute__ ((packed)) evt_qos_setup_complete; +#define EVT_QOS_SETUP_COMPLETE_SIZE (4 + HCI_QOS_CP_SIZE) -#define EVT_CMD_COMPLETE 0x0e +#define EVT_CMD_COMPLETE 0x0E typedef struct { - uint8_t ncmd; - uint16_t opcode; + uint8_t ncmd; + uint16_t opcode; } __attribute__ ((packed)) evt_cmd_complete; #define EVT_CMD_COMPLETE_SIZE 3 -#define EVT_CMD_STATUS 0x0f +#define EVT_CMD_STATUS 0x0F typedef struct { - uint8_t status; - uint8_t ncmd; + uint8_t status; + uint8_t ncmd; uint16_t opcode; } __attribute__ ((packed)) evt_cmd_status; #define EVT_CMD_STATUS_SIZE 4 -#define EVT_NUM_COMP_PKTS 0x13 +#define EVT_ROLE_CHANGE 0x12 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; + uint8_t role; +} __attribute__ ((packed)) evt_role_change; +#define EVT_ROLE_CHANGE_SIZE 8 + +#define EVT_NUM_COMP_PKTS 0x13 typedef struct { uint8_t num_hndl; /* variable length part */ } __attribute__ ((packed)) evt_num_comp_pkts; #define EVT_NUM_COMP_PKTS_SIZE 1 -#define EVT_ROLE_CHANGE 0x12 +#define EVT_MODE_CHANGE 0x14 typedef struct { - uint8_t status; - bdaddr_t bdaddr; - uint8_t role; -} __attribute__ ((packed)) evt_role_change; -#define EVT_ROLE_CHANGE_SIZE 8 + uint8_t status; + uint16_t handle; + uint8_t mode; + uint16_t interval; +} __attribute__ ((packed)) evt_mode_change; +#define EVT_MODE_CHANGE_SIZE 6 -#define EVT_PIN_CODE_REQ 0x16 +#define EVT_PIN_CODE_REQ 0x16 typedef struct { bdaddr_t bdaddr; } __attribute__ ((packed)) evt_pin_code_req; #define EVT_PIN_CODE_REQ_SIZE 6 -#define EVT_LINK_KEY_REQ 0x17 +#define EVT_LINK_KEY_REQ 0x17 typedef struct { bdaddr_t bdaddr; } __attribute__ ((packed)) evt_link_key_req; #define EVT_LINK_KEY_REQ_SIZE 6 -#define EVT_LINK_KEY_NOTIFY 0x18 +#define EVT_LINK_KEY_NOTIFY 0x18 typedef struct { bdaddr_t bdaddr; - uint8_t link_key[16]; - uint8_t key_type; + uint8_t link_key[16]; + uint8_t key_type; } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 -#define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C +#define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C typedef struct { uint8_t status; uint16_t handle; @@ -855,41 +867,33 @@ typedef struct { } __attribute__ ((packed)) evt_read_clock_offset_complete; #define EVT_READ_CLOCK_OFFSET_COMPLETE_SIZE 5 -#define EVT_CONN_PTYPE_CHANGED 0x1D +#define EVT_CONN_PTYPE_CHANGED 0x1D typedef struct { - uint8_t status; - uint16_t handle; - uint16_t ptype; + uint8_t status; + uint16_t handle; + uint16_t ptype; } __attribute__ ((packed)) evt_conn_ptype_changed; #define EVT_CONN_PTYPE_CHANGED_SIZE 5 -#define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B +#define EVT_QOS_VIOLATION 0x1E typedef struct { - uint8_t status; uint16_t handle; - uint8_t features[8]; -} __attribute__ ((packed)) evt_read_remote_features_complete; -#define EVT_READ_REMOTE_FEATURES_COMPLETE_SIZE 11 +} __attribute__ ((packed)) evt_qos_violation; +#define EVT_QOS_VIOLATION_SIZE 2 -#define EVT_READ_REMOTE_VERSION_COMPLETE 0x0C -typedef struct { - uint8_t status; - uint16_t handle; - uint8_t lmp_ver; - uint16_t manufacturer; - uint16_t lmp_subver; -} __attribute__ ((packed)) evt_read_remote_version_complete; -#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8 +#define EVT_TESTING 0xFE + +#define EVT_VENDOR 0xFF /* Internal events generated by BlueZ stack */ -#define EVT_STACK_INTERNAL 0xfd +#define EVT_STACK_INTERNAL 0xFD typedef struct { uint16_t type; - uint8_t data[0]; + uint8_t data[0]; } __attribute__ ((packed)) evt_stack_internal; #define EVT_STACK_INTERNAL_SIZE 2 -#define EVT_SI_DEVICE 0x01 +#define EVT_SI_DEVICE 0x01 typedef struct { uint16_t event; uint16_t dev_id; @@ -901,25 +905,21 @@ typedef struct { uint16_t event; uint16_t proto; uint16_t subproto; - uint8_t incoming; + uint8_t incoming; } __attribute__ ((packed)) evt_si_security; -#define EVT_TESTING 0xfe - -#define EVT_VENDOR 0xff - /* -------- HCI Packet structures -------- */ #define HCI_TYPE_LEN 1 typedef struct { uint16_t opcode; /* OCF & OGF */ - uint8_t plen; + uint8_t plen; } __attribute__ ((packed)) hci_command_hdr; #define HCI_COMMAND_HDR_SIZE 3 typedef struct { - uint8_t evt; - uint8_t plen; + uint8_t evt; + uint8_t plen; } __attribute__ ((packed)) hci_event_hdr; #define HCI_EVENT_HDR_SIZE 2 @@ -931,7 +931,7 @@ typedef struct { typedef struct { uint16_t handle; - uint8_t dlen; + uint8_t dlen; } __attribute__ ((packed)) hci_sco_hdr; #define HCI_SCO_HDR_SIZE 3 @@ -957,8 +957,8 @@ typedef struct { #define HCI_CMSG_TSTAMP 0x0002 struct sockaddr_hci { - sa_family_t hci_family; - unsigned short hci_dev; + sa_family_t hci_family; + unsigned short hci_dev; }; #define HCI_DEV_NONE 0xffff -- cgit From b45841191f6ab4cc55ccd040a5530c2d08c6ddc6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Jul 2003 00:06:26 +0000 Subject: Cleanup --- include/bluetooth.h | 16 ++++++++-------- include/l2cap.h | 4 ++-- include/sco.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index c09e99d4..1667fd12 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -37,23 +37,23 @@ extern "C" { #include #include #include - + #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 #define PF_BLUETOOTH AF_BLUETOOTH #endif -#define BTPROTO_L2CAP 0 -#define BTPROTO_HCI 1 -#define BTPROTO_SCO 2 +#define BTPROTO_L2CAP 0 +#define BTPROTO_HCI 1 +#define BTPROTO_SCO 2 #define BTPROTO_RFCOMM 3 #define BTPROTO_BNEP 4 #define BTPROTO_CMTP 5 -#define SOL_HCI 0 -#define SOL_L2CAP 6 -#define SOL_SCO 17 -#define SOL_RFCOMM 18 +#define SOL_HCI 0 +#define SOL_L2CAP 6 +#define SOL_SCO 17 +#define SOL_RFCOMM 18 /* Connection and socket states */ enum { diff --git a/include/l2cap.h b/include/l2cap.h index dec00efc..a5110a24 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -34,7 +34,7 @@ extern "C" { #endif /* L2CAP defaults */ -#define L2CAP_DEFAULT_MTU 672 +#define L2CAP_DEFAULT_MTU 672 #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF #define L2CAP_CONN_TIMEOUT (HZ * 40) @@ -54,7 +54,7 @@ struct l2cap_options { uint16_t flush_to; }; -#define L2CAP_CONNINFO 0x02 +#define L2CAP_CONNINFO 0x02 struct l2cap_conninfo { uint16_t hci_handle; }; diff --git a/include/sco.h b/include/sco.h index c02bd7ae..d8bc54b6 100644 --- a/include/sco.h +++ b/include/sco.h @@ -34,10 +34,10 @@ extern "C" { #endif /* SCO defaults */ -#define SCO_DEFAULT_MTU 500 +#define SCO_DEFAULT_MTU 500 #define SCO_DEFAULT_FLUSH_TO 0xFFFF -#define SCO_CONN_TIMEOUT (HZ * 40) +#define SCO_CONN_TIMEOUT (HZ * 40) #define SCO_DISCONN_TIMEOUT (HZ * 2) #define SCO_CONN_IDLE_TIMEOUT (HZ * 60) @@ -48,12 +48,12 @@ struct sockaddr_sco { }; /* set/get sockopt defines */ -#define SCO_OPTIONS 0x01 +#define SCO_OPTIONS 0x01 struct sco_options { uint16_t mtu; }; -#define SCO_CONNINFO 0x02 +#define SCO_CONNINFO 0x02 struct sco_conninfo { uint16_t hci_handle; }; -- cgit From 9b910ddd11031c344408cc11b50116f0d5631231 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 18 Jul 2003 01:51:09 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index f2c13a24..97688efc 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -277,6 +277,8 @@ char *bt_compidtostr(int compid) return "Computer Access Technology Corporation (CATC)"; case 53: return "Eclipse (HQ Espana) S.L."; + case 54: + return "Renesas Technology Corp."; case 65535: return "internal use"; default: -- cgit From 349d081b82323130f0648eeac5329fa53610d3f1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 25 Jul 2003 12:57:59 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 97688efc..af56573b 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -279,6 +279,8 @@ char *bt_compidtostr(int compid) return "Eclipse (HQ Espana) S.L."; case 54: return "Renesas Technology Corp."; + case 55: + return "Mobilian Corporation"; case 65535: return "internal use"; default: -- cgit From 1ebb5e939840d4be143d086eaa68a1c281084561 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 13 Aug 2003 15:48:33 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index af56573b..fedeb384 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -281,6 +281,10 @@ char *bt_compidtostr(int compid) return "Renesas Technology Corp."; case 55: return "Mobilian Corporation"; + case 56: + return "Terax"; + case 57: + return "Integrated System Solution Corp."; case 65535: return "internal use"; default: -- cgit From bdcb3c69d6ad2a308c0b636e0a697f1f261d97b9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 14 Aug 2003 16:50:33 +0000 Subject: Remove useless white space --- src/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index b01dec97..f22fcbfc 100644 --- a/src/hci.c +++ b/src/hci.c @@ -141,7 +141,7 @@ char *hci_dtypetostr(int type) case HCI_VHCI: return "VHCI"; case HCI_USB: - return "USB "; + return "USB"; case HCI_PCCARD: return "PCCARD"; case HCI_UART: -- cgit From 2f6b4e4f5e4da2cea6af279b262f81e9d52e78e4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 3 Sep 2003 10:50:40 +0000 Subject: Add link manager version parameter for Bluetooth 1.2 --- src/hci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hci.c b/src/hci.c index f22fcbfc..818c04e5 100644 --- a/src/hci.c +++ b/src/hci.c @@ -269,6 +269,7 @@ int hci_strtolm(char *str, unsigned int *val) hci_map ver_map[] = { { "1.0b", 0x00 }, { "1.1", 0x01 }, + { "1.2", 0x02 }, { NULL } }; char *hci_vertostr(unsigned int ver) -- cgit From 3d29835ef69b00fa3ed92702727ea2f737f37af2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 7 Sep 2003 17:55:45 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index fedeb384..9c4536fc 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -285,6 +285,8 @@ char *bt_compidtostr(int compid) return "Terax"; case 57: return "Integrated System Solution Corp."; + case 58: + return "Matsushita Electric Industrial Co., Ltd."; case 65535: return "internal use"; default: -- cgit From aac33d6b2e0c3c7b021478feb320afd8c812bda9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 18 Nov 2003 11:36:20 +0000 Subject: Add decoding of Bluetooth 1.2 features --- include/hci.h | 17 +++++++++++++++ src/hci.c | 68 +++++++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 65 insertions(+), 20 deletions(-) diff --git a/include/hci.h b/include/hci.h index 89ef19b6..fee39c20 100644 --- a/include/hci.h +++ b/include/hci.h @@ -200,6 +200,23 @@ enum { #define LMP_PSCHEME 0x02 #define LMP_PCONTROL 0x04 #define LMP_TRSP_SCO 0x08 +#define LMP_BCAST_ENC 0x80 + +#define LMP_ENH_ISCAN 0x08 +#define LMP_ILACE_ISCAN 0x10 +#define LMP_ILACE_PSCAN 0x20 +#define LMP_RSSI_INQ 0x40 +#define LMP_ESCO 0x80 + +#define LMP_EV4 0x01 +#define LMP_EV5 0x02 +#define LMP_AFH_CAP_SLV 0x08 +#define LMP_AFH_CLS_SLV 0x10 + +#define LMP_AFH_CAP_MST 0x08 +#define LMP_AFH_CLS_MST 0x10 + +#define LMP_EXT_FEAT 0x80 /* Link policies */ #define HCI_LP_RSWITCH 0x0001 diff --git a/src/hci.c b/src/hci.c index 818c04e5..61bdd1a6 100644 --- a/src/hci.c +++ b/src/hci.c @@ -295,32 +295,60 @@ int lmp_strtover(char *str, unsigned int *ver) /* LMP features mapping */ hci_map lmp_features_map[][9] = { { /* byte 0 */ - { "<3-slot packets>", LMP_3SLOT }, - { "<5-slot packets>", LMP_5SLOT }, - { "", LMP_ENCRYPT }, - { "", LMP_SOFFSET }, - { "", LMP_TACCURACY}, - { "", LMP_RSWITCH }, - { "", LMP_HOLD }, - { "", LMP_SNIFF }, + { "<3-slot packets>", LMP_3SLOT }, + { "<5-slot packets>", LMP_5SLOT }, + { "", LMP_ENCRYPT }, + { "", LMP_SOFFSET }, + { "", LMP_TACCURACY }, + { "", LMP_RSWITCH }, + { "", LMP_HOLD }, + { "", LMP_SNIFF }, { NULL } }, { /* byte 1 */ - { "", LMP_PARK }, - { "", LMP_RSSI }, - { "", LMP_QUALITY }, - { "", LMP_SCO }, - { "", LMP_HV2 }, - { "", LMP_HV3 }, - { "", LMP_ULAW }, - { "", LMP_ALAW }, + { "", LMP_PARK }, + { "", LMP_RSSI }, + { "", LMP_QUALITY }, + { "", LMP_SCO }, + { "", LMP_HV2 }, + { "", LMP_HV3 }, + { "", LMP_ULAW }, + { "", LMP_ALAW }, { NULL } }, { /* byte 2 */ - { "", LMP_CVSD }, - { "", LMP_PSCHEME }, - { "", LMP_PCONTROL }, - { "", LMP_TRSP_SCO }, + { "", LMP_CVSD }, + { "", LMP_PSCHEME }, + { "", LMP_PCONTROL }, + { "", LMP_TRSP_SCO }, + { "",LMP_BCAST_ENC }, + { NULL } + }, + { /* byte 3 */ + { "", LMP_ENH_ISCAN }, + { "", LMP_ILACE_ISCAN }, + { "", LMP_ILACE_PSCAN }, + { "",LMP_RSSI_INQ }, + { "", LMP_ESCO }, + { NULL } + }, + { /* byte 4 */ + { "", LMP_EV4 }, + { "", LMP_EV5 }, + { "", LMP_AFH_CAP_SLV }, + { "", LMP_AFH_CLS_SLV }, + { NULL } + }, + { /* byte 5 */ + { "", LMP_AFH_CAP_MST }, + { "",LMP_AFH_CLS_MST }, + { NULL } + }, + { /* byte 6 */ + { NULL } + }, + { /* byte 7 */ + { "",LMP_EXT_FEAT }, { NULL } }, {{ NULL }} -- cgit From 6b5b6093a75df05d27571d192d4ef2fb56bfc6e2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 20 Nov 2003 08:50:42 +0000 Subject: Fix lmp_featurestostr() --- src/hci.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hci.c b/src/hci.c index 61bdd1a6..8100d227 100644 --- a/src/hci.c +++ b/src/hci.c @@ -293,7 +293,7 @@ int lmp_strtover(char *str, unsigned int *ver) } /* LMP features mapping */ -hci_map lmp_features_map[][9] = { +hci_map lmp_features_map[8][9] = { { /* byte 0 */ { "<3-slot packets>", LMP_3SLOT }, { "<5-slot packets>", LMP_5SLOT }, @@ -351,7 +351,6 @@ hci_map lmp_features_map[][9] = { { "",LMP_EXT_FEAT }, { NULL } }, - {{ NULL }} }; char *lmp_featurestostr(uint8_t *features, char *pref, int width) @@ -367,7 +366,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) if (pref) ptr += sprintf(ptr, "%s", pref); - for(i=0, w=0; lmp_features_map[i][0].str; i++) { + for(i=0, w=0; i<8; i++) { hci_map *m; m = lmp_features_map[i]; @@ -381,7 +380,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) m++; } } - + return str; } -- cgit From 2fab12934efb2218ffba0e2551d456b581ccccbf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 17 Dec 2003 14:26:14 +0000 Subject: Update changelog and bump version number --- ChangeLog | 10 ++++++++++ configure.in | 2 +- libs.spec | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6828a75e..cf6f2f98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +ver 2.5: + Add decoding of Bluetooth 1.2 features. + Add link manager version parameter for Bluetooth 1.2. + Add new company identifiers. + Support for transmit power level. + Support for park, sniff and hold mode. + Support for role switch. + Support for reading the clock offset. + Use R1 for default value of pscan_rep_mode. + ver 2.4: Added const qualifiers to appropriate function arguments. Minor fixes. diff --git a/configure.in b/configure.in index b3b8568f..aa258191 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,7 @@ AC_CANONICAL_HOST AM_MAINTAINER_MODE -AM_INIT_AUTOMAKE(bluez-libs, 2.4) +AM_INIT_AUTOMAKE(bluez-libs, 2.5) AC_PREFIX_DEFAULT(/usr) diff --git a/libs.spec b/libs.spec index 41a4eca1..245c24f0 100644 --- a/libs.spec +++ b/libs.spec @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 2.4 +%define ver 2.5 %define RELEASE 1 %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr -- cgit From 4831ff2d35f407ddff185c2d6350355556244101 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 17 Dec 2003 14:28:36 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index ac3e7279..2388a753 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,6 +5,6 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c -libbluetooth_la_LDFLAGS = -version-info 1:2:0 +libbluetooth_la_LDFLAGS = -version-info 1:3:0 INCLUDES = -I$(top_srcdir)/include -- cgit From a1b95e6f01957e2e5c3a9950a6da307e9ada285b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 24 Dec 2003 11:58:54 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 9c4536fc..a2aae586 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -287,6 +287,8 @@ char *bt_compidtostr(int compid) return "Integrated System Solution Corp."; case 58: return "Matsushita Electric Industrial Co., Ltd."; + case 59: + return "Gennum Corporation"; case 65535: return "internal use"; default: -- cgit From 382615bc4b30d8204bdad79643f98cf19656b2a3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 31 Jan 2004 00:55:32 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index a2aae586..1607c04f 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -289,6 +289,8 @@ char *bt_compidtostr(int compid) return "Matsushita Electric Industrial Co., Ltd."; case 59: return "Gennum Corporation"; + case 60: + return "Research In Motion"; case 65535: return "internal use"; default: -- cgit From e24ad392eecfa6c90be24b67ddc2f046898ff7fb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 3 Mar 2004 03:56:18 +0000 Subject: Cleanup --- configure.in | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index aa258191..243a7551 100644 --- a/configure.in +++ b/configure.in @@ -5,26 +5,19 @@ dnl Process this file with autoconf to produce a configure script. dnl AC_INIT() -dnl Guess host type. -AC_CANONICAL_SYSTEM -AC_CANONICAL_HOST - AM_MAINTAINER_MODE AM_INIT_AUTOMAKE(bluez-libs, 2.5) AC_PREFIX_DEFAULT(/usr) -AC_SUBST(LD) -AC_SUBST(AR) - CFLAGS="-Wall -g -O2" AC_PROG_CC AC_PROG_INSTALL -AC_CHECK_TOOL(LD, ld, ld) -AC_CHECK_TOOL(AR, ar, ar) -AM_PROG_LIBTOOL +dnl AC_LIBTOOL_TAGS([]) + +AC_PROG_LIBTOOL AC_OUTPUT(Makefile include/Makefile src/Makefile) -- cgit From d6a0b8361301a4e153a45020d6522f722537000a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Mar 2004 15:39:56 +0000 Subject: Add HIDP protocol identifier --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 1667fd12..f4ceaae5 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -49,6 +49,7 @@ extern "C" { #define BTPROTO_RFCOMM 3 #define BTPROTO_BNEP 4 #define BTPROTO_CMTP 5 +#define BTPROTO_HIDP 6 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From 0739c996ec7922df5559b72cd8e7683422700180 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 16:31:03 +0000 Subject: Remove autoconf and automake specific files and update others --- AUTHORS | 6 +- COPYING | 92 +- INSTALL | 182 +++ config.guess | 951 ----------- config.sub | 955 ----------- install-sh | 251 --- ltconfig | 2795 -------------------------------- ltmain.sh | 4946 --------------------------------------------------------- missing | 198 --- mkinstalldirs | 40 - 10 files changed, 249 insertions(+), 10167 deletions(-) delete mode 100755 config.guess delete mode 100755 config.sub delete mode 100755 install-sh delete mode 100755 ltconfig delete mode 100644 ltmain.sh delete mode 100755 missing delete mode 100755 mkinstalldirs diff --git a/AUTHORS b/AUTHORS index 61d09d0c..7c0abf7a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,10 +1,10 @@ Maxim Krasnyansky Original author. - Primary maintainer. Marcel Holtmann + Primary maintainer. Various patches, fixes and other contributions. Stephen Crane - Support for hci_{read, write}_class_of_dev() and other HCI functions. - + Support for many HCI functions. + Memory leak fixes and SDP API cleanups. diff --git a/COPYING b/COPYING index 357e7469..5b6e7c66 100644 --- a/COPYING +++ b/COPYING @@ -1,27 +1,3 @@ - - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. - - ------------------------------------------------------------------------- - GNU GENERAL PUBLIC LICENSE Version 2, June 1991 @@ -79,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. - + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -134,7 +110,7 @@ above, provided that you also meet all of these conditions: License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -192,7 +168,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -249,7 +225,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -302,3 +278,63 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/INSTALL b/INSTALL index e69de29b..b42a17ac 100644 --- a/INSTALL +++ b/INSTALL @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/config.guess b/config.guess deleted file mode 100755 index 2960d6e0..00000000 --- a/config.guess +++ /dev/null @@ -1,951 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Written by Per Bothner . -# The master version of this file is at the FSF in /home/gd/gnu/lib. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 8/24/94.) -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 - -trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - cat <dummy.s - .globl main - .ent main -main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - ${CC-cc} dummy.s -o dummy 2>/dev/null - if test "$?" = 0 ; then - ./dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - fi - rm -f dummy.s dummy - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-cbm-sysv4 - exit 0;; - amiga:NetBSD:*:*) - echo m68k-cbm-netbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - arc64:OpenBSD:*:*) - echo mips64el-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hkmips:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - arm32:NetBSD:*:*) - echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - SR2?01:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - 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 0 ;; - NILE:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - 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 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(head -1 /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 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - atari*:NetBSD:*:*) - echo m68k-atari-netbsd${UNAME_RELEASE} - exit 0 ;; - atari*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:NetBSD:*:*) - echo m68k-sun-netbsd${UNAME_RELEASE} - exit 0 ;; - sun3*:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:NetBSD:*:*) - echo m68k-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - macppc:NetBSD:*:*) - echo powerpc-apple-netbsd${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - sed 's/^ //' << EOF >dummy.c - int main (argc, argv) int argc; char **argv; { - #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-cc} dummy.c -o dummy \ - && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ - -o ${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 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i?86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - sed 's/^ //' << EOF >dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:4) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${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=4.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 ) - sed 's/^ //' << EOF >dummy.c - #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 - (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` - rm -f dummy.c dummy - esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - 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-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i?86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*X-MP:*:*:*) - echo xmp-cray-unicos - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} - exit 0 ;; - CRAY-2:*:*:*) - echo cray2-cray-unicos - exit 0 ;; - F300:UNIX_System_V:*:*) - FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; - hp3[0-9][05]:NetBSD:*:*) - echo m68k-hp-netbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - i?86:BSD/386:*:* | *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:NetBSD:*:*) - echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:Linux:*:*) - # uname on the ARM produces all sorts of strangeness, and we need to - # filter it out. - case "$UNAME_MACHINE" in - arm* | sa110*) UNAME_MACHINE="arm" ;; - esac - - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. - ld_help_string=`ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ - | sed -ne '/supported emulations:/!d - s/[ ][ ]*/ /g - s/.*supported emulations: *// - s/ .*// - p'` - case "$ld_supported_emulations" in - i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; - i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; - sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; - elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; - esac - - if test "${UNAME_MACHINE}" = "alpha" ; then - sed 's/^ //' <dummy.s - .globl main - .ent main - main: - .frame \$30,0,\$26,0 - .prologue 0 - .long 0x47e03d80 # implver $0 - lda \$2,259 - .long 0x47e20c21 # amask $2,$1 - srl \$1,8,\$2 - sll \$2,2,\$2 - sll \$0,3,\$0 - addl \$1,\$0,\$0 - addl \$2,\$0,\$0 - ret \$31,(\$26),1 - .end main -EOF - LIBC="" - ${CC-cc} dummy.s -o dummy 2>/dev/null - if test "$?" = 0 ; then - ./dummy - case "$?" in - 7) - UNAME_MACHINE="alpha" - ;; - 15) - UNAME_MACHINE="alphaev5" - ;; - 14) - UNAME_MACHINE="alphaev56" - ;; - 10) - UNAME_MACHINE="alphapca56" - ;; - 16) - UNAME_MACHINE="alphaev6" - ;; - esac - - objdump --private-headers dummy | \ - grep ld.so.1 > /dev/null - if test "$?" = 0 ; then - LIBC="libc1" - fi - fi - rm -f dummy.s dummy - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - else - # Either a pre-BFD a.out linker (linux-gnuoldld) - # or one that does not give us useful --help. - # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. - # If ld does not provide *any* "supported emulations:" - # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 - - case "${UNAME_MACHINE}" in - i?86) - VENDOR=pc; - ;; - *) - VENDOR=unknown; - ;; - esac - # Determine whether the default compiler is a.out or elf - cat >dummy.c < -main(argc, argv) - int argc; - char *argv[]; -{ -#ifdef __ELF__ -# ifdef __GLIBC__ -# if __GLIBC__ >= 2 - printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -# else - printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); -# endif -#else - printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); -#endif - return 0; -} -EOF - ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 - rm -f dummy.c dummy - fi ;; -# 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. - i?86:DYNIX/ptx:4*:*) - echo i386-sequent-sysv4 - exit 0 ;; - 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 0 ;; - i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} - fi - exit 0 ;; - i?86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - i?86:UnixWare:*:*) - if /bin/uname -X 2>/dev/null >/dev/null ; then - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - fi - echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION} - exit 0 ;; - pc:*:*:*) - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i?86:LynxOS:2.*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *: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 0 ;; - PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:*:6*) - echo mips-sony-newsos6 - exit 0 ;; - R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -cat >dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 -rm -f dummy.c dummy - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -#echo '(Unable to guess system type)' 1>&2 - -exit 1 diff --git a/config.sub b/config.sub deleted file mode 100755 index 00bea6e6..00000000 --- a/config.sub +++ /dev/null @@ -1,955 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# 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. - -# 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. - -if [ x$1 = x ] -then - echo Configuration name missing. 1>&2 - echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 - echo "or $0 ALIAS" 1>&2 - echo where ALIAS is a recognized configuration type. 1>&2 - exit 1 -fi - -# First pass through any local machine types. -case $1 in - *local*) - echo $1 - exit 0 - ;; - *) - ;; -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 - linux-gnu*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - 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) - os= - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -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/'` - ;; - -sco*) - os=-sco3.2v2 - 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*) - 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 - ;; -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. - tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ - | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \ - | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ - | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ - | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ - | mipstx39 | mipstx39el \ - | sparc | sparclet | sparclite | sparc64 | v850) - basic_machine=$basic_machine-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[34567]86) - 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. - vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ - | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ - | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \ - | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ - | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ - | sparc64-* | mips64-* | mipsel-* \ - | mips64el-* | mips64orion-* | mips64orionel-* \ - | mipstx39-* | mipstx39el-* \ - | f301-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-cbm - ;; - amigaos | amigados) - basic_machine=m68k-cbm - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-cbm - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - 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 | ymp) - basic_machine=ymp-cray - os=-unicos - ;; - cray2) - basic_machine=cray2-cray - os=-unicos - ;; - [ctj]90-cray) - basic_machine=c90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - 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 - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-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 - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - os=-mvs - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i[34567]86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i[34567]86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i[34567]86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i[34567]86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - miniframe) - basic_machine=m68000-convergent - ;; - mipsel*-linux*) - basic_machine=mipsel-unknown - os=-linux-gnu - ;; - mips*-linux*) - basic_machine=mips-unknown - os=-linux-gnu - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - 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 - ;; - 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 - ;; - np1) - basic_machine=np1-gould - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | nexen) - basic_machine=i586-pc - ;; - pentiumpro | p6 | k6 | 6x86) - basic_machine=i686-pc - ;; - pentiumii | pentium2) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | nexen-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | k6-* | 6x86-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=rs6000-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - 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 - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - 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 - ;; - xmp) - basic_machine=xmp-cray - os=-unicos - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - 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. - mips) - if [ x$os = x-linux-gnu ]; then - basic_machine=mips-unknown - else - basic_machine=mips-mips - fi - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sparc) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - *) - 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. - -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* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -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|'` - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -ctix* | -uts*) - os=-sysv - ;; - -ns2 ) - os=-nextstep2 - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -xenix) - os=-xenix - ;; - -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 - *-acorn) - os=-riscix1.2 - ;; - arm*-semi) - os=-aout - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-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 - ;; - f301-fujitsu) - os=-uxpv - ;; - *) - 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 - ;; - -aix*) - vendor=ibm - ;; - -hpux*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os diff --git a/install-sh b/install-sh deleted file mode 100755 index e9de2384..00000000 --- a/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/ltconfig b/ltconfig deleted file mode 100755 index 746e15b9..00000000 --- a/ltconfig +++ /dev/null @@ -1,2795 +0,0 @@ -#! /bin/sh - -# ltconfig - Create a system-specific libtool. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A lot of this script is taken from autoconf-2.10. - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} -echo=echo -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec "$SHELL" "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null`} - case X$UNAME in - *-DOS) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; - esac -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running ltconfig again with it. - ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - - export echo_test_string - exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# The name of this program. -progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` - -# Constants: -PROGRAM=ltconfig -PACKAGE=libtool -VERSION=1.4a-GCC3.0 -TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)" -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -rm="rm -f" - -help="Try \`$progname --help' for more information." - -# Global variables: -default_ofile=libtool -can_build_shared=yes -enable_shared=yes -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -enable_static=yes -enable_fast_install=yes -enable_dlopen=unknown -enable_win32_dll=no -pic_mode=default -ltmain= -silent= -srcdir= -ac_config_guess= -ac_config_sub= -host= -build=NONE -nonopt=NONE -ofile="$default_ofile" -verify_host=yes -tagname= -with_gcc=no -with_gnu_ld=no -need_locks=yes -ac_ext=c -libext=a -cache_file= -max_cmd_len= - -## Dependencies to place before and after the object being linked: -predep_objects= -postdep_objects= -predeps= -postdeps= -compiler_lib_search_path= - -## Link characteristics: -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -striplib= -old_striplib= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -## Tools: -old_AR="$AR" -old_AR_FLAGS="$AR_FLAGS" -old_CC="$CC" -old_CFLAGS="$CFLAGS" -old_CPPFLAGS="$CPPFLAGS" -old_LDFLAGS="$LDFLAGS" -old_LIBS="$LIBS" -old_MAGIC_CMD="$MAGIC_CMD" -old_LD="$LD" -old_LN_S="$LN_S" -old_LTCC="$LTCC" -old_NM="$NM" -old_RANLIB="$RANLIB" -old_STRIP="$STRIP" -old_AS="$AS" -old_DLLTOOL="$DLLTOOL" -old_OBJDUMP="$OBJDUMP" -old_OBJEXT="$OBJEXT" -old_EXEEXT="$EXEEXT" -old_reload_flag="$reload_flag" -old_deplibs_check_method="$deplibs_check_method" -old_file_magic_cmd="$file_magic_cmd" - -# Parse the command line options. -args= -prev= -for option -do - case $option in - -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - eval "$prev=\$option" - prev= - continue - fi - - case $option in - --help) cat <&2 - echo "$help" 1>&2 - exit 1 - ;; - - *) - if test -z "$ltmain"; then - ltmain="$option" - elif test -z "$host"; then -# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 -# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then -# echo "$progname: warning \`$option' is not a valid host type" 1>&2 -# fi - host="$option" - else - echo "$progname: too many arguments" 1>&2 - echo "$help" 1>&2 - exit 1 - fi ;; - esac -done - -if test -z "$ltmain"; then - echo "$progname: you must specify a LTMAIN file" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test ! -f "$ltmain"; then - echo "$progname: \`$ltmain' does not exist" 1>&2 - echo "$help" 1>&2 - exit 1 -fi - -if test -n "$tagname"; then - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in - "") ;; - *) - echo "$progname: invalid tag name: $tagname" 1>&2 - exit 1 - ;; - esac - - if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ofile" > /dev/null; then - echo "$progname: tag name $tagname already exists" 1>&2 - exit 1 - fi - - if test ! -f "$ofile"; then - echo "$progname: warning: output file \`$ofile' does not exist" 1>&2 - fi - - if test -z "$LTCC"; then - eval "`$SHELL $ofile --config | grep '^LTCC='`" - if test -z "$LTCC"; then - echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2 - else - echo "$progname: warning: using \`LTCC=$LTCC', extracted from \`$ofile'" 1>&2 - fi - fi -fi - -# Quote any args containing shell metacharacters. -ltconfig_args= -for arg -do - case $arg in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ltconfig_args="$ltconfig_args '$arg'" ;; - *) ltconfig_args="$ltconfig_args $arg" ;; - esac -done - -# A relevant subset of AC_INIT. - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 5 compiler messages saved in config.log -# 6 checking for... messages and results -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>>./config.log - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi -if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi - -if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then - echo "loading cache $cache_file within ltconfig" - . $cache_file -fi - -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - -if test -z "$srcdir"; then - # Assume the source directory is the same one as the path to LTMAIN. - srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` - test "$srcdir" = "$ltmain" && srcdir=. -fi - -trap "$rm conftest*; exit 1" 1 2 15 -if test "$verify_host" = yes; then - # Check for config.guess and config.sub. - ac_aux_dir= - for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/config.guess; then - ac_aux_dir=$ac_dir - break - fi - done - if test -z "$ac_aux_dir"; then - echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 - echo "$help" 1>&2 - exit 1 - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - - # Make sure we can run config.sub. - if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : - else - echo "$progname: cannot run $ac_config_sub" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - echo $ac_n "checking host system type""... $ac_c" 1>&6 - - host_alias=$host - case $host_alias in - "") - # Force config.guess to use the C compiler. - # CC_FOR_BUILD overrides the CC variable in config.guess but I had - # problems with it so do it this way for now. - CC="$LTCC" - - if host_alias=`$SHELL $ac_config_guess`; then : - else - echo "$progname: cannot guess host type; you must specify one" 1>&2 - echo "$help" 1>&2 - exit 1 - fi - - # Restore the C compiler. - CC="$old_CC" - ;; - esac - host=`$SHELL $ac_config_sub $host_alias` - echo "$ac_t$host" 1>&6 - - # Make sure the host verified. - test -z "$host" && exit 1 - - # Check for the build system type - echo $ac_n "checking build system type... $ac_c" 1>&6 - - build_alias=$build - case $build_alias in - NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; - esac - - build=`$SHELL $ac_config_sub $build_alias` - build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - echo "$ac_t""$build" 1>&6 - -elif test -z "$host"; then - echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 - echo "$help" 1>&2 - exit 1 -else - host_alias=$host - build_alias=$host_alias - build=$host -fi - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" -fi - -# Source the script associated with the $tagname tag configuration. -if test -n "$tagname"; then - . $ltmain -else - # FIXME: We should use a variable here - # Configure for a C compiler - . $srcdir/ltcf-c.sh -fi - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$objext" && objext=o - -echo $ac_n "checking for objdir... $ac_c" 1>&6 -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -echo "$ac_t$objdir" 1>&6 - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="$2" - -# We assume here that the value for ac_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 -echo "$progname:678:checking for $compiler option to produce PIC" 1>&5 - -if test -z "$ac_cv_prog_cc_pic"; then - echo "$ac_t"none 1>&6 -else - echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6 - - # Check to make sure the pic_flag actually works. - echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6 - echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5 - if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \ - test "X${ac_cv_prog_cc_pic_works}" != X; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_cv_prog_cc_pic_works=yes - $rm conftest* - echo $lt_simple_compile_test_code > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC" - if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - # Append any warnings to the config.log. - cat conftest.err 1>&5 - - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - ac_cv_prog_cc_pic_works=no - ac_cv_prog_cc_can_build_shared=no - ac_cv_prog_cc_pic= - else - ac_cv_prog_cc_pic_works=yes - ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" - fi - ;; - *) - ac_cv_prog_cc_pic_works=yes - ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic" - ;; - esac - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - ac_cv_prog_cc_pic_works=no - ac_cv_prog_cc_can_build_shared=no - ac_cv_prog_cc_pic= - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - fi - # Belt *and* braces to stop my trousers falling down: - if test "X$ac_cv_prog_cc_pic_works" = Xno; then - ac_cv_prog_cc_pic= - ac_cv_prog_cc_can_build_shared=no - fi - echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6 -fi - -# Check for any special shared library compilation flags. -if test -n "$ac_cv_prog_cc_shlib"; then - echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2 - if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$ac_cv_prog_cc_shlib[ ]" >/dev/null; then : - else - echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 - ac_cv_prog_cc_can_build_shared=no - fi -fi - -echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6 -echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5 -if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \ - test "X${ac_cv_prog_cc_static_works}" != X; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - $rm conftest* - echo $lt_simple_link_test_code > conftest.$ac_ext - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static" - if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - ac_cv_prog_cc_static_works=yes - else - ac_cv_prog_cc_static_works=no - ac_cv_prog_cc_static= - fi - LDFLAGS="$save_LDFLAGS" - $rm conftest* -fi -# Belt *and* braces to stop my trousers falling down: -if test "X$ac_cv_prog_cc_static_works" = Xno; then - ac_cv_prog_cc_static= -fi -echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6 -pic_flag="$ac_cv_prog_cc_pic" -special_shlib_compile_flags="$ac_cv_prog_cc_shlib" -wl="$ac_cv_prog_cc_wl" -link_static_flag="$ac_cv_prog_cc_static" -no_builtin_flag="$ac_cv_prog_cc_no_builtin" -can_build_shared="$ac_cv_prog_cc_can_build_shared" - -# find the maximum length of command line arguments -echo "$progname:780: finding the maximum length of command line arguments" 1>&5 -echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6 -if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - i=0 - testring="ABCD" - # 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"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ - = "XX$testring" && - new_result=`expr "X$testring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - testring=$testring$testring - done - testring= - # add a significant safety factor because C++ compilers can tack on massive amounts - # of additional arguments before passing them to the linker. 1/4 should be good. - len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len` -fi -echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5 -echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6 - -if test -n $lt_cv_sys_max_cmd_len ; then - max_cmd_len=$lt_cv_sys_max_cmd_len -else - max_cmd_len=none -fi - -# Check to see if options -o and -c are simultaneously supported by compiler -echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6 -if test "${lt_cv_compiler_c_o+set}" = set; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - $rm conftest* - echo $lt_simple_compile_test_code > conftest.$ac_ext - mkdir out - # According to Tom Tromey, Ian Lance Taylor reported there are C compilers - # that will create temporary files in the current directory regardless of - # the output directory. Thus, making CWD read-only will cause this test - # to fail, enabling locking or at least warning the user not to do parallel - # builds. - chmod -w . - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -o out/conftest2.$objext" - echo "$progname:833: checking if $compiler supports -c -o file.$objext" >&5 - if { (eval echo $progname:834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi - else - # Append any errors to the config.log. - cat out/conftest.err 1>&5 - lt_cv_compiler_c_o=no - fi - CFLAGS="$save_CFLAGS" - chmod u+w . - $rm conftest* out/* - rmdir out - cd .. - rmdir conftest - $rm -r conftest 2>/dev/null -fi -compiler_c_o=$lt_cv_compiler_c_o -echo "${ac_t}$compiler_c_o" 1>&6 - -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$ac_t$hard_links" 1>&6 - $rm conftest* - if test "$hard_links" = no; then - echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 - need_locks=warn - fi -else - need_locks=no -fi - -if test "$with_gcc" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 - $rm conftest* - echo $lt_simple_compile_test_code > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - echo "$progname:887: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 - if { (eval echo $progname:888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then - - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - echo "$ac_t"no 1>&6 - compiler_rtti_exceptions=no - else - echo "$ac_t"yes 1>&6 - compiler_rtti_exceptions=yes - fi - else - # Append any errors to the config.log. - cat conftest.err 1>&5 - compiler_rtti_exceptions=no - echo "$ac_t"no 1>&6 - fi - CFLAGS="$save_CFLAGS" - $rm conftest* - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi - -fi - -# See if the linker supports building shared libraries. -echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 - -echo "$ac_t$ld_shlibs" 1>&6 -test "$ld_shlibs" = no && can_build_shared=no - -# Check hardcoding attributes. -echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -echo "$ac_t$hardcode_action" 1>&6 - -echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "${ac_t}yes" 1>&6 -else - echo "${ac_t}no" 1>&6 -fi - -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -# PORTME Fill in your ld.so characteristics -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # 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. - # We preserve .a as extension for shared libraries though AIX4.2 - # and later linker supports .so - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so instead of - # lib.a to let people know that these are not typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries though AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - shlibpath_var=LIBPATH - deplibs_check_method=pass_all - 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 - # 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. - can_build_shared=no - fi - ;; - esac - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $with_gcc,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll; $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' -;; - *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}.`test .$module = .yes && echo so || echo dylib` ${libname}${release}${major}.$`test .$module = .yes && echo so || echo dylib` ${libname}.`test .$module = .yes && echo so || echo dylib`' - soname_spec='${libname}${release}${major}.`test .$module = .yes && echo so || echo dylib`' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lc=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - need_lib_prefix=no - need_version=no - version_type=sunos - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - need_version=no - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$ac_t$dynamic_linker" 1>&6 -test "$dynamic_linker" = no && can_build_shared=no - -# Check for command to grab the raw symbol name followed by C symbol from nm. -echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - ;; -irix*) - symcode='[BCDEGRST]' - ;; -solaris* | sysv5*) - symcode='[BDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[ABCDGISTW]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. - global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - $rm conftest* - cat > conftest.$ac_ext <&5 - if { (eval echo $progname:1432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then - # Now try to grab the symbols. - nlist=conftest.nm - if { echo "$progname:1435: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then - - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$objext conftstm.$objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if { (eval echo $progname:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - pipe_works=yes - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - LIBS="$save_LIBS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - $rm conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - global_symbol_pipe= - fi -done -if test "$pipe_works" = yes; then - echo "${ac_t}ok" 1>&6 -else - echo "${ac_t}failed" 1>&6 -fi - -if test -z "$global_symbol_pipe"; then - global_symbol_to_cdecl= -fi - -# Report the final consequences. -echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 - -# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in -# configure.in, otherwise build static only libraries. -case $host_os in -cygwin* | mingw* | pw32* | os2*) - if test x$can_build_shared = xyes; then - test x$enable_win32_dll = xno && can_build_shared=no - echo "checking if package supports dlls... $can_build_shared" 1>&6 - fi -;; -esac - -echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - test "$enable_shared" = yes && enable_static=no - ;; -esac - -echo "$ac_t$enable_shared" 1>&6 - -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes - -echo "checking whether to build static libraries... $enable_static" 1>&6 - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$with_gcc" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# Check whether we must set pic_mode to default -test -z "$pic_flag" && pic_mode=default - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else -if test "X${lt_cv_dlopen+set}" != Xset; then - lt_cv_dlopen=no lt_cv_dlopen_libs= -echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "$progname:1591: checking for dlopen in -ldl" >&5 -if test "X${ac_cv_lib_dl_dlopen+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_dl_dlopen=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_dl_dlopen=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_dl_dlopen" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "$progname:1630: checking for dlopen" >&5 -if test "X${ac_cv_func_dlopen+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -dlopen(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_dlopen=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_dlopen=no -fi -rm -f conftest* -fi -if test "X$ac_cv_func_dlopen" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 -echo "$progname:1677: checking for dlopen in -lsvld" >&5 -if test "X${ac_cv_lib_svld_dlopen+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsvld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_svld_dlopen=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_svld_dlopen=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_svld_dlopen" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 -echo "$progname:1716: checking for dld_link in -ldld" >&5 -if test "X${ac_cv_lib_dld_dld_link+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_dld_dld_link=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_dld_dld_link=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_dld_dld_link" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load""... $ac_c" 1>&6 -echo "$progname:1755: checking for shl_load" >&5 -if test "X${ac_cv_func_shl_load+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -shl_load(); -#endif - -; return 0; } -EOF -if { (eval echo $progname:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_shl_load=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_shl_load=no -fi -rm -f conftest* -fi - -if test "X$ac_cv_func_shl_load" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "$progname:1803: checking for shl_load in -ldld" >&5 -if test "X${ac_cv_lib_dld_shl_load+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldld $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_lib_dld_shl_load=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_lib_dld_shl_load=no -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if test "X$ac_cv_lib_dld_shl_load" = Xyes; then - echo "$ac_t""yes" 1>&6 - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - echo "$ac_t""no" 1>&6 -fi - - -fi - - -fi - - -fi - - -fi - -fi - -fi - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) -for ac_hdr in dlfcn.h; do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "$progname:1871: checking for $ac_hdr" >&5 -if eval "test \"`echo 'X$''{'ac_cv_header_$ac_safe'+set}'`\" = Xset"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int fnord = 0; -int main () { return(0); } -EOF -ac_try="$ac_compile >/dev/null 2>conftest.out" -{ (eval echo $progname:1882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -done - - if test "x$ac_cv_header_dlfcn_h" = xyes; then - CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - fi - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - LIBS="$lt_cv_dlopen_libs $LIBS" - - echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:1910: checking whether a program can dlopen itself" >&5 -if test "X${lt_cv_dlopen_self+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self=cross - else - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -void fnord() { int i=42; } -int main() { - void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self" 1>&6 - - if test "$lt_cv_dlopen_self" = yes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 -echo "$progname:1984: checking whether a statically linked program can dlopen itself" >&5 -if test "X${lt_cv_dlopen_self_static+set}" = Xset; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - lt_cv_dlopen_self_static=cross - else - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LTDL_GLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LTDL_GLOBAL DL_GLOBAL -# else -# define LTDL_GLOBAL 0 -# endif -#endif - -/* We may have to define LTDL_LAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LTDL_LAZY_OR_NOW -# ifdef RTLD_LAZY -# define LTDL_LAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LTDL_LAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LTDL_LAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LTDL_LAZY_OR_NOW DL_NOW -# else -# define LTDL_LAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -void fnord() { int i=42; } -int main() { - void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); - if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); - if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } - -EOF -if { (eval echo $progname:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - lt_cv_dlopen_self_static=yes -else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - lt_cv_dlopen_self_static=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 -fi - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - -# Copy echo and quote the copy, instead of the original, because it is -# used later. -ltecho="$echo" -if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ltecho="$CONFIG_SHELL \$0 --fallback-echo" -fi -LTSHELL="$SHELL" - -LTCONFIG_VERSION="$VERSION" - -# Only quote variables if we're using ltmain.sh. -case $ltmain in -*.sh) - # Now quote all the things that may contain metacharacters. - for var in ltecho old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ - old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ - old_LN_S old_NM old_RANLIB old_STRIP \ - old_AS old_DLLTOOL old_OBJDUMP \ - old_OBJEXT old_EXEEXT old_reload_flag \ - old_deplibs_check_method old_file_magic_cmd \ - AR AR_FLAGS CC LTCC LD LN_S NM LTSHELL LTCONFIG_VERSION \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - predep_objects postdep_objects predeps postdeps compiler_lib_search_path \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ### testsuite: skip nested quoting test - ;; - *) - eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ### testsuite: skip nested quoting test - ;; - esac - done - - case $ltecho in - *'\$0 --fallback-echo"') - ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - - if test -z "$tagname"; then - trap "$rm \"$ofile\"; exit 1" 1 2 15 - echo "creating $ofile" - $rm "$ofile" - cat < "$ofile" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# The names of the tagged configurations supported by this script. -available_tags= - -### BEGIN LIBTOOL CONFIG -EOF - else - echo "appending configuration tag \"$tagname\" to $ofile" - echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" - fi - cfgfile="$ofile" - ;; - -*) - # Double-quote the variables that need it (for aesthetics). - for var in old_AR old_AR_FLAGS old_CC old_LTCC old_CFLAGS old_CPPFLAGS \ - old_MAGIC_CMD old_LD old_LDFLAGS old_LIBS \ - old_LN_S old_NM old_RANLIB old_STRIP \ - old_AS old_DLLTOOL old_OBJDUMP \ - old_OBJEXT old_EXEEXT old_reload_flag \ - old_deplibs_check_method old_file_magic_cmd; do - eval "$var=\\\"\$var\\\"" - done - - # Just create a config file. - cfgfile="$ofile.cfg" - if test -z "$tagname"; then - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - echo "creating $cfgfile" - $rm "$cfgfile" - cat < "$cfgfile" -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) - -### BEGIN LIBTOOL CONFIG -EOF - else - echo "appending to $cfgfile" - echo "### BEGIN LIBTOOL TAG CONFIG: $tagname" >> "$ofile" - fi - ;; -esac - -cat <> "$cfgfile" -# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# AR=$old_AR AR_FLAGS=$old_AR_FLAGS LTCC=$old_LTCC CC=$old_CC \\ -# CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ -# MAGIC_CMD=$old_MAGIC_CMD LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ -# LN_S=$old_LN_S NM=$old_NM RANLIB=$old_RANLIB STRIP=$old_STRIP \\ -# AS=$old_AS DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP \\ -# objext=$old_OBJEXT exeext=$old_EXEEXT reload_flag=$old_reload_flag \\ -# deplibs_check_method=$old_deplibs_check_method \\ -# file_magic_cmd=$old_file_magic_cmd \\ -# $0$ltconfig_args -# -# Compiler and other test output produced by $progname, useful for -# debugging $progname, is in ./config.log if it exists. - -# The version of $progname that generated this script. -LTCONFIG_VERSION=$LTCONFIG_VERSION - -# Shell to use when invoking shell scripts. -SHELL=$LTSHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$ltecho - -# The archiver. -AR=$AR -AR_FLAGS=$AR_FLAGS - -# A C compiler. -LTCC=$LTCC - -# A language-specific compiler. -CC=$CC - -# Is the compiler the GNU C compiler? -with_gcc=$with_gcc - -# The linker used to build libraries. -LD=$LD - -# Whether we need hard or soft links. -LN_S=$LN_S - -# A BSD-compatible nm program. -NM=$NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$reload_flag -reload_cmds=$reload_cmds - -# How to pass a linker flag through the compiler. -wl=$wl - -# Object file suffix (normally "o"). -objext="$objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$pic_flag -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$compiler_c_o - -# Must we lock files when doing compilation ? -need_locks=$need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$RANLIB -old_archive_cmds=$old_archive_cmds -old_postinstall_cmds=$old_postinstall_cmds -old_postuninstall_cmds=$old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$archive_cmds -archive_expsym_cmds=$archive_expsym_cmds -postinstall_cmds=$postinstall_cmds -postuninstall_cmds=$postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$old_striplib -striplib=$striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$predep_objects - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$postdep_objects - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$predeps - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$postdeps - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$compiler_lib_search_path - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$global_symbol_to_cdecl - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$include_expsyms - -EOF - -if test -z "$tagname"; then - echo '### END LIBTOOL CONFIG' >> "$ofile" -else - echo "### END LIBTOOL TAG CONFIG: $tagname" >> "$ofile" -fi - -case $ltmain in -*.sh) - echo >> "$ofile" - if test -z "$tagname"; then - case $host_os in - aix3*) - cat <<\EOF >> "$ofile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - cat <<'EOF' >> "$ofile" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include /* for printf() */ -# #include /* for open(), lseek(), read() */ -# #include /* for O_RDONLY, O_BINARY */ -# #include /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i> "$ofile" || (rm -f "$ofile"; exit 1) - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - - chmod +x "$ofile" - fi - ;; - -*) - # Compile the libtool program. - echo "FIXME: would compile $ltmain" - ;; -esac - -# Update the list of available tags. -if test -n "$tagname"; then - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" $ofile | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - # Append the new tag name to the list of available tags. - available_tags="$available_tags $tagname" - - # Now substitute the updated of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' ${ofile} > ${ofile}.new"; then - mv ${ofile}.new ${ofile} - chmod +x "$ofile" - else - rm -f ${ofile}.new - echo "$progname: unable to update list of available tagged configurations." - exit 1 - fi -fi - -# Don't cache tagged configuration! -test -n "$cache_file" && test -z "$tagname" || exit 0 - -# AC_CACHE_SAVE -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/ltmain.sh b/ltmain.sh deleted file mode 100644 index 2393e14d..00000000 --- a/ltmain.sh +++ /dev/null @@ -1,4946 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$0" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -# Parse our command line options once, thoroughly. -while test $# -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - exit 0 - ;; - - --config) - sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 - exit 0 - ;; - - --debug) - echo "$progname: enabling shell trace mode" - set -x - ;; - - --dry-run | -n) - run=: - ;; - - --features) - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - exit 0 - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --quiet | --silent) - show=: - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 -fi - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - case $nonopt in - *cc | *++ | gcc* | *-gcc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - prev= - lastarg= - srcfile="$nonopt" - suppress_output= - - user_target=no - for arg - do - case $prev in - "") ;; - xcompiler) - # Aesthetically quote the previous argument. - prev= - lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - - case $arg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - continue - ;; - esac - - # Accept any command-line options. - case $arg in - -o) - if test "$user_target" != "no"; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit 1 - fi - user_target=next - ;; - - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - continue - ;; - esac - - case $user_target in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac - - # Accept the current argument as the source file. - lastarg="$srcfile" - srcfile="$arg" - - # Aesthetically quote the previous argument. - - # Backslashify any backslashes, double quotes, and dollar signs. - # These are the only characters that are still specially - # interpreted inside of double-quoted scrings. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $lastarg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else - base_compile="$base_compile $lastarg" - fi - done - - case $user_target in - set) - ;; - no) - # Get the name of the library object. - libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - *) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit 1 - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSfmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit 1 - ;; - esac - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $libobj" - else - removelist="$libobj" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit 1" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit 1" 1 2 15 - else - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$0" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit 1 - fi - echo $srcfile > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - - # 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 - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $srcfile $pic_flag -DPIC" - else - # Don't build PIC code - command="$base_compile $srcfile" - fi - if test "$build_old_libs" = yes; then - lo_libobj="$libobj" - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$libobj"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - - if test -d "$dir"; then - $show "$rm $libobj" - $run $rm $libobj - else - $show "$mkdir $dir" - $run $mkdir $dir - status=$? - if test $status -ne 0 && test ! -d $dir; then - exit $status - fi - fi - fi - if test "$compiler_o_lo" = yes; then - output_obj="$libobj" - command="$command -o $output_obj" - elif test "$compiler_c_o" = yes; then - output_obj="$obj" - command="$command -o $output_obj" - fi - - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit 1 - fi - - 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." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed, then go on to compile the next one - if test x"$output_obj" != x"$libobj"; then - $show "$mv $output_obj $libobj" - if $run $mv $output_obj $libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # If we have no pic_flag, then copy the object into place and finish. - if (test -z "$pic_flag" || test "$pic_mode" != default) && - test "$build_old_libs" = yes; then - # Rename the .lo from within objdir to obj - if test -f $obj; then - $show $rm $obj - $run $rm $obj - fi - - $show "$mv $libobj $obj" - if $run $mv $libobj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` - libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` - # Now arrange that obj and lo_libobj become the same file - $show "(cd $xdir && $LN_S $baseobj $libobj)" - if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then - exit 0 - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Allow error messages only from the first compilation. - suppress_output=' >/dev/null 2>&1' - 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 $srcfile" - else - # All platforms use -DPIC, to notify preprocessed assembler code. - command="$base_compile $srcfile $pic_flag -DPIC" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - output_obj="$obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit 1 - fi - - 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." - - $run $rm $removelist - exit 1 - fi - - # Just move the object if needed - if test x"$output_obj" != x"$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Create an invalid libtool object if no PIC, so that we do not - # accidentally link it into a program. - if test "$build_libtool_libs" != yes; then - $show "echo timestamp > $libobj" - $run eval "echo timestamp > \$libobj" || exit $? - else - # Move the .lo from within objdir - $show "$mv $libobj $lo_libobj" - if $run $mv $libobj $lo_libobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - fi - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - - exit 0 - ;; - - # libtool link mode - link | relink) - modename="$modename: link" - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # 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 invokation. - # 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" - 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` - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -all-static | -static) - if test "X$arg" = "X-all-static"; then - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - fi - build_libtool_libs=no - build_old_libs=yes - prefer_static_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test $# -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit 1 - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n $prev - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit 1 - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - 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*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - exit 1 - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-mingw* | *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -o) prev=output ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit 1 - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.lo | *.$objext) - # A library or standard object. - if test "$prev" = dlfiles; then - # This file was specified with -dlopen. - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $arg" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` - prev= - else - case $arg in - *.lo) libobjs="$libobjs $arg" ;; - *) objs="$objs $arg" ;; - esac - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d $output_objdir; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - status=$? - if test $status -ne 0 && test ! -d $output_objdir; then - exit $status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - *.$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 - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - libs="$libs $deplib" - done - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit 1 - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode" = prog; then - # Determine which files to process - case $pass in - dlopen) - libs="$dlfiles" - save_deplibs="$deplibs" # Collect dlpreopened libraries - deplibs= - ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -l*) - if test "$linkmode" = oldlib && test "$linkmode" = obj; then - $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 - continue - fi - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - # Search the libtool library - lib="$searchdir/lib${name}.la" - if test -f "$lib"; then - found=yes - break - fi - 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 - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - if test "$deplibs_check_method" != pass_all; then - echo - echo "*** Warning: This library needs some functionality provided by $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - else - echo - echo "*** Warning: Linking the shared library $output against the" - echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test $found = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib'" 1>&2 - exit 1 - fi - - # Check to see that this really is a libtool archive. - if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variable installed. - installed=yes - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then - # Add dl[pre]opened files of deplib - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit 1 - fi - continue - fi # $pass = conv - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit 1 - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit 1 - 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. - dlprefiles="$dlprefiles $lib" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit 1 - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" - fi - continue - fi - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test $linkalldeplibs = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - link_static=no # Whether the deplib will be linked statically - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # Link against this shared library - - if test "$linkmode,$pass" = "prog,link" || - { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - if test "$linkmode" = prog; then - # We need to hardcode the library path - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - fi - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { 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 - - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`echo $soroot | sed -e 's/^.*\///'` - newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - eval cmds=\"$extract_expsyms_cmds\" - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - eval cmds=\"$old_archive_from_expsyms_cmds\" - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n $old_archive_from_expsyms_cmds - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit 1 - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - 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 - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - - # Try to link the static library - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - 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 library needs some functionality provided by $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** Therefore, libtool will create a static module, that should work " - echo "*** as long as the dlopening application is linked with the -dlopen flag." - 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 - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || test $build_old_libs = yes || - test $link_static = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="-L$absdir/$objdir" - else - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="-L$absdir" - fi - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$deplibs $path" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $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 - test "$pass" != scan && dependency_libs="$newdependency_libs" - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - *) - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - if test "$pass" = "conv" && - { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then - libs="$deplibs" # reset libs - deplibs= - fi - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit 1 - else - echo - echo "*** Warning: Linking the shared library $output against the non-libtool" - echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test $# -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - libext=al - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - current="$2" - revision="$3" - age="$4" - - # 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]) ;; - *) - $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $revision in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - case $age in - 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - ;; - esac - - if test $age -gt $current; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit 1 - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix) - major=`expr $current - $age + 1` - verstring="sgi$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test $loop != 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="sgi$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test $loop != 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit 1 - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - verstring="0.0" - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs. - $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" - $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` - deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` - dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test $hardcode_into_libs != yes || test $build_old_libs = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behaviour. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | sed 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | sed 10q \ - | egrep "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name="`expr $a_deplib : '-l\(.*\)'`" - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - if eval echo \"$potent_lib\" 2>/dev/null \ - | sed 10q \ - | egrep "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - echo "*** Warning: This library needs some functionality provided by $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | - grep . >/dev/null; then - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - echo "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test $allow_undefined = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - 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 - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - test -z "$dlname" && dlname=$soname - - lib="$output_objdir/$realname" - for link - do - linknames="$linknames $link" - done - - # Ensure that we have .o objects for linkers which dislike .lo - # (e.g. aix) in case we are running --disable-static - for obj in $libobjs; do - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - if test ! -f $xdir/$oldobj; then - $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" - $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? - fi - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - eval cmds=\"$export_symbols_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval cmds=\"$archive_expsym_cmds\" - else - eval cmds=\"$archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - exit 0 - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit 1 - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - for xlib in $convenience; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` - done - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - $show "echo timestamp > $libobj" - $run eval "echo timestamp > $libobj" || exit $? - exit 0 - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - eval cmds=\"$reload_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$libobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - $show "(cd $xdir && $LN_S $oldobj $baseobj)" - $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit 0 - ;; - - prog) - case $host in - *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$output.exp" - $run $rm $export_symbols - $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - else - $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' - $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`echo "$arg" | sed -e 's%^.*/%%'` - $run eval 'echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{\ -" - - sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ - -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ - < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr_t) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DPIC";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit 1 - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test $need_relink = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit 0 - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="cd `pwd`; $relink_command" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $0 --fallback-echo"; then - case $0 in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; - *) qecho="$SHELL `pwd`/$0 --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`echo $output|sed 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) exeext=.exe ;; - *) exeext= ;; - esac - $rm $output - trap "$rm $output; exit 1" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if (eval \$relink_command); then : - else - $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 >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # win32 systems need to use the prog path for dll - # lookup to work - *-*-cygwin* | *-*-pw32*) - $echo >> $output "\ - exec \$progdir/\$program \${1+\"\$@\"} -" - ;; - - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \$progdir\\\\\$program \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - # Export the path to the program. - PATH=\"\$progdir:\$PATH\" - export PATH - - exec \$program \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit 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\ -" - chmod +x $output - fi - exit 0 - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "mkdir $gentop" - $run mkdir "$gentop" - status=$? - if test $status -ne 0 && test ! -d "$gentop"; then - exit $status - fi - generated="$generated $gentop" - - # Add in members from convenience archives. - for xlib in $addlibs; do - # Extract the objects. - case $xlib in - [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; - *) xabs=`pwd`"/$xlib" ;; - esac - xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` - xdir="$gentop/$xlib" - - $show "${rm}r $xdir" - $run ${rm}r "$xdir" - $show "mkdir $xdir" - $run mkdir "$xdir" - status=$? - if test $status -ne 0 && test ! -d "$xdir"; then - exit $status - fi - $show "(cd $xdir && $AR x $xabs)" - $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? - - oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` - done - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - eval cmds=\"$old_archive_from_new_cmds\" - else - # Ensure that we have .o objects in place in case we decided - # not to build a shared library, and have fallen back to building - # static libs even though --disable-static was passed! - for oldobj in $oldobjs; do - if test ! -f $oldobj; then - xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$oldobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` - obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` - $show "(cd $xdir && ${LN_S} $obj $baseobj)" - $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? - fi - done - - eval cmds=\"$old_archive_cmds\" - fi - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit 1 - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test $need_relink = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit 0 - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg="$nonopt" - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest="$arg" - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) prev="-f" ;; - -g) prev="-g" ;; - -m) prev="-m" ;; - -o) prev="-o" ;; - -s) - stripme=" -s" - continue - ;; - -*) ;; - - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest="$arg" - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit 1 - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test $# -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - continue - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test $# -gt 0; then - # Delete the old symlinks, and create new ones. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - eval cmds=\"$postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit 0 - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 - exit 1 - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir="/tmp" - test -n "$TMPDIR" && tmpdir="$TMPDIR" - tmpdir="$tmpdir/libtool-$$" - if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : - else - $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 - continue - fi - file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyways - case $install_prog,$host in - /usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`echo $destfile | sed -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - eval cmds=\"$old_postinstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec $SHELL $0 --finish$current_libdirs - exit 1 - fi - - exit 0 - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - eval cmds=\"$finish_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = ":" && exit 0 - - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - echo " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - echo "See any operating system documentation about shared libraries for" - echo "more information, such as the ld(1) and ld.so(8) manual pages." - echo "----------------------------------------------------------------------" - exit 0 - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit 1 - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit 1 - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved enviroment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now actually exec the command. - eval "exec \$cmd$args" - - $echo "$modename: cannot exec \$cmd$args" - exit 1 - 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 0 - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit 1 - fi - - rmdirs= - - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$objdir" - else - objdir="$dir/$objdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test $mode = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test $mode = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - - if test $mode = uninstall; then - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - eval cmds=\"$postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - eval cmds=\"$old_postuninstall_cmds\" - IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" - if test $? != 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - fi - fi - ;; - - *.lo) - if test "$build_old_libs" = yes; then - oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` - rmfiles="$rmfiles $dir/$oldobj" - fi - ;; - - *) - # Do a test to see if this is a libtool program. - if test $mode = clean && - (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$file - - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $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 - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 - ;; - esac - - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit 1 -fi # test -z "$show_help" - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE." - exit 0 - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit 1 - ;; -esac - -echo -$echo "Try \`$modename --help' for more information about other modes." - -exit 0 - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/missing b/missing deleted file mode 100755 index d46f79f6..00000000 --- a/missing +++ /dev/null @@ -1,198 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.in; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`$configure_ac'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`$configure_ac'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`$configure_ac'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/mkinstalldirs b/mkinstalldirs deleted file mode 100755 index 6b3b5fc5..00000000 --- a/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id$ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here -- cgit From ca16ae22dd4542899a4a8c9a843fc6f7e72dbab4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 16:35:56 +0000 Subject: Add header files of the SDP library --- include/Makefile.am | 2 +- include/sdp.h | 396 ++++++++++++++++++++++++++++++++++++ include/sdp_internal.h | 216 ++++++++++++++++++++ include/sdp_lib.h | 529 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1142 insertions(+), 1 deletion(-) create mode 100644 include/sdp.h create mode 100644 include/sdp_internal.h create mode 100644 include/sdp_lib.h diff --git a/include/Makefile.am b/include/Makefile.am index 27a769fa..f615705a 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h bluetooth: ln -s . bluetooth diff --git a/include/sdp.h b/include/sdp.h new file mode 100644 index 00000000..77564850 --- /dev/null +++ b/include/sdp.h @@ -0,0 +1,396 @@ +/* + Service Discovery Protocol (SDP) + Copyright (C) 2002 Maxim Krasnyansky + + Based on original SDP implementation by Nokia Corporation. + Copyright (C) 2001,2002 Nokia Corporation. + Original author Guruprasad Krishnamurthy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, + OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE + USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef SDP_H +#define SDP_H + +#include + +#define SDP_UNIX_PATH "/var/run/sdp" +#define SDP_RESPONSE_TIMEOUT 20 +#define SDP_REQ_BUFFER_SIZE 2048 +#define SDP_RSP_BUFFER_SIZE 65535 +#define SDP_PDU_CHUNK_SIZE 1024 + +/* + * All definitions are based on Bluetooth Assigned Numbers + * of the Bluetooth Specification + */ +#define SDP_PSM 0x0001 + +/* + * Protocol UUIDs + */ +#define SDP_UUID 0x0001 +#define RFCOMM_UUID 0x0003 +#define TCS_BIN_UUID 0x0005 +#define L2CAP_UUID 0x0100 +#define IP_UUID 0x0009 +#define UDP_UUID 0x0002 +#define TCP_UUID 0x0004 +#define TCS_BIN_UUID 0x0005 +#define TCS_AT_UUID 0x0006 +#define OBEX_UUID 0x0008 +#define FTP_UUID 0x000A +#define HTTP_UUID 0x000C +#define WSP_UUID 0x000E +#define BNEP_UUID 0x000F +#define HIDP_UUID 0x0011 +#define CMTP_UUID 0x001B + +/* + * Service class identifiers of standard services and service groups + */ +#define SDP_SERVER_SVCLASS_ID 0x1000 +#define BROWSE_GRP_DESC_SVCLASS_ID 0x1001 +#define PUBLIC_BROWSE_GROUP 0x1002 +#define SERIAL_PORT_SVCLASS_ID 0x1101 +#define LAN_ACCESS_SVCLASS_ID 0x1102 +#define DIALUP_NET_SVCLASS_ID 0x1103 +#define IRMC_SYNC_SVCLASS_ID 0x1104 +#define OBEX_OBJPUSH_SVCLASS_ID 0x1105 +#define OBEX_FILETRANS_SVCLASS_ID 0x1106 +#define IRMC_SYNC_CMD_SVCLASS_ID 0x1107 +#define HEADSET_SVCLASS_ID 0x1108 +#define CORDLESS_TELEPHONY_SVCLASS_ID 0x1109 +#define INTERCOM_SVCLASS_ID 0x1110 +#define FAX_SVCLASS_ID 0x1111 +#define HEADSET_AGW_SVCLASS_ID 0x1112 +#define PANU_SVCLASS_ID 0x1115 +#define NAP_SVCLASS_ID 0x1116 +#define GN_SVCLASS_ID 0x1117 +#define IMAGING_SVCLASS_ID 0x111a +#define IMAGING_RESPONDER_SVCLASS_ID 0x111b +#define HANDSFREE_SVCLASS_ID 0x111e +#define HANDSFREE_AUDIO_GW_SVCLASS_ID 0x111f +#define HID_SVCLASS_ID 0x1124 +#define CIP_SVCLASS_ID 0x1128 +#define PNP_INFO_SVCLASS_ID 0x1200 +#define GENERIC_NETWORKING_SVCLASS_ID 0x1201 +#define GENERIC_FILETRANS_SVCLASS_ID 0x1202 +#define GENERIC_AUDIO_SVCLASS_ID 0x1203 +#define GENERIC_TELEPHONY_SVCLASS_ID 0x1204 + +/* + * Standard profile descriptor identifiers; note these + * may be identical to some of the service classes defined above + */ +#define SERIAL_PORT_PROFILE_ID 0x1101 +#define LAN_ACCESS_PROFILE_ID 0x1102 +#define DIALUP_NET_PROFILE_ID 0x1103 +#define IRMC_SYNC_PROFILE_ID 0x1104 +#define OBEX_OBJPUSH_PROFILE_ID 0x1105 +#define OBEX_FILETRANS_PROFILE_ID 0x1106 +#define IRMC_SYNC_CMD_PROFILE_ID 0x1107 +#define HEADSET_PROFILE_ID 0x1108 +#define CORDLESS_TELEPHONY_PROFILE_ID 0x1109 +#define INTERCOM_PROFILE_ID 0x1110 +#define FAX_PROFILE_ID 0x1111 +#define HEADSET_AGW_PROFILE_ID 0x1112 +#define PANU_PROFILE_ID 0x1115 +#define NAP_PROFILE_ID 0x1116 +#define GN_PROFILE_ID 0x1117 +#define IMAGING_PROFILE_ID 0x111a +#define IMAGING_RESPONDER_PROFILE_ID 0x111b +#define HANDSFREE_PROFILE_ID 0x111e +#define HID_PROFILE_ID 0x1124 +#define CIP_PROFILE_ID 0x1128 + +/* + * Attribute identifier codes + */ +#define SDP_SERVER_RECORD_HANDLE 0x0000 + +/* + * Possible values for attribute-id are listed below. + * See SDP Spec, section "Service Attribute Definitions" for more details. + */ +#define SDP_ATTR_RECORD_HANDLE 0x0000 +#define SDP_ATTR_SVCLASS_ID_LIST 0x0001 +#define SDP_ATTR_RECORD_STATE 0x0002 +#define SDP_ATTR_SERVICE_ID 0x0003 +#define SDP_ATTR_PROTO_DESC_LIST 0x0004 +#define SDP_ATTR_BROWSE_GRP_LIST 0x0005 +#define SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006 +#define SDP_ATTR_SVCINFO_TTL 0x0007 +#define SDP_ATTR_SERVICE_AVAILABILITY 0x0008 +#define SDP_ATTR_PFILE_DESC_LIST 0x0009 +#define SDP_ATTR_DOC_URL 0x000A +#define SDP_ATTR_CLNT_EXEC_URL 0x000B +#define SDP_ATTR_ICON_URL 0x000C + +#define SDP_ATTR_IP_SUBNET 0x0200 +#define SDP_ATTR_SERVICE_VERSION 0x0300 +#define SDP_EXTERNAL_NETWORK 0x0301 +#define SDP_ATTR_SUPPORTED_DATA_STORES_LIST 0x0301 +#define SDP_ATTR_REMOTE_AUDIO_VOLUME_CONTROL 0x0302 +#define SDP_ATTR_SUPPORTED_FORMATS_LIST 0x0303 +#define SDP_ATTR_SECURITY_DESC 0x030A +#define SDP_ATTR_NET_ACCESS_TYPE 0x030B +#define SDP_ATTR_MAX_NET_ACCESSRATE 0x030C +#define SDP_ATTR_IP4_SUBNET 0x030D +#define SDP_ATTR_IP6_SUBNET 0x030E +#define SDP_SUPPORTED_FEATURES 0x0311 + + +/* + * These identifiers are based on the SDP spec stating that + * "base attribute id of the primary (universal) language must be 0x0100" + */ +#define SDP_PRIMARY_LANG_BASE 0x0100 + +#define SDP_ATTR_SVCNAME_PRIMARY 0x0000 + SDP_PRIMARY_LANG_BASE +#define SDP_ATTR_SVCDESC_PRIMARY 0x0001 + SDP_PRIMARY_LANG_BASE +#define SDP_ATTR_PROVNAME_PRIMARY 0x0002 + SDP_PRIMARY_LANG_BASE + +/* + * Other languages should have their own offset; e.g.: + * #define XXXLangBase yyyy + * #define AttrServiceName_XXX 0x0000+XXXLangBase + * ... + */ + +/* + * These attributes are specific to the SDP server only; i.e., + * can be present only in the service record of the SDP server + */ +#define SDP_ATTR_VERSION_NUM_LIST 0x0200 +#define SDP_ATTR_SVCDB_STATE 0x0201 +#define SDP_ATTR_GROUP_ID 0x0200 + +/* + * The Data representation in SDP PDUs (pps 339, 340 of BT SDP Spec) + * These are the exact data type+size descriptor values + * that go into the PDU buffer. + * + * The datatype (leading 5bits) + size descriptor (last 3 bits) + * is 8 bits. The size descriptor is critical to extract the + * right number of bytes for the data value from the PDU. + * + * For most basic types, the datatype+size descriptor is + * straightforward. However for constructed types and strings, + * the size of the data is in the next "n" bytes following the + * 8 bits (datatype+size) descriptor. Exactly what the "n" is + * specified in the 3 bits of the data size descriptor. + * + * TextString and URLString can be of size 2^{8, 16, 32} bytes + * DataSequence and DataSequenceAlternates can be of size 2^{8, 16, 32} + * The size are computed post-facto in the API and are not known apriori + */ +#define SDP_DATA_NIL 0x00 +#define SDP_UINT8 0x08 +#define SDP_UINT16 0x09 +#define SDP_UINT32 0x0A +#define SDP_UINT64 0x0B +#define SDP_UINT128 0x0C +#define SDP_INT8 0x10 +#define SDP_INT16 0x11 +#define SDP_INT32 0x12 +#define SDP_INT64 0x13 +#define SDP_INT128 0x14 +#define SDP_UUID_UNSPEC 0x18 +#define SDP_UUID16 0x19 +#define SDP_UUID32 0x1A +#define SDP_UUID128 0x1C +#define SDP_TEXT_STR_UNSPEC 0x20 +#define SDP_TEXT_STR8 0x25 +#define SDP_TEXT_STR16 0x26 +#define SDP_TEXT_STR32 0x27 +#define SDP_BOOL 0x28 +#define SDP_SEQ_UNSPEC 0x30 +#define SDP_SEQ8 0x35 +#define SDP_SEQ16 0x36 +#define SDP_SEQ32 0x37 +#define SDP_ALT_UNSPEC 0x38 +#define SDP_ALT8 0x3D +#define SDP_ALT16 0x3E +#define SDP_ALT32 0x3F +#define SDP_URL_STR_UNSPEC 0x40 +#define SDP_URL_STR8 0x45 +#define SDP_URL_STR16 0x46 +#define SDP_URL_STR32 0x47 + +/* + * The PDU identifiers of SDP packets between client and server + */ +#define SDP_ERROR_RSP 0x01 +#define SDP_SVC_SEARCH_REQ 0x02 +#define SDP_SVC_SEARCH_RSP 0x03 +#define SDP_SVC_ATTR_REQ 0x04 +#define SDP_SVC_ATTR_RSP 0x05 +#define SDP_SVC_SEARCH_ATTR_REQ 0x06 +#define SDP_SVC_SEARCH_ATTR_RSP 0x07 + +/* + * Some additions to support service registration. + * These are outside the scope of the Bluetooth specification + */ +#define SDP_SVC_REGISTER_REQ 0x75 +#define SDP_SVC_REGISTER_RSP 0x76 +#define SDP_SVC_UPDATE_REQ 0x77 +#define SDP_SVC_UPDATE_RSP 0x78 +#define SDP_SVC_REMOVE_REQ 0x79 +#define SDP_SVC_REMOVE_RSP 0x80 + +/* + * Values of the flags parameter to sdp_record_register + */ +#define SDP_RECORD_PERSIST 0x01 + +/* + * Values of the flags parameter to sdp_connect + */ +#define SDP_RETRY_IF_BUSY 0x01 + +/* + * SDP Error codes + */ +#define SDP_INVALID_VERSION 0x0001 +#define SDP_INVALID_RECORD_HANDLE 0x0002 +#define SDP_INVALID_SYNTAX 0x0003 +#define SDP_INVALID_PDU_SIZE 0x0004 +#define SDP_INVALID_CSTATE 0x0005 + +/* + * SDP PDU + */ +typedef struct { + uint8_t pdu_id; + uint16_t tid; + uint16_t plen; +} __attribute__ ((packed)) sdp_pdu_hdr_t; + +/* + * Common definitions for attributes in the SDP. + * Should the type of any of these change, you need only make a change here. + */ +typedef struct { + char data[16]; +} uint128_t; + +typedef struct { + uint8_t type; + union { + uint16_t uuid16; + uint32_t uuid32; + uint128_t uuid128; + } value; +} uuid_t; + +#define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || (x) ==SDP_UUID128) + +typedef struct _sdp_list sdp_list_t; +struct _sdp_list { + sdp_list_t *next; + void *data; +}; + +/* + * User-visible strings can be in many languages + * in addition to the universal language. + * + * Language meta-data includes language code in ISO639 + * followed by the encoding format. The third field in this + * structure is the attribute offset for the language. + * User-visible strings in the specified language can be + * obtained at this offset. + */ +typedef struct { + uint16_t code_ISO639; + uint16_t encoding; + uint16_t base_offset; +} sdp_lang_attr_t; + +/* + * Profile descriptor is the Bluetooth profile metadata. If a + * service conforms to a well-known profile, then its profile + * identifier (UUID) is an attribute of the service. In addition, + * if the profile has a version number it is specified here. + */ +typedef struct { + uuid_t uuid; + uint16_t version; +} sdp_profile_desc_t; + +typedef struct { + uint8_t major; + uint8_t minor; +} sdp_version_t; + +typedef struct { + char *data; + int data_size; + int buf_size; +} sdp_buf_t; + +typedef struct { + uint32_t handle; + + /* + * Search pattern: a sequence of all UUIDs seen in this record + */ + sdp_list_t *pattern; + sdp_list_t *attrlist; +} sdp_record_t; + +typedef struct sdp_data_struct sdp_data_t; +struct sdp_data_struct { + uint8_t dtd; + uint16_t attrId; + union { + int8_t int8; + int16_t int16; + int32_t int32; + int64_t int64; + uint128_t int128; + uint8_t uint8; + uint16_t uint16; + uint32_t uint32; + uint64_t uint64; + uint128_t uint128; + uuid_t uuid; + char *str; + sdp_data_t *dataseq; + } val; + sdp_data_t *next; + int unitSize; +}; + +/* + * a session with an SDP server + */ +typedef struct { + int sock; + int state; + int local; + int flags; + uint16_t tid; // Current transaction ID +} sdp_session_t; + +#endif diff --git a/include/sdp_internal.h b/include/sdp_internal.h new file mode 100644 index 00000000..fabf7a0d --- /dev/null +++ b/include/sdp_internal.h @@ -0,0 +1,216 @@ +/* + Service Discovery Protocol (SDP) + Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane + + Based on original SDP implementation by Nokia Corporation. + Copyright (C) 2001,2002 Nokia Corporation. + Original author Guruprasad Krishnamurthy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, + OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE + USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#ifndef SDP_INTERNAL_H +#define SDP_INTERNAL_H + +#include +#include +#include +#include + +#define SDPINF(fmt, arg...) syslog(LOG_INFO, fmt "\n", ## arg) +#define SDPERR(fmt, arg...) syslog(LOG_ERR, "%s: " fmt "\n", __func__ , ## arg) + +#ifdef SDP_DEBUG +#define SDPDBG(fmt, arg...) syslog(LOG_DEBUG, "%s: " fmt "\n", __func__ , ## arg) +#else +#define SDPDBG(fmt...) +#endif + +#define SDP_BASIC_ATTR_PDUFORM_SIZE 32 +#define SDP_SEQ_PDUFORM_SIZE 128 +#define SDP_UUID_SEQ_SIZE 256 +#define SDP_MAX_ATTR_LEN 65535 + +/* + * Generate unique transaction identifiers + */ +static inline uint16_t sdp_gen_tid(sdp_session_t *session) +{ + return session->tid++; +} + +sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); +sdp_data_t *sdp_extract_string(char *, int *); + +void sdp_data_print(sdp_data_t *data); +void sdp_print_service_attr(sdp_list_t *alist); + +int sdp_attrid_comp_func(const void *key1, const void *key2); + +void sdp_set_seq_len(char *ptr, int length); +void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); +void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); +void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); + +int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); +int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); + +int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); + +sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); + +void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); +void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); + +int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); + +typedef struct { + uint8_t length; + unsigned char data[16]; +} __attribute__ ((packed)) sdp_cstate_t; + +/* + * SDP unaligned access. + * based on linux/asm-/unaligned.h + */ +#if defined(__i386__) + +#define sdp_get_unaligned(ptr) (*(ptr)) +#define sdp_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) + +#else + +struct __una_u64 { uint64_t x; } __attribute__((packed)); +struct __una_u32 { uint32_t x; } __attribute__((packed)); +struct __una_u16 { uint16_t x; } __attribute__((packed)); + +static inline unsigned long long __uldq(const unsigned long *r11) +{ + const struct __una_u64 *ptr = (const struct __una_u64 *) r11; + return ptr->x; +} + +static inline unsigned long __uldl(const unsigned int * r11) +{ + const struct __una_u32 *ptr = (const struct __una_u32 *) r11; + return ptr->x; +} + +static inline unsigned long __uldw(const unsigned short * r11) +{ + const struct __una_u16 *ptr = (const struct __una_u16 *) r11; + return ptr->x; +} + +static inline void __ustq(unsigned long r5, unsigned long * r11) +{ + struct __una_u64 *ptr = (struct __una_u64 *) r11; + ptr->x = r5; +} + +static inline void __ustl(unsigned long r5, unsigned int * r11) +{ + struct __una_u32 *ptr = (struct __una_u32 *) r11; + ptr->x = r5; +} + +static inline void __ustw(unsigned long r5, unsigned short * r11) +{ + struct __una_u16 *ptr = (struct __una_u16 *) r11; + ptr->x = r5; +} + +static inline unsigned long long __sdp_get_unaligned(const void *ptr, size_t size) +{ + unsigned long long val = 0; + switch (size) { + case 1: + val = *(const unsigned char *)ptr; + break; + case 2: + val = __uldw((const unsigned short *)ptr); + break; + case 4: + val = __uldl((const unsigned int *)ptr); + break; + case 8: + val = __uldq((const unsigned long *)ptr); + break; + } + return val; +} + +static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size) +{ + switch (size) { + case 1: + *(unsigned char *)ptr = (val); + break; + case 2: + __ustw(val, (unsigned short *)ptr); + break; + case 4: + __ustl(val, (unsigned int *)ptr); + break; + case 8: + __ustq(val, (unsigned long *)ptr); + break; + } +} + +#define sdp_get_unaligned(ptr) \ + ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) + +#define sdp_put_unaligned(x,ptr) \ + __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) + +#endif + +#if __BYTE_ORDER == __BIG_ENDIAN +#define ntoh64(x) x +static inline void ntoh128(uint128_t *src, uint128_t *dst) +{ + int i; + for (i=0; i < 16; i++) + dst->data[i] = src->data[i]; +} +#else +static inline uint64_t ntoh64(uint64_t n) +{ + uint64_t h; + uint64_t tmp = ntohl(n & 0x00000000ffffffff); + h = ntohl(n >> 32); + h |= tmp << 32; + return h; +} + +static inline void ntoh128(uint128_t *src, uint128_t *dst) +{ + int i; + for (i=0; i < 16; i++) + dst->data[15 - i] = src->data[i]; +} +#endif + +#define hton64(x) ntoh64(x) +#define hton128(x,y) ntoh128(x,y) + +#endif diff --git a/include/sdp_lib.h b/include/sdp_lib.h new file mode 100644 index 00000000..4306eb55 --- /dev/null +++ b/include/sdp_lib.h @@ -0,0 +1,529 @@ +/* + Service Discovery Protocol (SDP) + Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane + + Based on original SDP implementation by Nokia Corporation. + Copyright (C) 2001,2002 Nokia Corporation. + Original author Guruprasad Krishnamurthy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, + OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE + USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. + */ + +/* + * $Id$ + */ + +#ifndef SDP_LIB_H +#define SDP_LIB_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * SDP lists + */ +typedef void(*sdp_list_func_t)(void *, void *); +typedef void(*sdp_free_func_t)(void *); +typedef int (*sdp_comp_func_t)(const void *, const void *); + +sdp_list_t *sdp_list_append(sdp_list_t *list, void *d); +sdp_list_t *sdp_list_remove(sdp_list_t *list, void *d); +sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *data, sdp_comp_func_t f); +void sdp_list_free(sdp_list_t *list, sdp_free_func_t f); + +static inline int sdp_list_len(const sdp_list_t *list) +{ + int n = 0; + for (; list; list = list->next) + n++; + return n; +} + +static inline sdp_list_t *sdp_list_find(sdp_list_t *list, void *u, sdp_comp_func_t f) +{ + for (; list; list = list->next) + if (f(list->data, u) == 0) + return list; + return NULL; +} + +static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u) +{ + for (; list; list = list->next) + f(list->data, u); +} + +/* + * create an L2CAP connection to a Bluetooth device + * + * INPUT: + * + * bdaddr_t *src: + * Address of the local device to use to make the connection + * (or BDADDR_ANY) + * + * bdaddr_t *dst: + * Address of the SDP server device + */ +sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags); +int sdp_close(sdp_session_t *session); + +static inline int sdp_get_socket(const sdp_session_t *s) +{ + return s->sock; +} + +/* + * find all devices in the piconet + */ +int sdp_general_inquiry(inquiry_info *ii, int dev_num, int duration, uint8_t *found); + +/* flexible extraction of basic attributes - Jean II */ +int sdp_get_int_attr(const sdp_record_t *rec, uint16_t attr, int *value); +int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attr, char *value, int valuelen); + +/* + * Basic sdp data functions + */ +sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value); +void sdp_data_free(sdp_data_t *data); +sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attr_id); + +sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len); +sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *data); + +int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *data); +void sdp_attr_remove(sdp_record_t *rec, uint16_t attr); +void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *data); +int sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t attr, sdp_list_t *seq); +int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **seqp); + +/* + * NOTE that none of the functions below will update the SDP server, + * unless the {register, update}sdp_record_t() function is invoked. + * All functions which return an integer value, return 0 on success + * or -1 on failure. + */ + +/* + * Create an attribute and add it to the service record's attribute list. + * This consists of the data type descriptor of the attribute, + * the value of the attribute and the attribute identifier. + */ +int sdp_attr_add_new(sdp_record_t *rec, uint16_t attr, uint8_t dtd, const void *p); + +/* + * Set the information attributes of the service record. + * The set of attributes comprises service name, description + * and provider name + */ +void sdp_set_info_attr(sdp_record_t *rec, const char *name, const char *prov, const char *desc); + +/* + * Set the ServiceClassID attribute to the sequence specified by seq. + * Note that the identifiers need to be in sorted order from the most + * specific to the most generic service class that this service + * conforms to. + */ +static inline int sdp_set_service_classes(sdp_record_t *rec, sdp_list_t *seq) +{ + return sdp_set_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seq); +} + +/* + * Get the service classes to which the service conforms. + * + * When set, the list contains elements of ServiceClassIdentifer(uint16_t) + * ordered from most specific to most generic + */ +static inline int sdp_get_service_classes(const sdp_record_t *rec, sdp_list_t **seqp) +{ + return sdp_get_uuidseq_attr(rec, SDP_ATTR_SVCLASS_ID_LIST, seqp); +} + +/* + * Set the BrowseGroupList attribute to the list specified by seq. + * + * A service can belong to one or more service groups + * and the list comprises such group identifiers (UUIDs) + */ +static inline int sdp_set_browse_groups(sdp_record_t *rec, sdp_list_t *seq) +{ + return sdp_set_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seq); +} + +/* + * Set the access protocols of the record to those specified in proto + */ +int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto); + +/* + * Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM) + */ +int sdp_get_proto_port(const sdp_list_t *list, int proto); + +/* + * Get protocol descriptor. + */ +sdp_data_t *sdp_get_proto_desc(sdp_list_t *list, int proto); + +/* + * Set the LanguageBase attributes to the values specified in list + * (a linked list of sdp_lang_attr_t objects, one for each language in + * which user-visible attributes are present). + */ +int sdp_set_lang_attr(sdp_record_t *rec, const sdp_list_t *list); + +/* + * Set the ServiceInfoTimeToLive attribute of the service. + * This is the number of seconds that this record is guaranteed + * not to change after being obtained by a client. + */ +static inline int sdp_set_service_ttl(sdp_record_t *rec, uint32_t ttl) +{ + return sdp_attr_add_new(rec, SDP_ATTR_SVCINFO_TTL, SDP_UINT32, &ttl); +} + +/* + * Set the ServiceRecordState attribute of a service. This is + * guaranteed to change if there is any kind of modification to + * the record. + */ +static inline int sdp_set_record_state(sdp_record_t *rec, uint32_t state) +{ + return sdp_attr_add_new(rec, SDP_ATTR_RECORD_STATE, SDP_UINT32, &state); +} + +/* + * Set the ServiceID attribute of a service. + */ +void sdp_set_service_id(sdp_record_t *rec, uuid_t uuid); + +/* + * Set the GroupID attribute of a service + */ +void sdp_set_group_id(sdp_record_t *rec, uuid_t grouuuid); + +/* + * Set the ServiceAvailability attribute of a service. + * + * Note that this represents the relative availability + * of the service: 0x00 means completely unavailable; + * 0xFF means maximum availability. + */ +static inline int sdp_set_service_avail(sdp_record_t *rec, uint8_t avail) +{ + return sdp_attr_add_new(rec, SDP_ATTR_SERVICE_AVAILABILITY, SDP_UINT8, &avail); +} + +/* + * Set the profile descriptor list attribute of a record. + * + * Each element in the list is an object of type + * sdp_profile_desc_t which is a definition of the + * Bluetooth profile that this service conforms to. + */ +int sdp_set_profile_descs(sdp_record_t *rec, const sdp_list_t *desc); + +/* + * Set URL attributes of a record. + * + * ClientExecutableURL: a URL to a client's platform specific (WinCE, + * PalmOS) executable code that can be used to access this service. + * + * DocumentationURL: a URL pointing to service documentation + * + * IconURL: a URL to an icon that can be used to represent this service. + * + * Note: pass NULL for any URLs that you don't want to set or remove + */ +void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char *docURL, const char *iconURL); + +/* + * a service search request. + * + * INPUT : + * + * sdp_list_t *search_list + * list containing elements of the search + * pattern. Each entry in the list is a UUID + * of the service to be searched + * + * uint16_t max_rec_num + * An integer specifying the maximum number of + * entries that the client can handle in the response. + * + * OUTPUT : + * + * int return value + * 0 + * The request completed successfully. This does not + * mean the requested services were found + * -1 + * The request completed unsuccessfully + * + * sdp_list_t *rsp_list + * This variable is set on a successful return if there are + * non-zero service handles. It is a singly linked list of + * service records (sdp_record_t) + */ +int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num, sdp_list_t **rsp_list); + +/* + * a service attribute request. + * + * INPUT : + * + * uint32_t handle + * The handle of the service for which the attribute(s) are + * requested + * + * sdp_attrreq_type_t reqtype + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrid_list + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * OUTPUT : + * int return value + * 0 + * The request completed successfully. This does not + * mean the requested services were found + * -1 + * The request completed unsuccessfully due to a timeout + */ + +typedef enum { + /* + * Attributes are specified as individual elements + */ + SDP_ATTR_REQ_INDIVIDUAL = 1, + /* + * Attributes are specified as a range + */ + SDP_ATTR_REQ_RANGE +} sdp_attrreq_type_t; + +sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); + +/* + * This is a service search request combined with the service + * attribute request. First a service class match is done and + * for matching service, requested attributes are extracted + * + * INPUT : + * + * sdp_list_t *search_list + * Singly linked list containing elements of the search + * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16) + * of the service to be searched + * + * AttributeSpecification attrSpec + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrid_list + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * OUTPUT : + * int return value + * 0 + * The request completed successfully. This does not + * mean the requested services were found + * -1 + * The request completed unsuccessfully due to a timeout + * + * sdp_list_t *rsp_list + * This variable is set on a successful return to point to + * service(s) found. Each element of this list is of type + * sdp_record_t *. + */ +int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list); + +/* + * Allocate/free a service record and its attributes + */ +sdp_record_t *sdp_record_alloc(void); +void sdp_record_free(sdp_record_t *rec); + +/* + * Register a service record. + * + * Note: It is the responsbility of the Service Provider to create the + * record first and set its attributes using setXXX() methods. + * + * The service provider must then call sdp_record_register() to make + * the service record visible to SDP clients. + */ +int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); + +/* + * Unregister a service record. + */ +int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); + +/* + * Update an existing service record. (Calling this function + * before a previous call to sdp_record_register() will result + * in an error.) + */ +int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec); + +void sdp_record_print(const sdp_record_t *rec); + +/* + * UUID functions + */ +uuid_t *sdp_uuid16_create(uuid_t *uuid, uint16_t data); +uuid_t *sdp_uuid32_create(uuid_t *uuid, uint32_t data); +uuid_t *sdp_uuid128_create(uuid_t *uuid, const void *data); +int sdp_uuid16_cmp(const void *p1, const void *p2); +int sdp_uuid128_cmp(const void *p1, const void *p2); +uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid); +void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16); +int sdp_uuid128_to_uuid(uuid_t *uuid); +int sdp_uuid_to_proto(uuid_t *uuid); +int sdp_uuid_extract(const char *buffer, uuid_t *uuid, int *scanned); +void sdp_uuid_print(const uuid_t *uuid); + +#define MAX_LEN_UUID_STR 37 +#define MAX_LEN_PROTOCOL_UUID_STR 8 +#define MAX_LEN_SERVICECLASS_UUID_STR 24 +#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 22 + +int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n); +int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n); +int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n); +int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n); + +/* + * In all the sdp_get_XXX(handle, XXX *xxx) functions below, + * the XXX * is set to point to the value, should it exist + * and 0 is returned. If the value does not exist, -1 is + * returned and errno set to ENODATA. + * + * In all the methods below, the memory management rules are + * simple. Don't free anything! The pointer returned, in the + * case of constructed types, is a pointer to the contents + * of the sdp_record_t. + */ + +/* + * Get the access protocols from the service record + */ +int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos); + +/* + * Extract the list of browse groups to which the service belongs. + * When set, seqp contains elements of GroupID (uint16_t) + */ +static inline int sdp_get_browse_groups(const sdp_record_t *rec, sdp_list_t **seqp) +{ + return sdp_get_uuidseq_attr(rec, SDP_ATTR_BROWSE_GRP_LIST, seqp); +} + +/* + * Extract language attribute meta-data of the service record. + * For each language in the service record, LangSeq has a struct of type + * sdp_lang_attr_t. + */ +int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq); + +/* + * Extract the Bluetooth profile descriptor sequence from a record. + * Each element in the list is of type sdp_profile_desc_t + * which contains the UUID of the profile and its version number + * (encoded as major and minor in the high-order 8bits + * and low-order 8bits respectively of the uint16_t) + */ +int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDesc); + +/* + * Extract SDP server version numbers + * + * Note: that this is an attribute of the SDP server only and + * contains a list of uint16_t each of which represent the + * major and minor SDP version numbers supported by this server + */ +int sdp_get_server_ver(const sdp_record_t *rec, sdp_list_t **pVnumList); + +int sdp_get_service_id(const sdp_record_t *rec, uuid_t *uuid); +int sdp_get_group_id(const sdp_record_t *rec, uuid_t *uuid); +int sdp_get_record_state(const sdp_record_t *rec, uint32_t *svcRecState); +int sdp_get_service_avail(const sdp_record_t *rec, uint8_t *svcAvail); +int sdp_get_service_ttl(const sdp_record_t *rec, uint32_t *svcTTLInfo); +int sdp_get_database_state(const sdp_record_t *rec, uint32_t *svcDBState); + +static inline int sdp_get_service_name(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, str, len); +} + +static inline int sdp_get_service_desc(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, str, len); +} + +static inline int sdp_get_provider_name(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, str, len); +} + +static inline int sdp_get_doc_url(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, str, len); +} + +static inline int sdp_get_clnt_exec_url(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, str, len); +} + +static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) +{ + return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); +} + +#ifdef __cplusplus +} +#endif + +#endif -- cgit From 542fc57346fbb329934152f446f58cc61a5d5d00 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 16:37:55 +0000 Subject: Add SDP library code --- src/Makefile.am | 9 +- src/sdp.c | 3076 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3082 insertions(+), 3 deletions(-) create mode 100644 src/sdp.c diff --git a/src/Makefile.am b/src/Makefile.am index 2388a753..6c6b9fc4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,9 +2,12 @@ # $Id$ # -lib_LTLIBRARIES = libbluetooth.la +lib_LTLIBRARIES = libbluetooth.la libsdp.la -libbluetooth_la_SOURCES = bluetooth.c hci.c -libbluetooth_la_LDFLAGS = -version-info 1:3:0 +libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c +libbluetooth_la_LDFLAGS = -version-info 1:4:0 + +libsdp_la_SOURCES = +libsdp_la_LDFLAGS = -version-info 2:2:0 INCLUDES = -I$(top_srcdir)/include diff --git a/src/sdp.c b/src/sdp.c new file mode 100644 index 00000000..4ffb0d93 --- /dev/null +++ b/src/sdp.c @@ -0,0 +1,3076 @@ +/* + BlueZ - Bluetooth protocol stack for Linux + Copyright (C) 2000-2001 Qualcomm Incorporated + + Written 2000,2001 by Maxim Krasnyansky + + Based on an original SDP implementation by Nokia Corporation. + Copyright (C) 2001,2002 Nokia Corporation. + Original author Guruprasad Krishnamurthy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +/* + * $Id$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define BASE_UUID "00000000-0000-1000-8000-00805F9B34FB" + +static uint128_t *bluetooth_base_uuid = NULL; + +/* Message structure. */ +struct tupla { + int index; + char *str; +}; + +static struct tupla Protocol[] = { + { SDP_UUID, "SDP" }, + { RFCOMM_UUID, "RFCOMM" }, + { TCS_BIN_UUID, "TCS-BIN" }, + { L2CAP_UUID, "L2CAP" }, + { IP_UUID, "IP" }, + { UDP_UUID, "UDP" }, + { TCP_UUID, "TCP" }, + { TCS_AT_UUID, "TCS-AT" }, + { OBEX_UUID, "OBEX" }, + { FTP_UUID, "FTP" }, + { HTTP_UUID, "HTTP" }, + { WSP_UUID, "WSP" }, + { BNEP_UUID, "BNEP" }, + { 0 } +}; + +static struct tupla ServiceClass[] = { + { SDP_SERVER_SVCLASS_ID, "SDP Server" }, + { BROWSE_GRP_DESC_SVCLASS_ID, "Browse Group Descriptor" }, + { PUBLIC_BROWSE_GROUP, "Public Browse Group" }, + { SERIAL_PORT_SVCLASS_ID, "Serial Port" }, + { LAN_ACCESS_SVCLASS_ID, "LAN Access Using PPP" }, + { DIALUP_NET_SVCLASS_ID, "Dialup Networking" }, + { IRMC_SYNC_SVCLASS_ID, "IrMCSync" }, + { OBEX_OBJPUSH_SVCLASS_ID, "OBEX Object Push" }, + { OBEX_FILETRANS_SVCLASS_ID, "OBEX File Transfer" }, + { IRMC_SYNC_CMD_SVCLASS_ID, "IrMCSync Command" }, + { HEADSET_SVCLASS_ID, "Headset" }, + { CORDLESS_TELEPHONY_SVCLASS_ID,"Cordless Telephony" }, + { INTERCOM_SVCLASS_ID, "Intercom" }, + { FAX_SVCLASS_ID, "Fax" }, + { HEADSET_AGW_SVCLASS_ID, "Headset Audio Gateway" }, + { PNP_INFO_SVCLASS_ID, "PnP Information" }, + { GENERIC_NETWORKING_SVCLASS_ID,"Generic Networking" }, + { GENERIC_FILETRANS_SVCLASS_ID, "Generic File Transfer" }, + { GENERIC_AUDIO_SVCLASS_ID, "Generic Audio" }, + { GENERIC_TELEPHONY_SVCLASS_ID, "Generic Telephony" }, + { PANU_SVCLASS_ID, "PAN user" }, + { NAP_SVCLASS_ID, "Network access point" }, + { GN_SVCLASS_ID, "PAN group network" }, + { 0 } +}; + +static struct tupla Profile[] = { + { SERIAL_PORT_PROFILE_ID, "Serial Port" }, + { LAN_ACCESS_PROFILE_ID, "LAN Access Using PPP" }, + { DIALUP_NET_PROFILE_ID, "Dialup Networking" }, + { IRMC_SYNC_PROFILE_ID, "IrMCSync" }, + { OBEX_OBJPUSH_PROFILE_ID, "OBEX Object Push" }, + { OBEX_FILETRANS_PROFILE_ID, "OBEX File Transfer" }, + { IRMC_SYNC_CMD_PROFILE_ID, "IrMCSync Command" }, + { HEADSET_PROFILE_ID, "Headset" }, + { CORDLESS_TELEPHONY_PROFILE_ID, "Cordless Telephony" }, + { INTERCOM_PROFILE_ID, "Intercom" }, + { FAX_PROFILE_ID, "Fax" }, + { HEADSET_AGW_PROFILE_ID, "Headset Audio Gateway" }, + { PANU_PROFILE_ID, "PAN user" }, + { NAP_PROFILE_ID, "PAN access point" }, + { GN_PROFILE_ID, "PAN group network" }, + { 0 } +}; + +static char *string_lookup(struct tupla *pt0, int index) +{ + struct tupla *pt; + for (pt = pt0; pt->index; pt++) + if (pt->index == index) + return pt->str; + return ""; +} + +/* + * Prints into a string the Protocol UUID + * coping a maximum of n characters. + */ +static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t n) +{ + char *str2; + + if (!uuid) { + snprintf(str, n, "NULL"); + return -2; + } + switch (uuid->type) { + case SDP_UUID16: + str2 = string_lookup(message, uuid->value.uuid16); + snprintf(str, n, str2); + break; + case SDP_UUID32: + snprintf(str, n, "Error: This is uuid32"); + return -3; + case SDP_UUID128: + snprintf(str, n, "Error: This is uuid128"); + return -4; + default: + snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type); + return -1; + } + return 0; +} + +int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n) +{ + return uuid2str(Protocol, uuid, str, n); +} + +int sdp_svclass_uuid2strn(const uuid_t *uuid, char *str, size_t n) +{ + return uuid2str(ServiceClass, uuid, str, n); +} + +int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n) +{ + return uuid2str(Profile, uuid, str, n); +} + +/* + * convert the UUID to string, copying a maximum of n characters. + */ +int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n) +{ + if (!uuid) { + snprintf(str, n, "NULL"); + return -2; + } + switch (uuid->type) { + case SDP_UUID16: + snprintf(str, n, "%.4x", uuid->value.uuid16); + break; + case SDP_UUID32: + snprintf(str, n, "%.8x", uuid->value.uuid32); + break; + case SDP_UUID128:{ + unsigned int data0; + unsigned short data1; + unsigned short data2; + unsigned short data3; + unsigned int data4; + unsigned short data5; + + memcpy(&data0, &uuid->value.uuid128.data[0], 4); + memcpy(&data1, &uuid->value.uuid128.data[4], 2); + memcpy(&data2, &uuid->value.uuid128.data[6], 2); + memcpy(&data3, &uuid->value.uuid128.data[8], 2); + memcpy(&data4, &uuid->value.uuid128.data[10], 4); + memcpy(&data5, &uuid->value.uuid128.data[14], 2); + + snprintf(str, n, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x", + ntohl(data0), ntohs(data1), + ntohs(data2), ntohs(data3), + ntohl(data4), ntohs(data5)); + } + break; + default: + snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type); + return -1; // Enum type of UUID not set + } + return 0; +} + +#ifdef SDP_DEBUG +/* + * Function prints the UUID in hex as per defined syntax - + * + * 4bytes-2bytes-2bytes-2bytes-6bytes + * + * There is some ugly code, including hardcoding, but + * that is just the way it is converting 16 and 32 bit + * UUIDs to 128 bit as defined in the SDP doc + */ +void sdp_uuid_print(const uuid_t *uuid) +{ + if (uuid == NULL) { + SDPERR("Null passed to print UUID\n"); + return; + } + if (uuid->type == SDP_UUID16) { + SDPDBG(" uint16_t : 0x%.4x\n", uuid->value.uuid16); + } else if (uuid->type == SDP_UUID32) { + SDPDBG(" uint32_t : 0x%.8x\n", uuid->value.uuid32); + } else if (uuid->type == SDP_UUID128) { + unsigned int data0; + unsigned short data1; + unsigned short data2; + unsigned short data3; + unsigned int data4; + unsigned short data5; + + memcpy(&data0, &uuid->value.uuid128.data[0], 4); + memcpy(&data1, &uuid->value.uuid128.data[4], 2); + memcpy(&data2, &uuid->value.uuid128.data[6], 2); + memcpy(&data3, &uuid->value.uuid128.data[8], 2); + memcpy(&data4, &uuid->value.uuid128.data[10], 4); + memcpy(&data5, &uuid->value.uuid128.data[14], 2); + + SDPDBG(" uint128_t : 0x%.8x-", ntohl(data0)); + SDPDBG("%.4x-", ntohs(data1)); + SDPDBG("%.4x-", ntohs(data2)); + SDPDBG("%.4x-", ntohs(data3)); + SDPDBG("%.8x", ntohl(data4)); + SDPDBG("%.4x\n", ntohs(data5)); + } else + SDPERR("Enum type of UUID not set\n"); +} +#endif + +sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) +{ + sdp_data_t *seq; + int len = 0; + sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + + if (!d) + return NULL; + + memset(d, 0, sizeof(sdp_data_t)); + d->dtd = dtd; + d->unitSize = sizeof(uint8_t); + + switch (dtd) { + case SDP_DATA_NIL: + break; + case SDP_UINT8: + d->val.uint8 = *(uint8_t *)value; + d->unitSize += sizeof(uint8_t); + break; + case SDP_INT8: + case SDP_BOOL: + d->val.int8 = *(int8_t *)value; + d->unitSize += sizeof(int8_t); + break; + case SDP_UINT16: + d->val.uint16 = sdp_get_unaligned((uint16_t *)value); + d->unitSize += sizeof(uint16_t); + break; + case SDP_INT16: + d->val.int16 = sdp_get_unaligned((int16_t *)value); + d->unitSize += sizeof(int16_t); + break; + case SDP_UINT32: + d->val.uint32 = sdp_get_unaligned((uint32_t *)value); + d->unitSize += sizeof(uint32_t); + break; + case SDP_INT32: + d->val.int32 = sdp_get_unaligned((int32_t *)value); + d->unitSize += sizeof(int32_t); + break; + case SDP_INT64: + d->val.int64 = sdp_get_unaligned((int64_t *)value); + d->unitSize += sizeof(int64_t); + break; + case SDP_UINT64: + d->val.uint64 = sdp_get_unaligned((uint64_t *)value); + d->unitSize += sizeof(uint64_t); + break; + case SDP_UINT128: + memcpy(&d->val.uint128.data, value, sizeof(uint128_t)); + d->unitSize += sizeof(uint128_t); + break; + case SDP_INT128: + memcpy(&d->val.int128.data, value, sizeof(uint128_t)); + d->unitSize += sizeof(uint128_t); + break; + case SDP_UUID16: + sdp_uuid16_create(&d->val.uuid, sdp_get_unaligned((uint16_t *)value)); + d->unitSize += sizeof(uint16_t); + break; + case SDP_UUID32: + sdp_uuid32_create(&d->val.uuid, sdp_get_unaligned((uint32_t *)value)); + d->unitSize += sizeof(uint32_t); + break; + case SDP_UUID128: + sdp_uuid128_create(&d->val.uuid, value); + d->unitSize += sizeof(uint128_t); + break; + case SDP_URL_STR8: + case SDP_TEXT_STR8: + case SDP_URL_STR16: + case SDP_TEXT_STR16: + if (!value) + goto out_error; + + len = strlen(value); + d->unitSize += len; + if (len <= USHRT_MAX) { + d->val.str = (char *)malloc(len + 1); + if (!d->val.str) + goto out_error; + + strcpy(d->val.str, value); + if (len <= UCHAR_MAX) { + d->unitSize += sizeof(uint8_t); + if (dtd != SDP_URL_STR8 && dtd != SDP_TEXT_STR8) { + if (dtd == SDP_URL_STR16) + dtd = SDP_URL_STR8; + else + dtd = SDP_TEXT_STR8; + } + } else { + d->unitSize += sizeof(uint16_t); + if (dtd == SDP_TEXT_STR8) + dtd = SDP_TEXT_STR16; + else + dtd = SDP_URL_STR16; + } + } else { + SDPERR("Strings of size > USHRT_MAX not supported\n"); + goto out_error; + } + break; + case SDP_URL_STR32: + case SDP_TEXT_STR32: + SDPERR("Strings of size > USHRT_MAX not supported\n"); + break; + case SDP_ALT8: + case SDP_ALT16: + case SDP_ALT32: + case SDP_SEQ8: + case SDP_SEQ16: + case SDP_SEQ32: + if (dtd == SDP_ALT8 || dtd == SDP_SEQ8) + d->unitSize += sizeof(uint8_t); + else if (dtd == SDP_ALT16 || dtd == SDP_SEQ16) + d->unitSize += sizeof(uint16_t); + else if (dtd == SDP_ALT32 || dtd == SDP_SEQ32) + d->unitSize += sizeof(uint32_t); + seq = (sdp_data_t *)value; + d->val.dataseq = seq; + for (; seq; seq = seq->next) + d->unitSize += seq->unitSize; + break; + default: + goto out_error; + } + return d; + +out_error: + free(d); + return NULL; +} + +sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *d) +{ + if (seq) { + sdp_data_t *p; + for (p = seq; p->next; p = p->next); + p->next = d; + } else + seq = d; + d->next = NULL; + return seq; +} + +sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len) +{ + sdp_data_t *curr = NULL, *seq = NULL; + int i; + + for (i = 0; i < len; i++) { + sdp_data_t *data; + uint8_t dtd = *(uint8_t *)dtds[i]; + if (dtd >= SDP_SEQ8 && dtd <= SDP_ALT32) + data = (sdp_data_t *)values[i]; + else + data = sdp_data_alloc(dtd, values[i]); + if (!data) + return NULL; + if (curr) + curr->next = data; + else + seq = data; + curr = data; + } + return sdp_data_alloc(SDP_SEQ8, seq); +} + +int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *d) +{ + sdp_data_t *p = sdp_data_get(rec, attr); + + if (p) + return -1; + d->attrId = attr; + rec->attrlist = sdp_list_insert_sorted(rec->attrlist, d, sdp_attrid_comp_func); + return 0; +} + +void sdp_attr_remove(sdp_record_t *rec, uint16_t attr) +{ + sdp_data_t *d = sdp_data_get(rec, attr); + if (d) + rec->attrlist = sdp_list_remove(rec->attrlist, d); +} + +void sdp_set_seq_len(char *ptr, int length) +{ + uint8_t dtd = *(uint8_t *)ptr++; + + switch (dtd) { + case SDP_SEQ8: + case SDP_ALT8: + case SDP_TEXT_STR8: + case SDP_URL_STR8: + *(uint8_t *)ptr = (uint8_t)length; + break; + case SDP_SEQ16: + case SDP_ALT16: + case SDP_TEXT_STR16: + case SDP_URL_STR16: + sdp_put_unaligned(htons(length), (uint16_t *)ptr); + break; + case SDP_SEQ32: + case SDP_ALT32: + case SDP_TEXT_STR32: + case SDP_URL_STR32: + sdp_put_unaligned(htons(length), (uint32_t *)ptr); + break; + } +} + +int sdp_set_data_type(sdp_buf_t *buf, uint8_t dtd) +{ + int orig = buf->data_size; + uint8_t *p = buf->data + buf->data_size; + + *p++ = dtd; + buf->data_size += sizeof(uint8_t); + switch (dtd) { + case SDP_SEQ8: + case SDP_TEXT_STR8: + case SDP_URL_STR8: + case SDP_ALT8: + buf->data_size += sizeof(uint8_t); + break; + case SDP_SEQ16: + case SDP_TEXT_STR16: + case SDP_URL_STR16: + case SDP_ALT16: + buf->data_size += sizeof(uint16_t); + break; + case SDP_SEQ32: + case SDP_TEXT_STR32: + case SDP_URL_STR32: + case SDP_ALT32: + buf->data_size += sizeof(uint32_t); + break; + } + return buf->data_size - orig; +} + +void sdp_set_attrid(sdp_buf_t *buf, uint16_t attr) +{ + uint8_t *p = buf->data; + + // data type for attr + *p++ = SDP_UINT16; + buf->data_size = sizeof(uint8_t); + sdp_put_unaligned(htons(attr), (uint16_t *)p); + p += sizeof(uint16_t); + buf->data_size += sizeof(uint16_t); +} + +static int get_data_size(sdp_buf_t *buf, sdp_data_t *sdpdata) +{ + sdp_data_t *d; + int n = 0; + + for (d = sdpdata->val.dataseq; d; d = d->next) + n += sdp_gen_pdu(buf, d); + return n; +} + +int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) +{ + int pdu_size = 0, data_size = 0; + unsigned char *src = NULL, is_seq = 0, is_alt = 0; + uint8_t dtd = d->dtd; + uint16_t u16; + uint32_t u32; + uint64_t u64; + uint128_t u128; + char *seqp = buf->data + buf->data_size; + + pdu_size = sdp_set_data_type(buf, dtd); + switch (dtd) { + case SDP_DATA_NIL: + break; + case SDP_UINT8: + src = &d->val.uint8; + data_size = sizeof(uint8_t); + break; + case SDP_UINT16: + u16 = htons(d->val.uint16); + src = (unsigned char *)&u16; + data_size = sizeof(uint16_t); + break; + case SDP_UINT32: + u32 = htonl(d->val.uint32); + src = (unsigned char *)&u32; + data_size = sizeof(uint32_t); + break; + case SDP_UINT64: + u64 = hton64(d->val.uint64); + src = (unsigned char *)&u64; + data_size = sizeof(uint64_t); + break; + case SDP_UINT128: + hton128(&d->val.uint128, &u128); + src = (unsigned char *)&u128; + data_size = sizeof(uint128_t); + break; + case SDP_INT8: + case SDP_BOOL: + src = (unsigned char *)&d->val.int8; + data_size = sizeof(int8_t); + break; + case SDP_INT16: + u16 = htons(d->val.int16); + src = (unsigned char *)&u16; + data_size = sizeof(int16_t); + break; + case SDP_INT32: + u32 = htonl(d->val.int32); + src = (unsigned char *)&u32; + data_size = sizeof(int32_t); + break; + case SDP_INT64: + u64 = hton64(d->val.int64); + src = (unsigned char *)&u64; + data_size = sizeof(int64_t); + break; + case SDP_INT128: + hton128(&d->val.int128, &u128); + src = (unsigned char *)&u128; + data_size = sizeof(uint128_t); + break; + case SDP_TEXT_STR8: + case SDP_URL_STR8: + case SDP_TEXT_STR16: + case SDP_TEXT_STR32: + case SDP_URL_STR16: + case SDP_URL_STR32: + src = (unsigned char *)d->val.str; + data_size = strlen(d->val.str); + sdp_set_seq_len(seqp, data_size); + break; + case SDP_SEQ8: + case SDP_SEQ16: + case SDP_SEQ32: + is_seq = 1; + data_size = get_data_size(buf, d); + sdp_set_seq_len(seqp, data_size); + break; + case SDP_ALT8: + case SDP_ALT16: + case SDP_ALT32: + is_alt = 1; + data_size = get_data_size(buf, d); + sdp_set_seq_len(seqp, data_size); + break; + case SDP_UUID16: + u16 = htons(d->val.uuid.value.uuid16); + src = (unsigned char *)&u16; + data_size = sizeof(uint16_t); + break; + case SDP_UUID32: + u32 = htonl(d->val.uuid.value.uuid32); + src = (unsigned char *)&u32; + data_size = sizeof(uint32_t); + break; + case SDP_UUID128: + src = (unsigned char *)&d->val.uuid.value.uuid128; + data_size = sizeof(uint128_t); + break; + default: + break; + } + if (!is_seq && !is_alt) { + if (src && buf) { + memcpy(buf->data + buf->data_size, src, data_size); + buf->data_size += data_size; + } else if (dtd != SDP_DATA_NIL) + SDPDBG("Gen PDU : Cant copy from NULL source or dest\n"); + } + pdu_size += data_size; + return pdu_size; +} + +static void sdp_attr_pdu(void *value, void *udata) +{ + sdp_append_to_pdu((sdp_buf_t *)udata, (sdp_data_t *)value); +} + +int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *buf) +{ + buf->data = (char *)malloc(SDP_PDU_CHUNK_SIZE); + if (buf->data) { + buf->buf_size = SDP_PDU_CHUNK_SIZE; + buf->data_size = 0; + memset(buf->data, 0, buf->buf_size); + sdp_list_foreach(rec->attrlist, sdp_attr_pdu, buf); + return 0; + } + return -1; +} + +void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *d) +{ + sdp_data_t *p = sdp_data_get(rec, attr); + + if (p) { + rec->attrlist = sdp_list_remove(rec->attrlist, p); + sdp_data_free(p); + } + d->attrId = attr; + rec->attrlist = sdp_list_insert_sorted(rec->attrlist, (void *)d, sdp_attrid_comp_func); +} + +int sdp_attrid_comp_func(const void *key1, const void *key2) +{ + const sdp_data_t *d1 = (const sdp_data_t *)key1; + const sdp_data_t *d2 = (const sdp_data_t *)key2; + + if (d1 && d2) + return d1->attrId - d2->attrId; + return 0; +} + +static void data_seq_free(sdp_data_t *seq) +{ + sdp_data_t *d = seq->val.dataseq; + + while (d) { + sdp_data_t *next = d->next; + sdp_data_free(d); + d = next; + } +} + +void sdp_data_free(sdp_data_t *d) +{ + switch (d->dtd) { + case SDP_SEQ8: + case SDP_SEQ16: + case SDP_SEQ32: + data_seq_free(d); + break; + case SDP_URL_STR8: + case SDP_URL_STR16: + case SDP_URL_STR32: + case SDP_TEXT_STR8: + case SDP_TEXT_STR16: + case SDP_TEXT_STR32: + free(d->val.str); + break; + } + free(d); +} + +static sdp_data_t *extract_int(const void *p, int *len) +{ + sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + + SDPDBG("Extracting integer\n"); + memset(d, 0, sizeof(sdp_data_t)); + d->dtd = *(uint8_t *)p; + p += sizeof(uint8_t); + *len += sizeof(uint8_t); + + switch (d->dtd) { + case SDP_DATA_NIL: + break; + case SDP_BOOL: + case SDP_INT8: + case SDP_UINT8: + *len += sizeof(uint8_t); + d->val.uint8 = *(uint8_t *)p; + break; + case SDP_INT16: + case SDP_UINT16: + *len += sizeof(uint16_t); + d->val.uint16 = ntohs(sdp_get_unaligned((uint16_t *)p)); + break; + case SDP_INT32: + case SDP_UINT32: + *len += sizeof(uint32_t); + d->val.uint32 = ntohl(sdp_get_unaligned((uint32_t *)p)); + break; + case SDP_INT64: + case SDP_UINT64: + *len += sizeof(uint64_t); + d->val.uint64 = ntoh64(sdp_get_unaligned((uint64_t *)p)); + break; + case SDP_INT128: + case SDP_UINT128: + *len += sizeof(uint128_t); + ntoh128((uint128_t *)p, &d->val.uint128); + break; + default: + free(d); + d = NULL; + } + return d; +} + +static sdp_data_t *extract_uuid(const void *p, int *len, sdp_record_t *rec) +{ + sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + + SDPDBG("Extracting UUID"); + memset(d, 0, sizeof(sdp_data_t)); + if (0 > sdp_uuid_extract(p, &d->val.uuid, len)) { + free(d); + return NULL; + } + d->dtd = *(uint8_t *)p; + sdp_pattern_add_uuid(rec, &d->val.uuid); + return d; +} + +/* + * Extract strings from the PDU (could be service description and similar info) + */ +static sdp_data_t *extract_str(const void *p, int *len) +{ + char *s; + int n; + sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + + memset(d, 0, sizeof(sdp_data_t)); + d->dtd = *(uint8_t *)p; + p += sizeof(uint8_t); + *len += sizeof(uint8_t); + + switch (d->dtd) { + case SDP_TEXT_STR8: + case SDP_URL_STR8: + n = *(uint8_t *)p; + p += sizeof(uint8_t); + *len += sizeof(uint8_t) + n; + break; + case SDP_TEXT_STR16: + case SDP_URL_STR16: + n = ntohs(sdp_get_unaligned((uint16_t *)p)); + p += sizeof(uint16_t); + *len += sizeof(uint16_t) + n; + break; + default: + SDPERR("Sizeof text string > UINT16_MAX\n"); + free(d); + return 0; + } + + s = (char *)malloc(n + 1); + memset(s, 0, n + 1); + strncpy(s, p, n); + + SDPDBG("Len : %d\n", n); + SDPDBG("Str : %s\n", s); + + d->val.str = s; + return d; +} + +static sdp_data_t *extract_seq(const void *p, int *len, sdp_record_t *rec) +{ + int seqlen, n = 0; + sdp_data_t *curr, *prev; + sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + + SDPDBG("Extracting SEQ"); + memset(d, 0, sizeof(sdp_data_t)); + *len = sdp_extract_seqtype(p, &d->dtd, &seqlen); + SDPDBG("Sequence Type : 0x%x length : 0x%x\n", d->dtd, seqlen); + + if (*len == 0) + return d; + + p += *len; + curr = prev = NULL; + while (n < seqlen) { + int attrlen = 0; + curr = sdp_extract_attr(p, &attrlen, rec); + if (curr == NULL) + break; + + if (prev) + prev->next = curr; + else + d->val.dataseq = curr; + prev = curr; + p += attrlen; + n += attrlen; + + SDPDBG("Extracted: %d SequenceLength: %d", n, seqlen); + } + + *len += n; + return d; +} + +sdp_data_t *sdp_extract_attr(const char *p, int *size, sdp_record_t *rec) +{ + sdp_data_t *elem; + int n = 0; + uint8_t dtd = *(const uint8_t *)p; + + SDPDBG("extract_attr: dtd=0x%x", dtd); + switch (dtd) { + case SDP_DATA_NIL: + case SDP_BOOL: + case SDP_UINT8: + case SDP_UINT16: + case SDP_UINT32: + case SDP_UINT64: + case SDP_UINT128: + case SDP_INT8: + case SDP_INT16: + case SDP_INT32: + case SDP_INT64: + case SDP_INT128: + elem = extract_int(p, &n); + break; + case SDP_UUID16: + case SDP_UUID32: + case SDP_UUID128: + elem = extract_uuid(p, &n, rec); + break; + case SDP_TEXT_STR8: + case SDP_TEXT_STR16: + case SDP_TEXT_STR32: + case SDP_URL_STR8: + case SDP_URL_STR16: + case SDP_URL_STR32: + elem = extract_str(p, &n); + break; + case SDP_SEQ8: + case SDP_SEQ16: + case SDP_SEQ32: + case SDP_ALT8: + case SDP_ALT16: + case SDP_ALT32: + elem = extract_seq(p, &n, rec); + break; + default: + SDPERR("Unknown data descriptor : 0x%x terminating\n", dtd); + return NULL; + } + *size += n; + return elem; +} + +#ifdef SDP_DEBUG +static void attr_print_func(void *value, void *userData) +{ + sdp_data_t *d = (sdp_data_t *)value; + + SDPDBG("=====================================\n"); + SDPDBG("ATTRIBUTE IDENTIFIER : 0x%x\n", d->attrId); + SDPDBG("ATTRIBUTE VALUE PTR : 0x%x\n", (uint32_t)value); + if (d) + sdp_data_print(d); + else + SDPDBG("NULL value\n"); + SDPDBG("=====================================\n"); +} + +void sdp_print_service_attr(sdp_list_t *svcAttrList) +{ + sdp_list_foreach(svcAttrList, attr_print_func, NULL); +} +#endif + +sdp_record_t *sdp_extract_pdu(const char *buf, int *scanned) +{ + int extracted = 0, seqlen = 0; + uint8_t dtd; + uint16_t attr; + sdp_record_t *rec = sdp_record_alloc(); + const char *p = buf; + + *scanned = sdp_extract_seqtype(buf, &dtd, &seqlen); + p += *scanned; + rec->attrlist = NULL; + while (extracted < seqlen) { + int n = sizeof(uint8_t), attrlen = 0; + sdp_data_t *data = NULL; + + SDPDBG("Extract PDU, sequenceLength: %d localExtractedLength: %d", seqlen, extracted); + dtd = *(uint8_t *)p; + attr = ntohs(sdp_get_unaligned((uint16_t *)(p+n))); + n += sizeof(uint16_t); + + SDPDBG("DTD of attrId : %d Attr id : 0x%x \n", dtd, attr); + + data = sdp_extract_attr(p+n, &attrlen, rec); + + SDPDBG("Attr id : 0x%x attrValueLength : %d\n", attr, attrlen); + + n += attrlen; + if (data == NULL) { + SDPDBG("Terminating extraction of attributes"); + break; + } + if (attr == SDP_ATTR_RECORD_HANDLE) + rec->handle = data->val.uint32; + extracted += n; + p += n; + sdp_attr_replace(rec, attr, data); + SDPDBG("Extract PDU, seqLength: %d localExtractedLength: %d", + seqlen, extracted); + } +#ifdef SDP_DEBUG + SDPDBG("Successful extracting of Svc Rec attributes\n"); + sdp_print_service_attr(rec->attrlist); +#endif + *scanned += seqlen; + return rec; +} + +#ifdef SDP_DEBUG +static void print_dataseq(sdp_data_t *p) +{ + sdp_data_t *d; + + for (d = p; d; d = d->next) + sdp_data_print(d); +} +#endif + +void sdp_record_print(const sdp_record_t *rec) +{ + sdp_data_t *d = sdp_data_get(rec, SDP_ATTR_SVCNAME_PRIMARY); + if (d) + printf("Service Name: %s\n", d->val.str); + d = sdp_data_get(rec, SDP_ATTR_SVCDESC_PRIMARY); + if (d) + printf("Service Description: %s\n", d->val.str); + d = sdp_data_get(rec, SDP_ATTR_PROVNAME_PRIMARY); + if (d) + printf("Service Provider: %s\n", d->val.str); +} + +#ifdef SDP_DEBUG +void sdp_data_print(sdp_data_t *d) +{ + switch (d->dtd) { + case SDP_DATA_NIL: + SDPDBG("NIL\n"); + break; + case SDP_BOOL: + case SDP_UINT8: + case SDP_UINT16: + case SDP_UINT32: + case SDP_UINT64: + case SDP_UINT128: + case SDP_INT8: + case SDP_INT16: + case SDP_INT32: + case SDP_INT64: + case SDP_INT128: + SDPDBG("Integer : 0x%x\n", d->val.uint32); + break; + case SDP_UUID16: + case SDP_UUID32: + case SDP_UUID128: + SDPDBG("UUID\n"); + sdp_uuid_print(&d->val.uuid); + break; + case SDP_TEXT_STR8: + case SDP_TEXT_STR16: + case SDP_TEXT_STR32: + SDPDBG("Text : %s\n", d->val.str); + break; + case SDP_URL_STR8: + case SDP_URL_STR16: + case SDP_URL_STR32: + SDPDBG("URL : %s\n", d->val.str); + break; + case SDP_SEQ8: + case SDP_SEQ16: + case SDP_SEQ32: + print_dataseq(d->val.dataseq); + break; + case SDP_ALT8: + case SDP_ALT16: + case SDP_ALT32: + SDPDBG("Data Sequence Alternates\n"); + print_dataseq(d->val.dataseq); + break; + } +} +#endif + +sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attrId) +{ + if (rec->attrlist) { + sdp_data_t sdpTemplate; + sdp_list_t *p; + + sdpTemplate.attrId = attrId; + p = sdp_list_find(rec->attrlist, &sdpTemplate, sdp_attrid_comp_func); + if (p) + return (sdp_data_t *)p->data; + } + return 0; +} + +/* + * Extract the sequence type and its length, and return offset into buf + * or 0 on failure. + */ +int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *size) +{ + uint8_t dtd = *(uint8_t *)buf; + int scanned = sizeof(uint8_t); + + buf += sizeof(uint8_t); + *dtdp = dtd; + switch (dtd) { + case SDP_SEQ8: + case SDP_ALT8: + *size = *(uint8_t *)buf; + scanned += sizeof(uint8_t); + break; + case SDP_SEQ16: + case SDP_ALT16: + *size = ntohs(sdp_get_unaligned((uint16_t *)buf)); + scanned += sizeof(uint16_t); + break; + case SDP_SEQ32: + case SDP_ALT32: + *size = ntohl(sdp_get_unaligned((uint32_t *)buf)); + scanned += sizeof(uint32_t); + break; + default: + SDPERR("Unknown sequence type, aborting\n"); + return 0; + } + return scanned; +} + +int sdp_send_req(sdp_session_t *session, char *buf, int size) +{ + int sent = 0; + + while (sent < size) { + int n = send(session->sock, buf + sent, size - sent, 0); + if (n < 0) + return -1; + sent += n; + } + return 0; +} + +int sdp_read_rsp(sdp_session_t *session, char *buf, int size) +{ + fd_set readFds; + struct timeval timeout = { SDP_RESPONSE_TIMEOUT, 0 }; + + FD_SET(session->sock, &readFds); + SDPDBG("Waiting for response\n"); + if (0 == select(session->sock + 1, &readFds, NULL, NULL, &timeout)) { + SDPERR("Client timed out\n"); + errno = ETIMEDOUT; + return -1; + } + return recv(session->sock, buf, size, 0); +} + +/* + * generic send request, wait for response method. + */ +int sdp_send_req_w4_rsp(sdp_session_t *session, char *reqbuf, char *rspbuf, int reqsize, int *rspsize) +{ + int n; + sdp_pdu_hdr_t *reqhdr = (sdp_pdu_hdr_t *)reqbuf; + sdp_pdu_hdr_t *rsphdr = (sdp_pdu_hdr_t *)rspbuf; + + SDPDBG(""); + if (0 > sdp_send_req(session, reqbuf, reqsize)) { + SDPERR("Error sending data:%s", strerror(errno)); + return -1; + } + n = sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE); + if (0 > n) + return -1; + SDPDBG("Read : %d\n", n); + if (n == 0 || reqhdr->tid != rsphdr->tid) { + errno = EPROTO; + return -1; + } + *rspsize = n; + return 0; +} + +/* + * singly-linked lists (after openobex implementation) + */ +sdp_list_t *sdp_list_append(sdp_list_t *p, void *d) +{ + sdp_list_t *q, *n = (sdp_list_t *)malloc(sizeof(sdp_list_t)); + + if (!n) + return 0; + + n->data = d; + n->next = 0; + + if (!p) + return n; + + for (q = p; q->next; q = q->next); + q->next = n; + + return p; +} + +sdp_list_t *sdp_list_remove(sdp_list_t *list, void *d) +{ + sdp_list_t *p, *q; + + for (q = 0, p = list; p; q = p, p = p->next) + if (p->data == d) { + if (q) + q->next = p->next; + else + list = p->next; + free(p); + break; + } + + return list; +} + +sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *d, sdp_comp_func_t f) +{ + sdp_list_t *q, *p, *n; + + n = (sdp_list_t *)malloc(sizeof(sdp_list_t)); + if (!n) + return 0; + n->data = d; + for (q = 0, p = list; p; q = p, p = p->next) + if (f(p->data, d) >= 0) + break; + // insert between q and p; if !q insert at head + if (q) + q->next = n; + else + list = n; + n->next = p; + return list; +} + +/* + * Every element of the list points to things which need + * to be free()'d. This method frees the list's contents + */ +void sdp_list_free(sdp_list_t *list, sdp_free_func_t f) +{ + sdp_list_t *next; + while (list) { + next = list->next; + if (f) + f(list->data); + free(list); + list = next; + } +} + +static inline int __find_port(sdp_data_t *seq, int proto) +{ + if (!seq || !seq->next) + return 0; + + if (SDP_IS_UUID(seq->dtd) && sdp_uuid_to_proto(&seq->val.uuid) == proto) { + seq = seq->next; + switch (seq->dtd) { + case SDP_UINT8: + return seq->val.uint8; + case SDP_UINT16: + return seq->val.uint16; + } + } + return 0; +} + +int sdp_get_proto_port(const sdp_list_t *list, int proto) +{ + if (proto != L2CAP_UUID && proto != RFCOMM_UUID) { + errno = EINVAL; + return -1; + } + + for (; list; list = list->next) { + sdp_list_t *p; + for (p = list->data; p; p = p->next) { + sdp_data_t *seq = (sdp_data_t *) p->data; + int port = __find_port(seq, proto); + if (port) + return port; + } + } + return 0; +} + +sdp_data_t *sdp_get_proto_desc(sdp_list_t *list, int proto) +{ + for (; list; list = list->next) { + sdp_list_t *p; + for (p = list->data; p; p = p->next) { + sdp_data_t *seq = (sdp_data_t *) p->data; + if (SDP_IS_UUID(seq->dtd) && + sdp_uuid_to_proto(&seq->val.uuid) == proto) + return seq->next; + } + } + return NULL; +} + +int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **pap) +{ + sdp_data_t *pdlist, *curr; + sdp_list_t *ap = 0; + + pdlist = sdp_data_get(rec, SDP_ATTR_PROTO_DESC_LIST); + if (pdlist == NULL) { + errno = ENODATA; + return -1; + } + SDPDBG("AP type : 0%x\n", pdlist->dtd); + + for (; pdlist; pdlist = pdlist->next) { + sdp_list_t *pds = 0; + for (curr = pdlist->val.dataseq; curr; curr = curr->next) + pds = sdp_list_append(pds, curr->val.dataseq); + ap = sdp_list_append(ap, pds); + } + *pap = ap; + return 0; +} + +int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **seqp) +{ + sdp_data_t *sdpdata = sdp_data_get(rec, attr); + + *seqp = NULL; + if (sdpdata && sdpdata->dtd >= SDP_SEQ8 && sdpdata->dtd <= SDP_SEQ32) { + sdp_data_t *d; + for (d = sdpdata->val.dataseq; d; d = d->next) { + uuid_t *u = (uuid_t *)malloc(sizeof(uuid_t)); + memset((char *)u, 0, sizeof(uuid_t)); + if (d->dtd >= SDP_UUID16 && d->dtd <= SDP_UUID128) { + *u = d->val.uuid; + *seqp = sdp_list_append(*seqp, u); + } else + goto fail; + } + return 0; + } +fail: + sdp_list_free(*seqp, free); + errno = EINVAL; + return -1; +} + +int sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t aid, sdp_list_t *seq) +{ + int status = 0, i, len; + void **dtds, **values; + uint8_t uuid16 = SDP_UUID16; + uint8_t uuid32 = SDP_UUID32; + uint8_t uuid128 = SDP_UUID128; + sdp_list_t *p; + + len = sdp_list_len(seq); + if (!seq || len == 0) + return -1; + dtds = (void **)malloc(len * sizeof(void *)); + values = (void **)malloc(len * sizeof(void *)); + for (p = seq, i = 0; i < len; i++, p = p->next) { + uuid_t *uuid = (uuid_t *)p->data; + if (uuid) + switch (uuid->type) { + case SDP_UUID16: + dtds[i] = &uuid16; + values[i] = &uuid->value.uuid16; + break; + case SDP_UUID32: + dtds[i] = &uuid32; + values[i] = &uuid->value.uuid32; + break; + case SDP_UUID128: + dtds[i] = &uuid128; + values[i] = &uuid->value.uuid128; + break; + default: + status = -1; + break; + } + else { + status = -1; + break; + } + } + if (status == 0) { + sdp_data_t *data = sdp_seq_alloc(dtds, values, len); + sdp_attr_replace(rec, aid, data); + sdp_pattern_add_uuidseq(rec, seq); + } + free(dtds); + free(values); + return status; +} + +int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq) +{ + sdp_lang_attr_t *lang; + sdp_data_t *sdpdata, *curr_data; + + *langSeq = NULL; + sdpdata = sdp_data_get(rec, SDP_ATTR_LANG_BASE_ATTR_ID_LIST); + if (sdpdata == NULL) { + errno = ENODATA; + return -1; + } + curr_data = sdpdata->val.dataseq; + while (curr_data) { + sdp_data_t *pCode = curr_data; + sdp_data_t *pEncoding = pCode->next; + sdp_data_t *pOffset = pEncoding->next; + if (pCode && pEncoding && pOffset) { + lang = (sdp_lang_attr_t *)malloc(sizeof(sdp_lang_attr_t)); + lang->code_ISO639 = pCode->val.uint16; + lang->encoding = pEncoding->val.uint16; + lang->base_offset = pOffset->val.uint16; + SDPDBG("code_ISO639 : 0x%02x\n", lang->code_ISO639); + SDPDBG("encoding : 0x%02x\n", lang->encoding); + SDPDBG("base_offfset : 0x%02x\n", lang->base_offset); + *langSeq = sdp_list_append(*langSeq, lang); + } + curr_data = pOffset->next; + } + return 0; +} + +int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq) +{ + sdp_profile_desc_t *profDesc; + sdp_data_t *sdpdata, *seq; + + *profDescSeq = NULL; + sdpdata = sdp_data_get(rec, SDP_ATTR_PFILE_DESC_LIST); + if (!sdpdata || !sdpdata->val.dataseq) { + errno = ENODATA; + return -1; + } + for (seq = sdpdata->val.dataseq; seq && seq->val.dataseq; seq = seq->next) { + sdp_data_t *uuid = seq->val.dataseq; + sdp_data_t *pVnum = seq->val.dataseq->next; + if (uuid && pVnum) { + profDesc = (sdp_profile_desc_t *)malloc(sizeof(sdp_profile_desc_t)); + profDesc->uuid = uuid->val.uuid; + profDesc->version = pVnum->val.uint16; +#ifdef SDP_DEBUG + sdp_uuid_print(&profDesc->uuid); + SDPDBG("Vnum : 0x%04x\n", profDesc->version); +#endif + *profDescSeq = sdp_list_append(*profDescSeq, profDesc); + } + } + return 0; +} + +int sdp_get_server_ver(const sdp_record_t *rec, sdp_list_t **u16) +{ + sdp_data_t *d, *curr; + + *u16 = NULL; + d = sdp_data_get(rec, SDP_ATTR_VERSION_NUM_LIST); + if (d == NULL) { + errno = ENODATA; + return -1; + } + for (curr = d->val.dataseq; curr; curr = curr->next) + *u16 = sdp_list_append(*u16, &curr->val.uint16); + return 0; +} + +/* flexible extraction of basic attributes - Jean II */ +/* How do we expect caller to extract predefined data sequences? */ +int sdp_get_int_attr(const sdp_record_t *rec, uint16_t attrid, int *value) +{ + sdp_data_t *sdpdata = sdp_data_get(rec, attrid); + + if (sdpdata) + /* Verify that it is what the caller expects */ + if (sdpdata->dtd == SDP_BOOL || sdpdata->dtd == SDP_UINT8 || + sdpdata->dtd == SDP_UINT16 || sdpdata->dtd == SDP_UINT32 || + sdpdata->dtd == SDP_INT8 || sdpdata->dtd == SDP_INT16 || + sdpdata->dtd == SDP_INT32) { + *value = sdpdata->val.uint32; + return 0; + } + errno = EINVAL; + return -1; +} + +int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attrid, char *value, int valuelen) +{ + sdp_data_t *sdpdata = sdp_data_get(rec, attrid); + if (sdpdata) + /* Verify that it is what the caller expects */ + if (sdpdata->dtd == SDP_TEXT_STR8 || sdpdata->dtd == SDP_TEXT_STR16 || sdpdata->dtd == SDP_TEXT_STR32) + if (strlen(sdpdata->val.str) < valuelen) { + strcpy(value, sdpdata->val.str); + return 0; + } + errno = EINVAL; + return -1; +} + +#define get_basic_attr(attrID, pAttrValue, fieldName) \ + sdp_data_t *data = sdp_data_get(rec, attrID); \ + if (data) { \ + *pAttrValue = data->val.fieldName; \ + return 0; \ + } \ + errno = EINVAL; \ + return -1; + +int sdp_get_service_id(const sdp_record_t *rec, uuid_t *uuid) +{ + get_basic_attr(SDP_ATTR_SERVICE_ID, uuid, uuid); +} + +int sdp_get_group_id(const sdp_record_t *rec, uuid_t *uuid) +{ + get_basic_attr(SDP_ATTR_GROUP_ID, uuid, uuid); +} + +int sdp_get_record_state(const sdp_record_t *rec, uint32_t *svcRecState) +{ + get_basic_attr(SDP_ATTR_RECORD_STATE, svcRecState, uint32); +} + +int sdp_get_service_avail(const sdp_record_t *rec, uint8_t *svcAvail) +{ + get_basic_attr(SDP_ATTR_SERVICE_AVAILABILITY, svcAvail, uint8); +} + +int sdp_get_service_ttl(const sdp_record_t *rec, uint32_t *svcTTLInfo) +{ + get_basic_attr(SDP_ATTR_SVCINFO_TTL, svcTTLInfo, uint32); +} + +int sdp_get_database_state(const sdp_record_t *rec, uint32_t *svcDBState) +{ + get_basic_attr(SDP_ATTR_SVCDB_STATE, svcDBState, uint32); +} + +/* + * NOTE that none of the setXXX() functions below will + * actually update the SDP server, unless the + * {register, update}sdp_record_t() function is invoked. + */ + +int sdp_attr_add_new(sdp_record_t *rec, uint16_t attr, uint8_t dtd, const void *value) +{ + sdp_data_t *d = sdp_data_alloc(dtd, value); + if (d) { + sdp_attr_replace(rec, attr, d); + return 0; + } + return -1; +} + +/* + * Set the information attributes of the service + * pointed to by rec. The attributes are + * service name, description and provider name + */ +void sdp_set_info_attr(sdp_record_t *rec, const char *name, const char *prov, const char *desc) +{ + if (name) + sdp_attr_add_new(rec, SDP_ATTR_SVCNAME_PRIMARY, SDP_TEXT_STR8, (void *)name); + if (prov) + sdp_attr_add_new(rec, SDP_ATTR_PROVNAME_PRIMARY, SDP_TEXT_STR8, (void *)prov); + if (desc) + sdp_attr_add_new(rec, SDP_ATTR_SVCDESC_PRIMARY, SDP_TEXT_STR8, (void *)desc); +} + +static sdp_data_t *access_proto_to_dataseq(sdp_record_t *rec, sdp_list_t *proto) +{ + sdp_data_t *seq = NULL; + void *dtds[10], *values[10]; + void **seqDTDs, **seqs; + int i, seqlen; + sdp_list_t *p; + + seqlen = sdp_list_len(proto); + seqDTDs = (void **)malloc(seqlen * sizeof(void *)); + seqs = (void **)malloc(seqlen * sizeof(void *)); + for (i = 0, p = proto; p; p = p->next, i++) { + sdp_list_t *elt = (sdp_list_t *)p->data; + sdp_data_t *s; + int pslen = 0; + for (; elt && pslen < sizeof(dtds); elt = elt->next, pslen++) { + sdp_data_t *d = (sdp_data_t *)elt->data; + dtds[pslen] = &d->dtd; + switch (d->dtd) { + case SDP_UUID16: + values[pslen] = &((uuid_t *)d)->value.uuid16; + break; + case SDP_UUID32: + values[pslen] = &((uuid_t *)d)->value.uuid32; + break; + case SDP_UUID128: + values[pslen] = &((uuid_t *)d)->value.uuid128; + break; + case SDP_UINT8: + values[pslen] = &d->val.uint8; + break; + case SDP_UINT16: + values[pslen] = &d->val.uint16; + break; + case SDP_SEQ8: + case SDP_SEQ16: + case SDP_SEQ32: + values[pslen] = d; + break; + // FIXME: more + } + } + s = sdp_seq_alloc(dtds, values, pslen); + if (s) { + seqDTDs[i] = &s->dtd; + seqs[i] = s; + } + } + seq = sdp_seq_alloc(seqDTDs, seqs, seqlen); + free(seqDTDs); + free(seqs); + return seq; +} + +/* + * sets the access protocols of the service specified + * to the value specified in "access_proto" + * + * Note that if there are alternate mechanisms by + * which the service is accessed, then they should + * be specified as sequences + * + * Using a value of NULL for accessProtocols has + * effect of removing this attribute (if previously set) + * + * This function replaces the existing sdp_access_proto_t + * structure (if any) with the new one specified. + * + * returns 0 if successful or -1 if there is a failure. + */ +int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *ap) +{ + const sdp_list_t *p; + sdp_data_t *protos = 0; + + for (p = ap; p; p = p->next) { + sdp_data_t *seq = access_proto_to_dataseq(rec, (sdp_list_t *)p->data); + protos = sdp_seq_append(protos, seq); + } + sdp_attr_add(rec, SDP_ATTR_PROTO_DESC_LIST, protos); + return 0; +} + +/* + * set the "LanguageBase" attributes of the service record + * record to the value specified in "langAttrList". + * + * "langAttrList" is a linked list of "sdp_lang_attr_t" + * objects, one for each language in which user visible + * attributes are present in the service record. + * + * Using a value of NULL for langAttrList has + * effect of removing this attribute (if previously set) + * + * This function replaces the exisiting sdp_lang_attr_t + * structure (if any) with the new one specified. + * + * returns 0 if successful or -1 if there is a failure. + */ +int sdp_set_lang_attr(sdp_record_t *rec, const sdp_list_t *seq) +{ + uint8_t uint16 = SDP_UINT16; + int status = 0, i = 0, seqlen = sdp_list_len(seq); + void **dtds = (void **)malloc(3 * seqlen * sizeof(void *)); + void **values = (void **)malloc(3 * seqlen * sizeof(void *)); + const sdp_list_t *p; + + for (p = seq; p; p = p->next) { + sdp_lang_attr_t *lang = (sdp_lang_attr_t *)p->data; + if (!lang) { + status = -1; + break; + } + dtds[i] = &uint16; + values[i] = &lang->code_ISO639; + i++; + dtds[i] = &uint16; + values[i] = &lang->encoding; + i++; + dtds[i] = &uint16; + values[i] = &lang->base_offset; + i++; + } + if (status == 0) { + sdp_data_t *seq = sdp_seq_alloc(dtds, values, 3 * seqlen); + sdp_attr_add(rec, SDP_ATTR_LANG_BASE_ATTR_ID_LIST, seq); + } + free(dtds); + free(values); + return status; +} + +/* + * set the "ServiceID" attribute of the service. + * + * This is the UUID of the service. + * + * returns 0 if successful or -1 if there is a failure. + */ +void sdp_set_service_id(sdp_record_t *rec, uuid_t uuid) +{ + switch (uuid.type) { + case SDP_UUID16: + sdp_attr_add_new(rec, SDP_ATTR_SERVICE_ID, SDP_UUID16, &uuid.value.uuid16); + break; + case SDP_UUID32: + sdp_attr_add_new(rec, SDP_ATTR_SERVICE_ID, SDP_UUID32, &uuid.value.uuid32); + break; + case SDP_UUID128: + sdp_attr_add_new(rec, SDP_ATTR_SERVICE_ID, SDP_UUID128, &uuid.value.uuid128); + break; + } + sdp_pattern_add_uuid(rec, &uuid); +} + +/* + * set the GroupID attribute of the service record defining a group. + * + * This is the UUID of the group. + * + * returns 0 if successful or -1 if there is a failure. + */ +void sdp_set_group_id(sdp_record_t *rec, uuid_t uuid) +{ + switch (uuid.type) { + case SDP_UUID16: + sdp_attr_add_new(rec, SDP_ATTR_GROUP_ID, SDP_UUID16, &uuid.value.uuid16); + break; + case SDP_UUID32: + sdp_attr_add_new(rec, SDP_ATTR_GROUP_ID, SDP_UUID32, &uuid.value.uuid32); + break; + case SDP_UUID128: + sdp_attr_add_new(rec, SDP_ATTR_GROUP_ID, SDP_UUID128, &uuid.value.uuid128); + break; + } + sdp_pattern_add_uuid(rec, &uuid); +} + +/* + * set the ProfileDescriptorList attribute of the service record + * pointed to by record to the value specified in "profileDesc". + * + * Each element in the list is an object of type + * sdp_profile_desc_t which is a definition of the + * Bluetooth profile that this service conforms to. + * + * Using a value of NULL for profileDesc has + * effect of removing this attribute (if previously set) + * + * This function replaces the exisiting ProfileDescriptorList + * structure (if any) with the new one specified. + * + * returns 0 if successful or -1 if there is a failure. + */ +int sdp_set_profile_descs(sdp_record_t *rec, const sdp_list_t *profiles) +{ + int status = 0; + uint8_t uuid16 = SDP_UUID16; + uint8_t uuid32 = SDP_UUID32; + uint8_t uuid128 = SDP_UUID128; + uint8_t uint16 = SDP_UINT16; + int i = 0, seqlen = sdp_list_len(profiles); + void **seqDTDs = (void **)malloc(seqlen * sizeof(void *)); + void **seqs = (void **)malloc(seqlen * sizeof(void *)); + const sdp_list_t *p; + + for (p = profiles; p; p = p->next) { + sdp_data_t *seq; + void *dtds[2], *values[2]; + sdp_profile_desc_t *profile = (sdp_profile_desc_t *)p->data; + if (!profile) { + status = -1; + break; + } + switch (profile->uuid.type) { + case SDP_UUID16: + dtds[0] = &uuid16; + values[0] = &profile->uuid.value.uuid16; + break; + case SDP_UUID32: + dtds[0] = &uuid32; + values[0] = &profile->uuid.value.uuid32; + break; + case SDP_UUID128: + dtds[0] = &uuid128; + values[0] = &profile->uuid.value.uuid128; + break; + default: + status = -1; + break; + } + dtds[1] = &uint16; + values[1] = &profile->version; + seq = sdp_seq_alloc(dtds, values, 2); + if (seq) { + seqDTDs[i] = &seq->dtd; + seqs[i] = seq; + sdp_pattern_add_uuid(rec, &profile->uuid); + } + i++; + } + if (status == 0) { + sdp_data_t *pAPSeq = sdp_seq_alloc(seqDTDs, seqs, seqlen); + sdp_attr_add(rec, SDP_ATTR_PFILE_DESC_LIST, pAPSeq); + } + free(seqDTDs); + free(seqs); + return status; +} + +/* + * sets various URL attributes of the service + * pointed to by record. The URL include + * + * client: a URL to the client's + * platform specific (WinCE, PalmOS) executable + * code that can be used to access this service. + * + * doc: a URL pointing to service documentation + * + * icon: a URL to an icon that can be used to represent + * this service. + * + * Note that you need to pass NULL for any URLs + * that you don't want to set or remove + */ +void sdp_set_url_attr(sdp_record_t *rec, const char *client, const char *doc, const char *icon) +{ + sdp_attr_add_new(rec, SDP_ATTR_CLNT_EXEC_URL, SDP_URL_STR8, client); + sdp_attr_add_new(rec, SDP_ATTR_DOC_URL, SDP_URL_STR8, doc); + sdp_attr_add_new(rec, SDP_ATTR_ICON_URL, SDP_URL_STR8, icon); +} + +/* + * The code in this function is executed only once per + * thread. We compute the actual bit value of the Bluetooth + * base UUID which is a string defined in bt_std_values.h + * and is assumed to be of the standard form with "-" separators. + * + * The algorithm however converts the string to 4 unsigned longs + * using the strtoul() and assigns the values in sequence to + * the 128bit value + */ +uint128_t *sdp_create_base_uuid(void) +{ + char baseStr[128]; + int delim = '-'; + unsigned long dataLongValue; + char *delimPtr; + char *dataPtr; + char temp[10]; + int toBeCopied; + char *data; + + if (bluetooth_base_uuid == NULL) { + strcpy(baseStr, BASE_UUID); + bluetooth_base_uuid = (uint128_t *)malloc(sizeof(uint128_t)); + data = bluetooth_base_uuid->data; + memset(data, '\0', sizeof(uint128_t)); + memset(temp, '\0', 10); + dataPtr = baseStr; + delimPtr = NULL; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 8) { + SDPDBG("To be copied(1) : %d\n", toBeCopied); + return NULL; + } + strncpy(temp, dataPtr, toBeCopied); + dataLongValue = htonl(strtoul(temp, NULL, 16)); + memcpy(&data[0], &dataLongValue, 4); + + /* + * Get the next 4 bytes (note that there is a "-" + * between them now) + */ + memset(temp, '\0', 10); + dataPtr = delimPtr + 1; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 4) { + SDPDBG("To be copied(2) : %d\n", toBeCopied); + return NULL; + } + strncpy(temp, dataPtr, toBeCopied); + dataPtr = delimPtr + 1; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 4) { + SDPDBG("To be copied(3) : %d\n", toBeCopied); + return NULL; + } + strncat(temp, dataPtr, toBeCopied); + dataLongValue = htonl(strtoul(temp, NULL, 16)); + memcpy(&data[4], &dataLongValue, 4); + + /* + * Get the last 4 bytes (note that there are 6 bytes + * after the last separator, which is truncated (2+4) + */ + memset(temp, '\0', 10); + dataPtr = delimPtr + 1; + dataPtr = delimPtr + 1; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 4) { + SDPDBG("To be copied(4) : %d\n", toBeCopied); + return NULL; + } + strncpy(temp, dataPtr, toBeCopied); + strncat(temp, (delimPtr + 1), 4); + dataLongValue = htonl(strtoul(temp, NULL, 16)); + memcpy(&data[8], &dataLongValue, 4); + dataLongValue = htonl(strtoul(delimPtr + 5, NULL, 16)); + memcpy(&data[12], &dataLongValue, 4); + } + return bluetooth_base_uuid; +} + +uuid_t *sdp_uuid16_create(uuid_t *u, uint16_t val) +{ + memset(u, 0, sizeof(uuid_t)); + u->type = SDP_UUID16; + u->value.uuid16 = val; + return u; +} + +uuid_t *sdp_uuid32_create(uuid_t *u, uint32_t val) +{ + memset(u, 0, sizeof(uuid_t)); + u->type = SDP_UUID32; + u->value.uuid32 = val; + return u; +} + +uuid_t *sdp_uuid128_create(uuid_t *u, const void *val) +{ + memset(u, 0, sizeof(uuid_t)); + u->type = SDP_UUID128; + memcpy(&u->value.uuid128, val, sizeof(uint128_t)); + return u; +} + +/* + * UUID comparison function + * returns 0 if uuidValue1 == uuidValue2 else -1 + */ +int sdp_uuid16_cmp(const void *p1, const void *p2) +{ + const uuid_t *u1 = (const uuid_t *)p1; + const uuid_t *u2 = (const uuid_t *)p2; + return memcmp(&u1->value.uuid16, &u2->value.uuid16, sizeof(uint16_t)); +} + +/* + * UUID comparison function + * returns 0 if uuidValue1 == uuidValue2 else -1 + */ +int sdp_uuid128_cmp(const void *p1, const void *p2) +{ + const uuid_t *u1 = (const uuid_t *)p1; + const uuid_t *u2 = (const uuid_t *)p2; + return memcmp(&u1->value.uuid128, &u2->value.uuid128, sizeof(uint128_t)); +} + +/* + * 128 to 16 bit and 32 to 16 bit UUID conversion functions + * yet to be implemented. Note that the input is in NBO in + * both 32 and 128 bit UUIDs and conversion is needed + */ +void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16) +{ + /* + * We have a 16 bit value, which needs to be added to + * bytes 3 and 4 (at indices 2 and 3) of the Bluetooth base + */ + unsigned short data1; + + // allocate a 128bit UUID and init to the Bluetooth base UUID + uint128_t *pBTBase128Bit = sdp_create_base_uuid(); + uuid128->value.uuid128 = *pBTBase128Bit; + uuid128->type = SDP_UUID128; + + // extract bytes 2 and 3 of 128bit BT base UUID + memcpy(&data1, &pBTBase128Bit->data[2], 2); + + // add the given UUID (16 bits) + data1 += htons(uuid16->value.uuid16); + + // set bytes 2 and 3 of the 128 bit value + memcpy(&uuid128->value.uuid128.data[2], &data1, 2); +} + +void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32) +{ + /* + * We have a 32 bit value, which needs to be added to + * bytes 1->4 (at indices 0 thru 3) of the Bluetooth base + */ + unsigned int data0; + + // allocate a 128bit UUID and init to the Bluetooth base UUID + uint128_t *pBTBase128Bit = sdp_create_base_uuid(); + uuid128->value.uuid128 = *pBTBase128Bit; + uuid128->type = SDP_UUID128; + + // extract first 4 bytes + memcpy(&data0, &pBTBase128Bit->data[0], 4); + + // add the given UUID (32bits) + data0 += htonl(uuid32->value.uuid32); + + // set the 4 bytes of the 128 bit value + memcpy(&uuid128->value.uuid128.data[0], &data0, 4); +} + +uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid) +{ + uuid_t *uuid128 = (uuid_t *)malloc(sizeof(uuid_t)); + memset(uuid128, 0, sizeof(uuid_t)); + switch (uuid->type) { + case SDP_UUID128: + *uuid128 = *uuid; + break; + case SDP_UUID32: + sdp_uuid32_to_uuid128(uuid128, uuid); + break; + case SDP_UUID16: + sdp_uuid16_to_uuid128(uuid128, uuid); + break; + } + return uuid128; +} + +/* + * converts a 128-bit uuid to a 16/32-bit one if possible + * returns true if uuid contains a 16/32-bit UUID at exit + */ +int sdp_uuid128_to_uuid(uuid_t *uuid) +{ + extern uint128_t *sdp_create_base_uuid(); + int i; + uint128_t *b = sdp_create_base_uuid(); + uint128_t *u = &uuid->value.uuid128; + uint32_t data; + + if (uuid->type != SDP_UUID128) + return 1; + + for (i = 4; i < sizeof(b->data); i++) + if (b->data[i] != u->data[i]) + return 0; + + memcpy(&data, u->data, 4); + data = htonl(data); + if (data <= 0xffff) { + uuid->type = SDP_UUID16; + uuid->value.uuid16 = (uint16_t)data; + } else { + uuid->type = SDP_UUID32; + uuid->value.uuid32 = data; + } + return 1; +} + +/* + * convert a UUID to the 16-bit short-form + */ +int sdp_uuid_to_proto(uuid_t *uuid) +{ + uuid_t u = *uuid; + if (sdp_uuid128_to_uuid(&u) && u.type == SDP_UUID16) + return u.value.uuid16; + return 0; +} + +int sdp_uuid_extract(const char *p, uuid_t *uuid, int *scanned) +{ + uint8_t type = *(const uint8_t *)p; + + if (!SDP_IS_UUID(type)) { + SDPERR("Unknown data type : %d expecting a svc UUID\n", type); + return -1; + } + p += sizeof(uint8_t); + *scanned += sizeof(uint8_t); + if (type == SDP_UUID16) { + sdp_uuid16_create(uuid, ntohs(sdp_get_unaligned((uint16_t *)p))); + *scanned += sizeof(uint16_t); + p += sizeof(uint16_t); + } else if (type == SDP_UUID32) { + sdp_uuid32_create(uuid, ntohl(sdp_get_unaligned((uint32_t *)p))); + *scanned += sizeof(uint32_t); + p += sizeof(uint32_t); + } else { + sdp_uuid128_create(uuid, p); + *scanned += sizeof(uint128_t); + p += sizeof(uint128_t); + } + return 0; +} + +/* + * This function appends data to the PDU buffer "dst" from source "src". + * The data length is also computed and set. + * Should the PDU length exceed 2^8, then sequence type is + * set accordingly and the data is memmove()'d. + */ +void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len) +{ + char *p = dst->data; + uint8_t dtd = *(uint8_t *)p; + + SDPDBG("Append src size: %d\n", len); + SDPDBG("Append dst size: %d\n", dst->data_size); + SDPDBG("Dst buffer size: %d\n", dst->buf_size); + if (dst->data_size + len > dst->buf_size) { + int need = SDP_PDU_CHUNK_SIZE * ((len / SDP_PDU_CHUNK_SIZE) + 1); + dst->data = (char *)realloc(dst->data, dst->buf_size + need); + + SDPDBG("Realloc'ing : %d\n", need); + + if (dst->data == NULL) { + SDPERR("Realloc fails \n"); + } + dst->buf_size += need; + } + if (dst->data_size == 0 && dtd == 0) { + // create initial sequence + *(uint8_t *)p = SDP_SEQ8; + p += sizeof(uint8_t); + dst->data_size += sizeof(uint8_t); + // reserve space for sequence size + p += sizeof(uint8_t); + dst->data_size += sizeof(uint8_t); + } + + memcpy(dst->data + dst->data_size, data, len); + dst->data_size += len; + + dtd = *(uint8_t *)dst->data; + if (dst->data_size > UCHAR_MAX && dtd == SDP_SEQ8) { + short offset = sizeof(uint8_t) + sizeof(uint8_t); + memmove(dst->data + offset + 1, dst->data + offset, dst->data_size - offset); + p = dst->data; + *(uint8_t *)p = SDP_SEQ16; + p += sizeof(uint8_t); + dst->data_size += 1; + } + p = dst->data; + dtd = *(uint8_t *)p; + p += sizeof(uint8_t); + switch (dtd) { + case SDP_SEQ8: + *(uint8_t *)p = dst->data_size - sizeof(uint8_t) - sizeof(uint8_t); + break; + case SDP_SEQ16: + sdp_put_unaligned(htons(dst->data_size - sizeof(uint8_t) - sizeof(uint16_t)), (uint16_t *)p); + break; + case SDP_SEQ32: + sdp_put_unaligned(htonl(dst->data_size - sizeof(uint8_t) - sizeof(uint32_t)), (uint32_t *)p); + break; + } +} + +void sdp_append_to_pdu(sdp_buf_t *pdu, sdp_data_t *d) +{ + char buf[SDP_SEQ_PDUFORM_SIZE]; + sdp_buf_t append; + + append.data = buf; + append.buf_size = sizeof(buf); + append.data_size = 0; + sdp_set_attrid(&append, d->attrId); + sdp_gen_pdu(&append, d); + sdp_append_to_buf(pdu, append.data, append.data_size); +} + +/* + * Registers an sdp record. + * + * It is incorrect to call this method on a record that + * has been already registered with the server. + * + * Returns a non-null value (a pointer) to a service + * record if successful, else -1 setting errno + */ +int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags) +{ + char *p; + int status = 0; + char *req, *rsp; + int reqsize, rspsize; + sdp_pdu_hdr_t *reqhdr, *rsphdr; + sdp_buf_t pdu; + + SDPDBG(""); + + if (!session->local) { + errno = EREMOTE; + return -1; + } + req = (char *)malloc(SDP_REQ_BUFFER_SIZE); + rsp = (char *)malloc(SDP_RSP_BUFFER_SIZE); + if (req == NULL || rsp == NULL) { + status = -1; + errno = ENOMEM; + goto end; + } + reqhdr = (sdp_pdu_hdr_t *)req; + reqhdr->pdu_id = SDP_SVC_REGISTER_REQ; + reqhdr->tid = htons(sdp_gen_tid(session)); + reqsize = sizeof(sdp_pdu_hdr_t) + 1; + p = req + sizeof(sdp_pdu_hdr_t); + *p++ = flags; + if (0 > sdp_gen_record_pdu(rec, &pdu)) { + status = -1; + errno = ENOMEM; + goto end; + } + memcpy(p, pdu.data, pdu.data_size); + free(pdu.data); + reqsize += pdu.data_size; + reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); + + status = sdp_send_req_w4_rsp(session, req, rsp, reqsize, &rspsize); + if (status < 0) + goto end; + rsphdr = (sdp_pdu_hdr_t *)rsp; + p = rsp + sizeof(sdp_pdu_hdr_t); + if (rsphdr->pdu_id == SDP_SVC_REGISTER_RSP) { + uint32_t handle = ntohl(sdp_get_unaligned((uint32_t *)p)); + sdp_data_t *data = sdp_data_alloc(SDP_UINT32, &handle); + rec->handle = handle; + sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, data); + } +end: + if (req) + free(req); + if (rsp) + free(rsp); + return status; +} + +/* + * unregister a service record + */ +int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) +{ + char *p; + int status = 0; + char *reqbuf, *rspbuf; + int reqsize = 0, rspsize = 0; + sdp_pdu_hdr_t *reqhdr, *rsphdr; + uint32_t handle = 0; + + SDPDBG(""); + + handle = rec->handle; + if (handle == SDP_SERVER_RECORD_HANDLE) { + errno = EINVAL; + return -1; + } + if (!session->local) { + errno = EREMOTE; + return -1; + } + reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + if (!reqbuf || !rspbuf) { + errno = ENOMEM; + status = -1; + goto end; + } + reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr->pdu_id = SDP_SVC_REMOVE_REQ; + reqhdr->tid = htons(sdp_gen_tid(session)); + + p = reqbuf + sizeof(sdp_pdu_hdr_t); + reqsize = sizeof(sdp_pdu_hdr_t); + sdp_put_unaligned(htonl(handle), (uint32_t *)p); + reqsize += sizeof(uint32_t); + + reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); + status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); + if (status == 0) { + rsphdr = (sdp_pdu_hdr_t *)rspbuf; + p = rspbuf + sizeof(sdp_pdu_hdr_t); + status = sdp_get_unaligned((uint16_t *)p); + if (status == 0 && rsphdr->pdu_id == SDP_SVC_REMOVE_RSP) { + SDPDBG("Removing local copy\n"); + sdp_record_free(rec); + } + } +end: + if (reqbuf) + free(reqbuf); + if (rspbuf) + free(rspbuf); + return status; +} + +/* + * modify an existing service record + */ +int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) +{ + char *p; + int status = 0; + char *reqbuf, *rspbuf; + int reqsize, rspsize; + sdp_pdu_hdr_t *reqhdr, *rsphdr; + uint32_t handle; + sdp_buf_t pdu; + + SDPDBG(""); + handle = rec->handle; + + if (handle == SDP_SERVER_RECORD_HANDLE) { + errno = EINVAL; + return -1; + } + if (!session->local) { + errno = EREMOTE; + return -1; + } + reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + if (!reqbuf || !rspbuf) { + errno = ENOMEM; + status = -1; + goto end; + } + reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr->pdu_id = SDP_SVC_UPDATE_REQ; + reqhdr->tid = htons(sdp_gen_tid(session)); + + p = (char *)(reqbuf + sizeof(sdp_pdu_hdr_t)); + reqsize = sizeof(sdp_pdu_hdr_t); + + sdp_put_unaligned(htonl(handle), (uint32_t *)p); + reqsize += sizeof(uint32_t); + p += sizeof(uint32_t); + + if (0 > sdp_gen_record_pdu(rec, &pdu)) { + errno = ENOMEM; + status = -1; + goto end; + } + memcpy(p, pdu.data, pdu.data_size); + reqsize += pdu.data_size; + + reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); + status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); + + SDPDBG("Send req status : %d\n", status); + + if (status == 0) { + rsphdr = (sdp_pdu_hdr_t *)rspbuf; + p = rspbuf + sizeof(sdp_pdu_hdr_t); + status = sdp_get_unaligned((uint16_t *)p); + } +end: + if (reqbuf) + free(reqbuf); + if (rspbuf) + free(rspbuf); + return status; +} + +sdp_record_t *sdp_record_alloc() +{ + sdp_record_t *rec = (sdp_record_t *)malloc(sizeof(sdp_record_t)); + memset((void *)rec, 0, sizeof(sdp_record_t)); + rec->handle = 0xffffffff; + return rec; +} + +/* + * Free the contents of a service record + */ +void sdp_record_free(sdp_record_t *rec) +{ + sdp_list_free(rec->attrlist, (sdp_free_func_t)sdp_data_free); + sdp_list_free(rec->pattern, free); + free(rec); +} + +void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid) +{ + uuid_t *uuid128 = sdp_uuid_to_uuid128(uuid); + + SDPDBG("SvcRec : 0x%lx\n", (unsigned long)rec); + SDPDBG("Elements in target pattern : %d\n", sdp_list_len(rec->pattern)); + SDPDBG("Trying to add : 0x%lx\n", (unsigned long)uuid128); + + if (sdp_list_find(rec->pattern, uuid128, sdp_uuid128_cmp) == NULL) + rec->pattern = sdp_list_insert_sorted(rec->pattern, uuid128, sdp_uuid128_cmp); + else + free(uuid128); + + SDPDBG("Elements in target pattern : %d\n", sdp_list_len(rec->pattern)); +} + +void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq) +{ + for (; seq; seq = seq->next) { + uuid_t *uuid = (uuid_t *)seq->data; + sdp_pattern_add_uuid(rec, uuid); + } +} + +/* + * Extract a sequence of service record handles from a PDU buffer + * and add the entries to a sdp_list_t. Note that the service record + * handles are not in "data element sequence" form, but just like + * an array of service handles + */ +static void extract_record_handle_seq(char *pdu, sdp_list_t **seq, int count, int *scanned) +{ + sdp_list_t *pSeq = *seq; + char *pdata = pdu; + int n; + + for (n = 0; n < count; n++) { + uint32_t *pSvcRec = (uint32_t *) malloc(sizeof(uint32_t)); + *pSvcRec = ntohl(sdp_get_unaligned((uint32_t *)pdata)); + pSeq = sdp_list_append(pSeq, pSvcRec); + pdata += sizeof(uint32_t); + *scanned += sizeof(uint32_t); + } + *seq = pSeq; +} +/* + * Generate the attribute sequence pdu form + * from sdp_list_t elements. Return length of attr seq + */ +static int gen_dataseq_pdu(char *dst, const sdp_list_t *seq, uint8_t dtd) +{ + sdp_data_t *dataseq; + void **types, **values; + sdp_buf_t buf; + int i, seqlen = sdp_list_len(seq); + + // Fill up the value and the dtd arrays + SDPDBG(""); + + memset(&buf, 0, sizeof(sdp_buf_t)); + buf.data = (char *)malloc(SDP_UUID_SEQ_SIZE); + buf.buf_size = SDP_UUID_SEQ_SIZE; + + SDPDBG("Seq length : %d\n", seqlen); + + types = malloc(seqlen * sizeof(void *)); + values = malloc(seqlen * sizeof(void *)); + for (i = 0; i < seqlen; i++) { + void *data = seq->data; + types[i] = &dtd; + if (SDP_IS_UUID(dtd)) + data = &((uuid_t *)data)->value; + values[i] = data; + seq = seq->next; + } + + dataseq = sdp_seq_alloc(types, values, seqlen); + SDPDBG("Data Seq : 0x%p\n", seq); + seqlen = sdp_gen_pdu(&buf, dataseq); + SDPDBG("Copying : %d\n", buf.data_size); + memcpy(dst, buf.data, buf.data_size); + + sdp_data_free(dataseq); + + free(types); + free(values); + free(buf.data); + return seqlen; +} + +static int gen_searchseq_pdu(char *dst, const sdp_list_t *seq) +{ + uuid_t *uuid = (uuid_t *)seq->data; + return gen_dataseq_pdu(dst, seq, uuid->type); +} + +static int gen_attridseq_pdu(char *dst, const sdp_list_t *seq, uint8_t dataType) +{ + return gen_dataseq_pdu(dst, seq, dataType); +} + +static int copy_cstate(char *pdata, const sdp_cstate_t *cstate) +{ + if (cstate) { + *pdata++ = cstate->length; + memcpy(pdata, cstate->data, cstate->length); + return cstate->length + 1; + } + *pdata = 0; + return 1; +} + +/* + * This is a service search request. + * + * INPUT : + * + * sdp_list_t *search_list + * Singly linked list containing elements of the search + * pattern. Each entry in the list is a UUID (DataTypeSDP_UUID16) + * of the service to be searched + * + * uint16_t max_rec_num + * A 16 bit integer which tells the service, the maximum + * entries that the client can handle in the response. The + * server is obliged not to return > max_rec_num entries + * + * OUTPUT : + * + * int return value + * 0: + * The request completed successfully. This does not + * mean the requested services were found + * -1: + * On any failure and sets errno + * + * sdp_list_t **rsp_list + * This variable is set on a successful return if there are + * non-zero service handles. It is a singly linked list of + * service records (sdp_record_t *) + * + * uint16_t *handleCount + * This is a pointer to a 16 bit integer, which is set to + * indicate the number of service record handles present in + * rec_list + */ +int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, + uint16_t max_rec_num, sdp_list_t **rsp) +{ + int status = 0; + int reqsize = 0, _reqsize; + int rspsize = 0, rsplen; + int seqlen = 0; + int scanned, total_rec_count, rec_count; + char *pdata, *_pdata; + char *reqbuf, *rspbuf; + sdp_pdu_hdr_t *reqhdr, *rsphdr; + sdp_cstate_t *cstate = NULL; + + reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = malloc(SDP_RSP_BUFFER_SIZE); + if (!reqbuf || !rspbuf) { + errno = ENOMEM; + status = -1; + goto end; + } + reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr->pdu_id = SDP_SVC_SEARCH_REQ; + pdata = reqbuf + sizeof(sdp_pdu_hdr_t); + reqsize = sizeof(sdp_pdu_hdr_t); + + // add service class IDs for search + seqlen = gen_searchseq_pdu(pdata, search); + + SDPDBG("Data seq added : %d\n", seqlen); + + // set the length and increment the pointer + reqsize += seqlen; + pdata += seqlen; + + // specify the maximum svc rec count that client expects + sdp_put_unaligned(htons(max_rec_num), (uint16_t *)pdata); + reqsize += sizeof(uint16_t); + pdata += sizeof(uint16_t); + + _reqsize = reqsize; + _pdata = pdata; + *rsp = NULL; + + do { + // Add continuation state or NULL (first time) + reqsize = _reqsize + copy_cstate(_pdata, cstate); + + // Set the request header's param length + reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); + + reqhdr->tid = htons(sdp_gen_tid(session)); + /* + * Send the request, wait for response and if + * no error, set the appropriate values and return + */ + status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); + if (status < 0) + goto end; + + rsplen = 0; + rsphdr = (sdp_pdu_hdr_t *)rspbuf; + rsplen = ntohs(rsphdr->plen); + + if (rsphdr->pdu_id == SDP_ERROR_RSP) { + SDPDBG("Status : 0x%x\n", rsphdr->pdu_id); + status = -1; + goto end; + } + scanned = 0; + pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + + // net service record match count + total_rec_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + pdata += sizeof(uint16_t); + scanned += sizeof(uint16_t); + rec_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + pdata += sizeof(uint16_t); + scanned += sizeof(uint16_t); + + SDPDBG("Total svc count: %d\n", total_rec_count); + SDPDBG("Current svc count: %d\n", rec_count); + SDPDBG("ResponseLength: %d\n", rsplen); + + if (!rec_count) { + status = -1; + goto end; + } + extract_record_handle_seq(pdata, rsp, rec_count, &scanned); + SDPDBG("BytesScanned : %d\n", scanned); + + if (rsplen > scanned) { + uint8_t cstate_len; + + pdata = rspbuf + sizeof(sdp_pdu_hdr_t) + scanned; + cstate_len = *(uint8_t *)pdata; + if (cstate_len > 0) { + cstate = (sdp_cstate_t *)pdata; + SDPDBG("Cont state length: %d\n", cstate_len); + } else + cstate = NULL; + } + } while (cstate); + + end: + if (reqbuf) + free(reqbuf); + if (rspbuf) + free(rspbuf); + + return status; +} + +/* + * This is a service attribute request. + * + * INPUT : + * + * uint32_t handle + * The handle of the service for which the attribute(s) are + * requested + * + * sdp_attrreq_type_t reqtype + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrid + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * OUTPUT : + * return sdp_record_t * + * 0: + * On any error and sets errno + * !0: + * The service record + */ +sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, + sdp_attrreq_type_t reqtype, const sdp_list_t *attrids) +{ + int status = 0; + int reqsize = 0, _reqsize; + int rspsize = 0, rsp_count; + int attr_list_len = 0; + int seqlen = 0; + char *pdata, *_pdata; + char *reqbuf, *rspbuf; + sdp_pdu_hdr_t *reqhdr, *rsphdr; + sdp_cstate_t *cstate = NULL; + uint8_t cstate_len = 0; + sdp_buf_t rsp_concat_buf; + sdp_record_t *rec = 0; + + if (reqtype != SDP_ATTR_REQ_INDIVIDUAL && reqtype != SDP_ATTR_REQ_RANGE) { + errno = EINVAL; + return 0; + } + + reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + if (!reqbuf || !rspbuf) { + errno = ENOMEM; + status = -1; + goto end; + } + memset((char *)&rsp_concat_buf, 0, sizeof(sdp_buf_t)); + reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr->pdu_id = SDP_SVC_ATTR_REQ; + + pdata = reqbuf + sizeof(sdp_pdu_hdr_t); + reqsize = sizeof(sdp_pdu_hdr_t); + + // add the service record handle + sdp_put_unaligned(htonl(handle), (uint32_t *)pdata); + reqsize += sizeof(uint32_t); + pdata += sizeof(uint32_t); + + // specify the response limit + sdp_put_unaligned(htons(65535), (uint16_t *)pdata); + reqsize += sizeof(uint16_t); + pdata += sizeof(uint16_t); + + // get attr seq PDU form + seqlen = gen_attridseq_pdu(pdata, attrids, + reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32); + if (seqlen == -1) { + errno = EINVAL; + status = -1; + goto end; + } + pdata += seqlen; + reqsize += seqlen; + SDPDBG("Attr list length : %d\n", seqlen); + + // save before Continuation State + _pdata = pdata; + _reqsize = reqsize; + + do { + // add NULL continuation state + reqsize = _reqsize + copy_cstate(_pdata, cstate); + + // set the request header's param length + reqhdr->tid = htons(sdp_gen_tid(session)); + reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); + + status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); + if (status < 0) + goto end; + rsp_count = 0; + rsphdr = (sdp_pdu_hdr_t *)rspbuf; + if (rsphdr->pdu_id == SDP_ERROR_RSP) { + SDPDBG("PDU ID : 0x%x\n", rsphdr->pdu_id); + status = -1; + goto end; + } + pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + rsp_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + attr_list_len += rsp_count; + pdata += sizeof(uint16_t); + + // if continuation state set need to re-issue request before parsing + cstate_len = *(uint8_t *)(pdata + rsp_count); + + SDPDBG("Response id : %d\n", rsphdr->pdu_id); + SDPDBG("Attrlist byte count : %d\n", rsp_count); + SDPDBG("sdp_cstate_t length : %d\n", cstate_len); + + /* + * a split response: concatenate intermediate responses + * and the last one (which has cstate_len == 0) + */ + if (cstate_len > 0 || rsp_concat_buf.data_size != 0) { + char *targetPtr = NULL; + + cstate = cstate_len > 0? (sdp_cstate_t *)(pdata + rsp_count): 0; + + // build concatenated response buffer + rsp_concat_buf.data = (char *)realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); + rsp_concat_buf.buf_size = rsp_concat_buf.data_size + rsp_count; + targetPtr = rsp_concat_buf.data + rsp_concat_buf.data_size; + memcpy(targetPtr, pdata, rsp_count); + rsp_concat_buf.data_size += rsp_count; + } + } while (cstate); + + if (attr_list_len > 0) { + int scanned = 0; + if (rsp_concat_buf.data_size != 0) + pdata = rsp_concat_buf.data; + rec = sdp_extract_pdu(pdata, &scanned); + + if (!rec) + status = -1; + } + + end: + if (reqbuf) + free(reqbuf); + if (rsp_concat_buf.data) + free(rsp_concat_buf.data); + if (rspbuf) + free(rspbuf); + return rec; +} + +/* + * This is a service search request combined with the service + * attribute request. First a service class match is done and + * for matching service, requested attributes are extracted + * + * INPUT : + * + * sdp_list_t *search + * Singly linked list containing elements of the search + * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16) + * of the service to be searched + * + * AttributeSpecification attrSpec + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrids + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * OUTPUT : + * int return value + * 0: + * The request completed successfully. This does not + * mean the requested services were found + * -1: + * On any error and sets errno + * + * sdp_list_t **rsp + * This variable is set on a successful return to point to + * service(s) found. Each element of this list is of type + * sdp_record_t* (of the services which matched the search list) + */ +int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrids, sdp_list_t **rsp) +{ + int status = 0; + int reqsize = 0, _reqsize; + int rspsize = 0; + int seqlen = 0, attr_list_len = 0; + int rsp_count = 0, cstate_len = 0; + char *pdata, *_pdata; + char *reqbuf, *rspbuf; + sdp_pdu_hdr_t *reqhdr, *rsphdr; + uint8_t dataType; + sdp_list_t *rec_list = NULL; + sdp_buf_t rsp_concat_buf; + sdp_cstate_t *cstate = NULL; + + if (reqtype != SDP_ATTR_REQ_INDIVIDUAL && reqtype != SDP_ATTR_REQ_RANGE) { + errno = EINVAL; + return -1; + } + reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + if (!reqbuf || !rspbuf) { + errno = ENOMEM; + status = -1; + goto end; + } + + memset((char *)&rsp_concat_buf, 0, sizeof(sdp_buf_t)); + reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr->pdu_id = SDP_SVC_SEARCH_ATTR_REQ; + + // generate PDU + pdata = reqbuf + sizeof(sdp_pdu_hdr_t); + reqsize = sizeof(sdp_pdu_hdr_t); + + // add service class IDs for search + seqlen = gen_searchseq_pdu(pdata, search); + + SDPDBG("Data seq added : %d\n", seqlen); + + // now set the length and increment the pointer + reqsize += seqlen; + pdata += seqlen; + + sdp_put_unaligned(htons(SDP_MAX_ATTR_LEN), (uint16_t *)pdata); + reqsize += sizeof(uint16_t); + pdata += sizeof(uint16_t); + + SDPDBG("Max attr byte count : %d\n", SDP_MAX_ATTR_LEN); + + // get attr seq PDU form + seqlen = gen_attridseq_pdu(pdata, attrids, + reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16: SDP_UINT32); + if (seqlen == -1) { + status = EINVAL; + goto end; + } + pdata += seqlen; + SDPDBG("Attr list length : %d\n", seqlen); + reqsize += seqlen; + *rsp = 0; + + // save before Continuation State + _pdata = pdata; + _reqsize = reqsize; + + do { + reqhdr->tid = htons(sdp_gen_tid(session)); + + // add continuation state (can be null) + reqsize = _reqsize + copy_cstate(_pdata, cstate); + + // set the request header's param length + reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); + rsphdr = (sdp_pdu_hdr_t *)rspbuf; + status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); + if (status < 0) { + SDPDBG("Status : 0x%x\n", rsphdr->pdu_id); + goto end; + } + + if (rsphdr->pdu_id == SDP_ERROR_RSP) { + status = -1; + goto end; + } + + pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + rsp_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + attr_list_len += rsp_count; + pdata += sizeof(uint16_t); // pdata points to attribute list + cstate_len = *(uint8_t *)(pdata + rsp_count); + + SDPDBG("Attrlist byte count : %d\n", attr_list_len); + SDPDBG("Response byte count : %d\n", rsp_count); + SDPDBG("Cstate length : %d\n", cstate_len); + /* + * This is a split response, need to concatenate intermediate + * responses and the last one which will have cstate_len == 0 + */ + if (cstate_len > 0 || rsp_concat_buf.data_size != 0) { + char *targetPtr = NULL; + + cstate = cstate_len > 0? (sdp_cstate_t *)(pdata + rsp_count): 0; + + // build concatenated response buffer + rsp_concat_buf.data = (char *)realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); + targetPtr = rsp_concat_buf.data + rsp_concat_buf.data_size; + rsp_concat_buf.buf_size = rsp_concat_buf.data_size + rsp_count; + memcpy(targetPtr, pdata, rsp_count); + rsp_concat_buf.data_size += rsp_count; + } + } while (cstate); + + if (attr_list_len > 0) { + int scanned = 0; + + if (rsp_concat_buf.data_size != 0) + pdata = rsp_concat_buf.data; + + /* + * Response is a sequence of sequence(s) for one or + * more data element sequence(s) representing services + * for which attributes are returned + */ + scanned = sdp_extract_seqtype(pdata, &dataType, &seqlen); + + SDPDBG("Bytes scanned : %d\n", scanned); + SDPDBG("Seq length : %d\n", seqlen); + + if (scanned && seqlen) { + pdata += scanned; + do { + int recsize = 0; + sdp_record_t *rec = sdp_extract_pdu(pdata, &recsize); + if (rec == NULL) { + SDPERR("SVC REC is null\n"); + status = -1; + goto end; + } + scanned += recsize; + pdata += recsize; + + SDPDBG("Loc seq length : %d\n", recsize); + SDPDBG("Svc Rec Handle : 0x%x\n", rec->handle); + SDPDBG("Bytes scanned : %d\n", scanned); + SDPDBG("Attrlist byte count : %d\n", attr_list_len); + rec_list = sdp_list_append(rec_list, rec); + } while (scanned < attr_list_len); + + SDPDBG("Successful scan of service attr lists\n"); + *rsp = rec_list; + } + } + end: + if (rsp_concat_buf.data) + free(rsp_concat_buf.data); + if (reqbuf) + free(reqbuf); + if (rspbuf) + free(rspbuf); + return status; +} + +/* + * Find devices in the piconet. + */ +int sdp_general_inquiry(inquiry_info *ii, int num_dev, int duration, uint8_t *found) +{ + int n = hci_inquiry(-1, 10, num_dev, NULL, &ii, 0); + if (n < 0) { + SDPERR("Inquiry failed:%s", strerror(errno)); + return -1; + } + *found = n; + return 0; +} + +int sdp_close(sdp_session_t *session) +{ + int ret = close(session->sock); + free(session); + return ret; +} + +static inline int sdp_is_local(const bdaddr_t *device) +{ + return memcmp(device, BDADDR_LOCAL, sizeof(bdaddr_t)) == 0; +} + +sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags) +{ + sdp_session_t *session = malloc(sizeof(sdp_session_t)); + if (!session) + return session; + memset(session, 0, sizeof(*session)); + session->flags = flags; + if (sdp_is_local(dst)) { + struct sockaddr_un sa; + + // create local unix connection + session->sock = socket(PF_UNIX, SOCK_STREAM, 0); + session->local = 1; + if (session->sock >= 0) { + sa.sun_family = AF_UNIX; + strcpy(sa.sun_path, SDP_UNIX_PATH); + if (connect(session->sock, (struct sockaddr *)&sa, sizeof(sa)) == 0) + return session; + } + } else { + struct sockaddr_l2 sa; + + // create L2CAP connection + session->sock = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); + session->local = 0; + if (session->sock >= 0) { + sa.l2_family = AF_BLUETOOTH; + sa.l2_psm = 0; + if (bacmp(src, BDADDR_ANY) != 0) { + sa.l2_bdaddr = *src; + if (0 > bind(session->sock, (struct sockaddr *)&sa, sizeof(sa))) + goto fail; + } + sa.l2_psm = htobs(SDP_PSM); + sa.l2_bdaddr = *dst; + do + if (connect(session->sock, (struct sockaddr *)&sa, sizeof(sa)) == 0) + return session; + while (errno == EBUSY && (flags & SDP_RETRY_IF_BUSY)); + } + } +fail: + if (session->sock >= 0) + close(session->sock); + free(session); + return 0; +} -- cgit From 4d97c2497c2bee809432ea3e48676fa61538bbef Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 16:48:38 +0000 Subject: Use R2 for default value of pscan_rep_mode --- src/hci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index 8100d227..3778f064 100644 --- a/src/hci.c +++ b/src/hci.c @@ -734,7 +734,7 @@ int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t c memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); cp.pkt_type = ptype; - cp.pscan_rep_mode = 0x01; + cp.pscan_rep_mode = 0x02; cp.clock_offset = clkoffset; cp.role_switch = rswitch; @@ -847,7 +847,7 @@ int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, ba); - cp.pscan_rep_mode = 0x01; + cp.pscan_rep_mode = 0x02; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; -- cgit From 51342992af3f09ffad66197aa84e5960e1fc4c28 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 19:49:50 +0000 Subject: Cleaner way of creating the bluetooth include link --- include/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index f615705a..78afcf73 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -6,9 +6,9 @@ includedir = @includedir@/bluetooth include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h -bluetooth: - ln -s . bluetooth -all-local: bluetooth +all-local: + @if [ ! -e bluetooth ] ; then ln -s $(top_srcdir)/include bluetooth ; fi + clean-local: - rm -f bluetooth + @rm -f bluetooth -- cgit From 51e671b116fe121053444c4817e38ad07e9586f8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 19:50:46 +0000 Subject: Use $(top_builddir) as include root directory --- src/Makefile.am | 2 +- src/bluetooth.c | 4 ++-- src/hci.c | 6 +++--- src/sdp.c | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 6c6b9fc4..17fdbf6d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,4 +10,4 @@ libbluetooth_la_LDFLAGS = -version-info 1:4:0 libsdp_la_SOURCES = libsdp_la_LDFLAGS = -version-info 2:2:0 -INCLUDES = -I$(top_srcdir)/include +INCLUDES = -I$(top_builddir)/include diff --git a/src/bluetooth.c b/src/bluetooth.c index 1607c04f..a57809d7 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -32,8 +32,8 @@ #include #include -#include -#include +#include +#include void baswap(bdaddr_t *dst, const bdaddr_t *src) { diff --git a/src/hci.c b/src/hci.c index 3778f064..1530f395 100644 --- a/src/hci.c +++ b/src/hci.c @@ -43,9 +43,9 @@ #include #include -#include -#include -#include +#include +#include +#include typedef struct { char *str; unsigned int val; diff --git a/src/sdp.c b/src/sdp.c index 4ffb0d93..b793f64f 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -38,13 +38,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #define BASE_UUID "00000000-0000-1000-8000-00805F9B34FB" -- cgit From cd92094bf45c07b666971d68b228d3340e974b5d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 21:08:51 +0000 Subject: Add CMTP header file --- include/Makefile.am | 2 +- include/cmtp.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 include/cmtp.h diff --git a/include/Makefile.am b/include/Makefile.am index 78afcf73..22bce597 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h cmtp.h all-local: diff --git a/include/cmtp.h b/include/cmtp.h new file mode 100644 index 00000000..55cc289d --- /dev/null +++ b/include/cmtp.h @@ -0,0 +1,67 @@ +/* + CMTP protocol definition for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002-2003 Marcel Holtmann + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation; + + 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + SOFTWARE IS DISCLAIMED. +*/ + +#ifndef __CMTP_H +#define __CMTP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define CMTP_MINIMUM_MTU 152 +#define CMTP_DEFAULT_MTU 672 + +/* CMTP ioctl defines */ +#define CMTPCONNADD _IOW('C', 200, int) +#define CMTPCONNDEL _IOW('C', 201, int) +#define CMTPGETCONNLIST _IOR('C', 210, int) +#define CMTPGETCONNINFO _IOR('C', 211, int) + +#define CMTP_LOOPBACK 0 + +struct cmtp_connadd_req { + int sock; // Connected socket + uint32_t flags; +}; + +struct cmtp_conndel_req { + bdaddr_t bdaddr; + uint32_t flags; +}; + +struct cmtp_conninfo { + bdaddr_t bdaddr; + uint32_t flags; + uint16_t state; + int num; +}; + +struct cmtp_connlist_req { + uint16_t cnum; + struct cmtp_conninfo *ci; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __CMTP_H */ -- cgit From 8b79ceda57e986eb952c84688cd92dd33e32f046 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 21:53:36 +0000 Subject: Update RPM spec file --- libs.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs.spec b/libs.spec index 245c24f0..6ac5cb0c 100644 --- a/libs.spec +++ b/libs.spec @@ -18,7 +18,6 @@ URL: http://bluez.sourceforge.net Docdir: %{prefix}/share/doc Requires: glibc >= 2.2.4 BuildRequires: glibc >= 2.2.4 -BuildRequires: glib-devel >= 1.2 %description Bluetooth libraries. @@ -55,6 +54,7 @@ rm -rf $RPM_BUILD_ROOT /usr/include/bluetooth/* /usr/lib/libbluetooth* +/usr/lib/libsdp* %doc AUTHORS COPYING INSTALL ChangeLog NEWS README -- cgit From 66e912c137f52fcac7eab1a7d0d9da65b975b2cc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Mar 2004 21:56:37 +0000 Subject: Add BNEP header file --- include/Makefile.am | 2 +- include/bnep.h | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 include/bnep.h diff --git a/include/Makefile.am b/include/Makefile.am index 22bce597..ec8835a2 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,7 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h cmtp.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h bnep.h cmtp.h all-local: diff --git a/include/bnep.h b/include/bnep.h new file mode 100644 index 00000000..0a6daa03 --- /dev/null +++ b/include/bnep.h @@ -0,0 +1,148 @@ +/* + BNEP protocol definition for Linux Bluetooth stack (BlueZ). + Copyright (C) 2002-2003 Maxim Krasnyansky + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* + * $Id$ + */ + +#ifndef __BNEP_H +#define __BNEP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* BNEP UUIDs */ +#define BNEP_BASE_UUID 0x0000000000001000800000805F9B34FB +#define BNEP_UUID16 0x02 +#define BNEP_UUID32 0x04 +#define BNEP_UUID128 0x16 + +#define BNEP_SVC_PANU 0x1115 +#define BNEP_SVC_NAP 0x1116 +#define BNEP_SVC_GN 0x1117 + +/* BNEP packet types */ +#define BNEP_GENERAL 0x00 +#define BNEP_CONTROL 0x01 +#define BNEP_COMPRESSED 0x02 +#define BNEP_COMPRESSED_SRC_ONLY 0x03 +#define BNEP_COMPRESSED_DST_ONLY 0x04 + +/* BNEP control types */ +#define BNEP_CMD_NOT_UNDERSTOOD 0x00 +#define BNEP_SETUP_CONN_REQ 0x01 +#define BNEP_SETUP_CONN_RSP 0x02 +#define BNEP_FILTER_NET_TYPE_SET 0x03 +#define BNEP_FILTER_NET_TYPE_RSP 0x04 +#define BNEP_FILTER_MULT_ADDR_SET 0x05 +#define BNEP_FILTER_MULT_ADDR_RSP 0x06 + +/* BNEP response messages */ +#define BNEP_SUCCESS 0x00 + +#define BNEP_CONN_INVALID_DST 0x01 +#define BNEP_CONN_INVALID_SRC 0x02 +#define BNEP_CONN_INVALID_SVC 0x03 +#define BNEP_CONN_NOT_ALLOWED 0x04 + +#define BNEP_FILTER_UNSUPPORTED_REQ 0x01 +#define BNEP_FILTER_INVALID_RANGE 0x02 +#define BNEP_FILTER_INVALID_MCADDR 0x02 +#define BNEP_FILTER_LIMIT_REACHED 0x03 +#define BNEP_FILTER_DENIED_SECURITY 0x04 + +/* L2CAP settings */ +#define BNEP_MTU 1691 +#define BNEP_FLUSH_TO 0xffff +#define BNEP_CONNECT_TO 15 +#define BNEP_FILTER_TO 15 + +#ifndef BNEP_PSM +#define BNEP_PSM 0x0f +#endif + +/* BNEP headers */ +#define BNEP_TYPE_MASK 0x7f +#define BNEP_EXT_HEADER 0x80 + +struct bnep_setup_conn_req { + uint8_t type; + uint8_t ctrl; + uint8_t uuid_size; + uint8_t service[0]; +} __attribute__((packed)); + +struct bnep_set_filter_req { + uint8_t type; + uint8_t ctrl; + uint16_t len; + uint8_t list[0]; +} __attribute__((packed)); + +struct bnep_control_rsp { + uint8_t type; + uint8_t ctrl; + uint16_t resp; +} __attribute__((packed)); + +struct bnep_ext_hdr { + uint8_t type; + uint8_t len; + uint8_t data[0]; +} __attribute__((packed)); + +/* BNEP ioctl defines */ +#define BNEPCONNADD _IOW('B', 200, int) +#define BNEPCONNDEL _IOW('B', 201, int) +#define BNEPGETCONNLIST _IOR('B', 210, int) +#define BNEPGETCONNINFO _IOR('B', 211, int) + +struct bnep_connadd_req { + int sock; // Connected socket + uint32_t flags; + uint16_t role; + char device[16]; // Name of the Ethernet device +}; + +struct bnep_conndel_req { + uint32_t flags; + uint8_t dst[ETH_ALEN]; +}; + +struct bnep_conninfo { + uint32_t flags; + uint16_t role; + uint16_t state; + uint8_t dst[ETH_ALEN]; + char device[16]; +}; + +struct bnep_connlist_req { + uint32_t cnum; + struct bnep_conninfo *ci; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __BNEP_H */ -- cgit From ff3922238b4258eb2f9f9458589d3cecd177f7bc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 10:18:22 +0000 Subject: Store additional unitSize for strings --- src/sdp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index b793f64f..0fec56f7 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -810,14 +810,15 @@ static sdp_data_t *extract_str(const void *p, int *len) return 0; } - s = (char *)malloc(n + 1); + s = malloc(n + 1); memset(s, 0, n + 1); - strncpy(s, p, n); + memcpy(s, p, n); SDPDBG("Len : %d\n", n); SDPDBG("Str : %s\n", s); d->val.str = s; + d->unitSize = n; return d; } -- cgit From 99c36169b28df63153d24d1824bd276e68f5f140 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 14:01:15 +0000 Subject: Increase size of UUID string representation --- include/sdp_lib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 4306eb55..763f80fa 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -426,8 +426,8 @@ void sdp_uuid_print(const uuid_t *uuid); #define MAX_LEN_UUID_STR 37 #define MAX_LEN_PROTOCOL_UUID_STR 8 -#define MAX_LEN_SERVICECLASS_UUID_STR 24 -#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 22 +#define MAX_LEN_SERVICECLASS_UUID_STR 28 +#define MAX_LEN_PROFILEDESCRIPTOR_UUID_STR 28 int sdp_uuid2strn(const uuid_t *uuid, char *str, size_t n); int sdp_proto_uuid2strn(const uuid_t *uuid, char *str, size_t n); -- cgit From b5705586036d2aefa5b75ebe26ed64445a4d79be Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 14:02:12 +0000 Subject: Add string representation for HID and CIP --- src/sdp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sdp.c b/src/sdp.c index 0fec56f7..cbc68193 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -70,6 +70,8 @@ static struct tupla Protocol[] = { { HTTP_UUID, "HTTP" }, { WSP_UUID, "WSP" }, { BNEP_UUID, "BNEP" }, + { HIDP_UUID, "HIDP" }, + { CMTP_UUID, "CMTP" }, { 0 } }; @@ -97,6 +99,8 @@ static struct tupla ServiceClass[] = { { PANU_SVCLASS_ID, "PAN user" }, { NAP_SVCLASS_ID, "Network access point" }, { GN_SVCLASS_ID, "PAN group network" }, + { HID_SVCLASS_ID, "Human Interface Device" }, + { CIP_SVCLASS_ID, "Common ISDN Access" }, { 0 } }; @@ -116,6 +120,8 @@ static struct tupla Profile[] = { { PANU_PROFILE_ID, "PAN user" }, { NAP_PROFILE_ID, "PAN access point" }, { GN_PROFILE_ID, "PAN group network" }, + { HID_SVCLASS_ID, "Human Interface Device" }, + { CIP_SVCLASS_ID, "Common ISDN Access" }, { 0 } }; -- cgit From 7250b16c76c07bcaac5c996f7aaa134a71c46e14 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 20:51:38 +0000 Subject: Update changelog and bump version number --- ChangeLog | 6 ++++++ configure.in | 2 +- libs.spec | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf6f2f98..b3bbb255 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 2.6: + Use R2 for default value of pscan_rep_mode. + Add new company identifiers. + Add BNEP and CMTP header files. + Add the SDP library. + ver 2.5: Add decoding of Bluetooth 1.2 features. Add link manager version parameter for Bluetooth 1.2. diff --git a/configure.in b/configure.in index 243a7551..b3691d5a 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT() AM_MAINTAINER_MODE -AM_INIT_AUTOMAKE(bluez-libs, 2.5) +AM_INIT_AUTOMAKE(bluez-libs, 2.6) AC_PREFIX_DEFAULT(/usr) diff --git a/libs.spec b/libs.spec index 6ac5cb0c..6a660514 100644 --- a/libs.spec +++ b/libs.spec @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 2.5 +%define ver 2.6 %define RELEASE 1 %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr -- cgit From 4e43f4815b60f7221d1fddb3e145346fa5426c7f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 23:28:53 +0000 Subject: Update the autoconf stuff --- configure.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index b3691d5a..3176b1dc 100644 --- a/configure.in +++ b/configure.in @@ -3,20 +3,24 @@ dnl $Id$ dnl dnl Process this file with autoconf to produce a configure script. dnl -AC_INIT() -AM_MAINTAINER_MODE +AC_PREREQ(2.50) +AC_INIT() AM_INIT_AUTOMAKE(bluez-libs, 2.6) +AM_MAINTAINER_MODE + AC_PREFIX_DEFAULT(/usr) CFLAGS="-Wall -g -O2" +AC_LANG_C + AC_PROG_CC AC_PROG_INSTALL -dnl AC_LIBTOOL_TAGS([]) +m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])]) AC_PROG_LIBTOOL -- cgit From 6a82272dbce1c29fd3742ddd15e841933e605681 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 1 Apr 2004 23:45:02 +0000 Subject: Update the installation information --- README | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/README b/README index 6638febb..6e232e32 100644 --- a/README +++ b/README @@ -1,33 +1,32 @@ BlueZ - Bluetooth protocol stack for Linux -Copyright (C) 2000-2001 Qualcomm Incorporated -Written 2000,2001 by Maxim Krasnyansky +Copyright (C) 2000-2001 Qualcomm Incorporated +Copyright (C) 2002-2003 Maxim Krasnyansky +Copyright (C) 2002-2004 Marcel Holtmann -Bluetooth Libraries +Bluetooth libraries -1. Compilation and Installation. + +1. Compilation and installation. In order to compile Bluetooth libraries you need following software packages: - - Linux kernel 2.4.X source code - - GCC compiler + - Linux Bluetooth protocol stack (BlueZ) + - GCC compiler To configure run: - ./configure + ./configure --prefix=/usr --sysconfdir=/etc Configure automatically searches for all required components and packages. To compile and install run: - make install + make install + -2.0 Information +2. Information Mailing lists: - bluez-users@lists.sourceforge.net - BlueZ general questions and discussions - bluez-devel@lists.sourceforge.net - BlueZ development - bluez-commit@lists.sourceforge.net - BlueZ commits to the CVS repository - bluez-announce@lists.sourceforge.net - BlueZ announcements + bluez-users@lists.sourceforge.net - BlueZ general questions and discussions + bluez-devel@lists.sourceforge.net - BlueZ development For additional information about the project visit BlueZ web site: - http://bluez.sf.net - -Maxim Krasnyansky + http://www.bluez.org -- cgit From 764abe23a0d4ede999f1f34ee0e310c0eeaaff79 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 05:11:38 +0000 Subject: Update copyright information --- include/bluetooth.h | 58 +++++++------- include/bnep.h | 51 +++++++------ include/cmtp.h | 50 +++++++------ include/hci.h | 108 +++++++++++++------------- include/hci_lib.h | 58 +++++++------- include/hci_uart.h | 62 ++++++++------- include/hci_vhci.h | 59 ++++++++------- include/l2cap.h | 200 +++++++++++++++++++++++++------------------------ include/rfcomm.h | 96 ++++++++++++------------ include/sco.h | 51 ++++++------- include/sdp.h | 66 +++++++++------- include/sdp_internal.h | 84 ++++++++++++--------- include/sdp_lib.h | 76 ++++++++++--------- src/bluetooth.c | 76 ++++++++++--------- src/hci.c | 155 +++++++++++++++++++++----------------- src/sdp.c | 61 ++++++++------- 16 files changed, 701 insertions(+), 610 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index f4ceaae5..8690f456 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -1,28 +1,30 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -104,11 +106,11 @@ static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src) void baswap(bdaddr_t *dst, const bdaddr_t *src); bdaddr_t *strtoba(const char *str); -char *batostr(const bdaddr_t *ba); -int ba2str(const bdaddr_t *ba, char *str); -int str2ba(const char *str, bdaddr_t *ba); +char *batostr(const bdaddr_t *ba); +int ba2str(const bdaddr_t *ba, char *str); +int str2ba(const char *str, bdaddr_t *ba); -int bt_error(uint16_t code); +int bt_error(uint16_t code); char *bt_compidtostr(int id); #ifdef __cplusplus diff --git a/include/bnep.h b/include/bnep.h index 0a6daa03..05ecbfed 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -1,23 +1,30 @@ /* - BNEP protocol definition for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002-2003 Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __BNEP_H @@ -117,10 +124,10 @@ struct bnep_ext_hdr { #define BNEPGETCONNINFO _IOR('B', 211, int) struct bnep_connadd_req { - int sock; // Connected socket + int sock; /* Connected socket */ uint32_t flags; uint16_t role; - char device[16]; // Name of the Ethernet device + char device[16]; /* Name of the Ethernet device */ }; struct bnep_conndel_req { @@ -131,7 +138,7 @@ struct bnep_conndel_req { struct bnep_conninfo { uint32_t flags; uint16_t role; - uint16_t state; + uint16_t state; uint8_t dst[ETH_ALEN]; char device[16]; }; diff --git a/include/cmtp.h b/include/cmtp.h index 55cc289d..0883556f 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -1,24 +1,30 @@ -/* - CMTP protocol definition for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002-2003 Marcel Holtmann - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ + */ #ifndef __CMTP_H #define __CMTP_H @@ -39,7 +45,7 @@ extern "C" { #define CMTP_LOOPBACK 0 struct cmtp_connadd_req { - int sock; // Connected socket + int sock; /* Connected socket */ uint32_t flags; }; diff --git a/include/hci.h b/include/hci.h index fee39c20..fc57bbca 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1,28 +1,30 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -33,7 +35,7 @@ extern "C" { #endif -#define HCI_MAX_DEV 16 +#define HCI_MAX_DEV 16 #define HCI_MAX_ACL_SIZE 1024 #define HCI_MAX_SCO_SIZE 255 @@ -42,7 +44,7 @@ extern "C" { /* HCI dev events */ #define HCI_DEV_REG 1 -#define HCI_DEV_UNREG 2 +#define HCI_DEV_UNREG 2 #define HCI_DEV_UP 3 #define HCI_DEV_DOWN 4 #define HCI_DEV_SUSPEND 5 @@ -52,8 +54,8 @@ extern "C" { #define HCI_VHCI 0 #define HCI_USB 1 #define HCI_PCCARD 2 -#define HCI_UART 3 -#define HCI_RS232 4 +#define HCI_UART 3 +#define HCI_RS232 4 #define HCI_PCI 5 /* HCI device flags */ @@ -72,40 +74,40 @@ enum { }; /* HCI ioctl defines */ -#define HCIDEVUP _IOW('H', 201, int) -#define HCIDEVDOWN _IOW('H', 202, int) -#define HCIDEVRESET _IOW('H', 203, int) -#define HCIDEVRESTAT _IOW('H', 204, int) - -#define HCIGETDEVLIST _IOR('H', 210, int) -#define HCIGETDEVINFO _IOR('H', 211, int) -#define HCIGETCONNLIST _IOR('H', 212, int) -#define HCIGETCONNINFO _IOR('H', 213, int) - -#define HCISETRAW _IOW('H', 220, int) -#define HCISETSCAN _IOW('H', 221, int) -#define HCISETAUTH _IOW('H', 222, int) -#define HCISETENCRYPT _IOW('H', 223, int) -#define HCISETPTYPE _IOW('H', 224, int) -#define HCISETLINKPOL _IOW('H', 225, int) -#define HCISETLINKMODE _IOW('H', 226, int) -#define HCISETACLMTU _IOW('H', 227, int) -#define HCISETSCOMTU _IOW('H', 228, int) - -#define HCIINQUIRY _IOR('H', 240, int) +#define HCIDEVUP _IOW('H', 201, int) +#define HCIDEVDOWN _IOW('H', 202, int) +#define HCIDEVRESET _IOW('H', 203, int) +#define HCIDEVRESTAT _IOW('H', 204, int) + +#define HCIGETDEVLIST _IOR('H', 210, int) +#define HCIGETDEVINFO _IOR('H', 211, int) +#define HCIGETCONNLIST _IOR('H', 212, int) +#define HCIGETCONNINFO _IOR('H', 213, int) + +#define HCISETRAW _IOW('H', 220, int) +#define HCISETSCAN _IOW('H', 221, int) +#define HCISETAUTH _IOW('H', 222, int) +#define HCISETENCRYPT _IOW('H', 223, int) +#define HCISETPTYPE _IOW('H', 224, int) +#define HCISETLINKPOL _IOW('H', 225, int) +#define HCISETLINKMODE _IOW('H', 226, int) +#define HCISETACLMTU _IOW('H', 227, int) +#define HCISETSCOMTU _IOW('H', 228, int) + +#define HCIINQUIRY _IOR('H', 240, int) /* HCI timeouts */ -#define HCI_CONN_TIMEOUT (HZ * 40) -#define HCI_DISCONN_TIMEOUT (HZ * 2) +#define HCI_CONN_TIMEOUT (HZ * 40) +#define HCI_DISCONN_TIMEOUT (HZ * 2) #define HCI_CONN_IDLE_TIMEOUT (HZ * 60) #ifndef __NO_HCI_DEFS /* HCI Packet types */ #define HCI_COMMAND_PKT 0x01 -#define HCI_ACLDATA_PKT 0x02 -#define HCI_SCODATA_PKT 0x03 +#define HCI_ACLDATA_PKT 0x02 +#define HCI_SCODATA_PKT 0x03 #define HCI_EVENT_PKT 0x04 #define HCI_UNKNOWN_PKT 0xff diff --git a/include/hci_lib.h b/include/hci_lib.h index 6b7b6f63..e048375e 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -1,29 +1,31 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __HCI_LIB_H @@ -64,7 +66,7 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *ba); int hci_devid(const char *str); -// deprecated: preserve compatibility +/* deprecated: preserve compatibility */ int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); @@ -82,7 +84,7 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, int on, int to); -// role == 0 is master, 1 is slave +/* role == 0 is master, 1 is slave */ int hci_switch_role(int dd, bdaddr_t peer, int role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); @@ -108,7 +110,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width); static inline void hci_set_bit(int nr, void *addr) { - *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); + *((uint32_t *) addr + (nr >> 5)) |= (1 << (nr & 31)); } static inline void hci_clear_bit(int nr, void *addr) diff --git a/include/hci_uart.h b/include/hci_uart.h index e609ed47..0cc97794 100644 --- a/include/hci_uart.h +++ b/include/hci_uart.h @@ -1,34 +1,39 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __HCI_UART_H #define __HCI_UART_H +#ifdef __cplusplus +extern "C" { +#endif + #ifndef N_HCI #define N_HCI 15 #endif @@ -40,6 +45,11 @@ /* UART protocols */ #define HCI_UART_H4 0 #define HCI_UART_BCSP 1 -#define HCI_UART_NCSP 2 +#define HCI_UART_3WIRE 2 +#define HCI_UART_H4DS 3 + +#ifdef __cplusplus +} +#endif #endif /* __HCI_UART_H */ diff --git a/include/hci_vhci.h b/include/hci_vhci.h index 4eee6656..1f5c0efe 100644 --- a/include/hci_vhci.h +++ b/include/hci_vhci.h @@ -1,35 +1,44 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ #ifndef __HCI_VHCI_H #define __HCI_VHCI_H +#ifdef __cplusplus +extern "C" { +#endif + #define VHCI_DEV "/dev/vhci" #define VHCI_MINOR 250 +#ifdef __cplusplus +} +#endif + #endif /* __HCI_VHCI_H */ diff --git a/include/l2cap.h b/include/l2cap.h index a5110a24..d06eb800 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -1,28 +1,30 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -37,7 +39,7 @@ extern "C" { #define L2CAP_DEFAULT_MTU 672 #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF -#define L2CAP_CONN_TIMEOUT (HZ * 40) +#define L2CAP_CONN_TIMEOUT (HZ * 40) /* L2CAP socket address */ struct sockaddr_l2 { @@ -81,87 +83,87 @@ struct l2cap_qos { #define L2CAP_SERV_GUARANTEED 0x02 /* L2CAP command codes */ -#define L2CAP_COMMAND_REJ 0x01 -#define L2CAP_CONN_REQ 0x02 -#define L2CAP_CONN_RSP 0x03 -#define L2CAP_CONF_REQ 0x04 -#define L2CAP_CONF_RSP 0x05 -#define L2CAP_DISCONN_REQ 0x06 -#define L2CAP_DISCONN_RSP 0x07 -#define L2CAP_ECHO_REQ 0x08 -#define L2CAP_ECHO_RSP 0x09 -#define L2CAP_INFO_REQ 0x0a -#define L2CAP_INFO_RSP 0x0b +#define L2CAP_COMMAND_REJ 0x01 +#define L2CAP_CONN_REQ 0x02 +#define L2CAP_CONN_RSP 0x03 +#define L2CAP_CONF_REQ 0x04 +#define L2CAP_CONF_RSP 0x05 +#define L2CAP_DISCONN_REQ 0x06 +#define L2CAP_DISCONN_RSP 0x07 +#define L2CAP_ECHO_REQ 0x08 +#define L2CAP_ECHO_RSP 0x09 +#define L2CAP_INFO_REQ 0x0a +#define L2CAP_INFO_RSP 0x0b /* L2CAP structures */ typedef struct { - uint16_t len; - uint16_t cid; -} __attribute__ ((packed)) l2cap_hdr; -#define L2CAP_HDR_SIZE 4 + uint16_t len; + uint16_t cid; +} __attribute__ ((packed)) l2cap_hdr; +#define L2CAP_HDR_SIZE 4 typedef struct { - uint8_t code; - uint8_t ident; - uint16_t len; -} __attribute__ ((packed)) l2cap_cmd_hdr; -#define L2CAP_CMD_HDR_SIZE 4 + uint8_t code; + uint8_t ident; + uint16_t len; +} __attribute__ ((packed)) l2cap_cmd_hdr; +#define L2CAP_CMD_HDR_SIZE 4 typedef struct { - uint16_t reason; -} __attribute__ ((packed)) l2cap_cmd_rej; -#define L2CAP_CMD_REJ_SIZE 2 + uint16_t reason; +} __attribute__ ((packed)) l2cap_cmd_rej; +#define L2CAP_CMD_REJ_SIZE 2 typedef struct { - uint16_t psm; - uint16_t scid; -} __attribute__ ((packed)) l2cap_conn_req; -#define L2CAP_CONN_REQ_SIZE 4 + uint16_t psm; + uint16_t scid; +} __attribute__ ((packed)) l2cap_conn_req; +#define L2CAP_CONN_REQ_SIZE 4 typedef struct { - uint16_t dcid; - uint16_t scid; - uint16_t result; - uint16_t status; -} __attribute__ ((packed)) l2cap_conn_rsp; -#define L2CAP_CONN_RSP_SIZE 8 + uint16_t dcid; + uint16_t scid; + uint16_t result; + uint16_t status; +} __attribute__ ((packed)) l2cap_conn_rsp; +#define L2CAP_CONN_RSP_SIZE 8 /* connect result */ -#define L2CAP_CR_SUCCESS 0x0000 -#define L2CAP_CR_PEND 0x0001 -#define L2CAP_CR_BAD_PSM 0x0002 -#define L2CAP_CR_SEC_BLOCK 0x0003 -#define L2CAP_CR_NO_MEM 0x0004 +#define L2CAP_CR_SUCCESS 0x0000 +#define L2CAP_CR_PEND 0x0001 +#define L2CAP_CR_BAD_PSM 0x0002 +#define L2CAP_CR_SEC_BLOCK 0x0003 +#define L2CAP_CR_NO_MEM 0x0004 /* connect status */ -#define L2CAP_CS_NO_INFO 0x0000 -#define L2CAP_CS_AUTHEN_PEND 0x0001 -#define L2CAP_CS_AUTHOR_PEND 0x0002 +#define L2CAP_CS_NO_INFO 0x0000 +#define L2CAP_CS_AUTHEN_PEND 0x0001 +#define L2CAP_CS_AUTHOR_PEND 0x0002 typedef struct { - uint16_t dcid; - uint16_t flags; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_conf_req; -#define L2CAP_CONF_REQ_SIZE 4 + uint16_t dcid; + uint16_t flags; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_req; +#define L2CAP_CONF_REQ_SIZE 4 typedef struct { - uint16_t scid; - uint16_t flags; - uint16_t result; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_conf_rsp; -#define L2CAP_CONF_RSP_SIZE 6 + uint16_t scid; + uint16_t flags; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_conf_rsp; +#define L2CAP_CONF_RSP_SIZE 6 #define L2CAP_CONF_SUCCESS 0x00 #define L2CAP_CONF_UNACCEPT 0x01 typedef struct { - uint8_t type; - uint8_t len; - uint8_t val[0]; -} __attribute__ ((packed)) l2cap_conf_opt; -#define L2CAP_CONF_OPT_SIZE 2 + uint8_t type; + uint8_t len; + uint8_t val[0]; +} __attribute__ ((packed)) l2cap_conf_opt; +#define L2CAP_CONF_OPT_SIZE 2 #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 @@ -170,29 +172,29 @@ typedef struct { #define L2CAP_CONF_MAX_SIZE 22 typedef struct { - uint16_t dcid; - uint16_t scid; -} __attribute__ ((packed)) l2cap_disconn_req; -#define L2CAP_DISCONN_REQ_SIZE 4 + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_req; +#define L2CAP_DISCONN_REQ_SIZE 4 typedef struct { - uint16_t dcid; - uint16_t scid; -} __attribute__ ((packed)) l2cap_disconn_rsp; -#define L2CAP_DISCONN_RSP_SIZE 4 + uint16_t dcid; + uint16_t scid; +} __attribute__ ((packed)) l2cap_disconn_rsp; +#define L2CAP_DISCONN_RSP_SIZE 4 typedef struct { - uint16_t type; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_info_req; -#define L2CAP_INFO_REQ_SIZE 2 + uint16_t type; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_req; +#define L2CAP_INFO_REQ_SIZE 2 typedef struct { - uint16_t type; - uint16_t result; - uint8_t data[0]; -} __attribute__ ((packed)) l2cap_info_rsp; -#define L2CAP_INFO_RSP_SIZE 4 + uint16_t type; + uint16_t result; + uint8_t data[0]; +} __attribute__ ((packed)) l2cap_info_rsp; +#define L2CAP_INFO_RSP_SIZE 4 #ifdef __cplusplus } diff --git a/include/rfcomm.h b/include/rfcomm.h index f04ace71..bb79a7a2 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -1,27 +1,29 @@ -/* - RFCOMM protocol definition for Linux Bluetooth stack (BlueZ). - Copyright (C) 2002-2003 Maxim Krasnyansky - Copyright (C) 2002-2003 Marcel Holtmann - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -33,22 +35,22 @@ extern "C" { #endif /* RFCOMM defaults */ -#define RFCOMM_DEFAULT_MTU 127 +#define RFCOMM_DEFAULT_MTU 127 #define RFCOMM_PSM 3 -#define RFCOMM_CONN_TIMEOUT (HZ * 30) -#define RFCOMM_DISC_TIMEOUT (HZ * 20) +#define RFCOMM_CONN_TIMEOUT (HZ * 30) +#define RFCOMM_DISC_TIMEOUT (HZ * 20) /* RFCOMM socket address */ struct sockaddr_rc { - sa_family_t rc_family; - bdaddr_t rc_bdaddr; - uint8_t rc_channel; + sa_family_t rc_family; + bdaddr_t rc_bdaddr; + uint8_t rc_channel; }; /* RFCOMM TTY support */ -#define RFCOMM_MAX_DEV 256 +#define RFCOMM_MAX_DEV 256 #define RFCOMMCREATEDEV _IOW('R', 200, int) #define RFCOMMRELEASEDEV _IOW('R', 201, int) @@ -56,29 +58,29 @@ struct sockaddr_rc { #define RFCOMMGETDEVINFO _IOR('R', 211, int) struct rfcomm_dev_req { - int16_t dev_id; - uint32_t flags; - bdaddr_t src; - bdaddr_t dst; - uint8_t channel; + int16_t dev_id; + uint32_t flags; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; -#define RFCOMM_REUSE_DLC 0 -#define RFCOMM_RELEASE_ONHUP 1 -#define RFCOMM_HANGUP_NOW 2 -#define RFCOMM_TTY_ATTACHED 3 +#define RFCOMM_REUSE_DLC 0 +#define RFCOMM_RELEASE_ONHUP 1 +#define RFCOMM_HANGUP_NOW 2 +#define RFCOMM_TTY_ATTACHED 3 struct rfcomm_dev_info { - int16_t id; - uint32_t flags; - uint16_t state; - bdaddr_t src; - bdaddr_t dst; - uint8_t channel; + int16_t id; + uint32_t flags; + uint16_t state; + bdaddr_t src; + bdaddr_t dst; + uint8_t channel; }; struct rfcomm_dev_list_req { - uint16_t dev_num; - struct rfcomm_dev_info dev_info[0]; + uint16_t dev_num; + struct rfcomm_dev_info dev_info[0]; }; #ifdef __cplusplus diff --git a/include/sco.h b/include/sco.h index d8bc54b6..0d0ac123 100644 --- a/include/sco.h +++ b/include/sco.h @@ -1,28 +1,29 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ @@ -38,7 +39,7 @@ extern "C" { #define SCO_DEFAULT_FLUSH_TO 0xFFFF #define SCO_CONN_TIMEOUT (HZ * 40) -#define SCO_DISCONN_TIMEOUT (HZ * 2) +#define SCO_DISCONN_TIMEOUT (HZ * 2) #define SCO_CONN_IDLE_TIMEOUT (HZ * 60) /* SCO socket address */ diff --git a/include/sdp.h b/include/sdp.h index 77564850..13205b9b 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -1,34 +1,40 @@ /* - Service Discovery Protocol (SDP) - Copyright (C) 2002 Maxim Krasnyansky - - Based on original SDP implementation by Nokia Corporation. - Copyright (C) 2001,2002 Nokia Corporation. - Original author Guruprasad Krishnamurthy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. -*/ - -/* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2001-2002 Nokia Corporation + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2003 Stephen Crane + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ -#ifndef SDP_H -#define SDP_H +#ifndef __SDP_H +#define __SDP_H + +#ifdef __cplusplus +extern "C" { +#endif #include @@ -393,4 +399,8 @@ typedef struct { uint16_t tid; // Current transaction ID } sdp_session_t; +#ifdef __cplusplus +} #endif + +#endif /* __SDP_H */ diff --git a/include/sdp_internal.h b/include/sdp_internal.h index fabf7a0d..defc300a 100644 --- a/include/sdp_internal.h +++ b/include/sdp_internal.h @@ -1,34 +1,40 @@ /* - Service Discovery Protocol (SDP) - Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane - - Based on original SDP implementation by Nokia Corporation. - Copyright (C) 2001,2002 Nokia Corporation. - Original author Guruprasad Krishnamurthy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. -*/ - -/* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2001-2002 Nokia Corporation + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2003 Stephen Crane + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ -#ifndef SDP_INTERNAL_H -#define SDP_INTERNAL_H +#ifndef __SDP_INTERNAL_H +#define __SDP_INTERNAL_H + +#ifdef __cplusplus +extern "C" { +#endif #include #include @@ -142,16 +148,16 @@ static inline unsigned long long __sdp_get_unaligned(const void *ptr, size_t siz { unsigned long long val = 0; switch (size) { - case 1: + case 1: val = *(const unsigned char *)ptr; break; - case 2: + case 2: val = __uldw((const unsigned short *)ptr); break; - case 4: + case 4: val = __uldl((const unsigned int *)ptr); break; - case 8: + case 8: val = __uldq((const unsigned long *)ptr); break; } @@ -163,7 +169,7 @@ static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size switch (size) { case 1: *(unsigned char *)ptr = (val); - break; + break; case 2: __ustw(val, (unsigned short *)ptr); break; @@ -177,10 +183,10 @@ static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size } #define sdp_get_unaligned(ptr) \ - ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) + ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) #define sdp_put_unaligned(x,ptr) \ - __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) + __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) #endif @@ -189,7 +195,7 @@ static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size static inline void ntoh128(uint128_t *src, uint128_t *dst) { int i; - for (i=0; i < 16; i++) + for (i = 0; i < 16; i++) dst->data[i] = src->data[i]; } #else @@ -205,7 +211,7 @@ static inline uint64_t ntoh64(uint64_t n) static inline void ntoh128(uint128_t *src, uint128_t *dst) { int i; - for (i=0; i < 16; i++) + for (i = 0; i < 16; i++) dst->data[15 - i] = src->data[i]; } #endif @@ -213,4 +219,8 @@ static inline void ntoh128(uint128_t *src, uint128_t *dst) #define hton64(x) ntoh64(x) #define hton128(x,y) ntoh128(x,y) +#ifdef __cplusplus +} #endif + +#endif /* __SDP_INTERNAL_H */ diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 763f80fa..d2753912 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -1,34 +1,36 @@ /* - Service Discovery Protocol (SDP) - Copyright (C) 2002 Maxim Krasnyansky , Stephen Crane - - Based on original SDP implementation by Nokia Corporation. - Copyright (C) 2001,2002 Nokia Corporation. - Original author Guruprasad Krishnamurthy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY CLAIM, - OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER - RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE - USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, COPYRIGHTS, - TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS SOFTWARE IS DISCLAIMED. - */ - -/* - * $Id$ - */ - -#ifndef SDP_LIB_H -#define SDP_LIB_H + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2001-2002 Nokia Corporation + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2003 Stephen Crane + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ + */ + +#ifndef __SDP_LIB_H +#define __SDP_LIB_H #include #include @@ -494,36 +496,36 @@ int sdp_get_database_state(const sdp_record_t *rec, uint32_t *svcDBState); static inline int sdp_get_service_name(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_SVCNAME_PRIMARY, str, len); } static inline int sdp_get_service_desc(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_SVCDESC_PRIMARY, str, len); } static inline int sdp_get_provider_name(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_PROVNAME_PRIMARY, str, len); } static inline int sdp_get_doc_url(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_DOC_URL, str, len); } static inline int sdp_get_clnt_exec_url(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_CLNT_EXEC_URL, str, len); } static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) { - return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); + return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } #ifdef __cplusplus } #endif -#endif +#endif /* __SDP_LIB_H */ diff --git a/src/bluetooth.c b/src/bluetooth.c index a57809d7..61a632a5 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -1,31 +1,37 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * * $Id$ */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -37,10 +43,10 @@ void baswap(bdaddr_t *dst, const bdaddr_t *src) { - register unsigned char *d = (unsigned char *)dst; - register const unsigned char *s = (const unsigned char *)src; + register unsigned char *d = (unsigned char *) dst; + register const unsigned char *s = (const unsigned char *) src; register int i; - for(i=0; i<6; i++) + for (i = 0; i < 6; i++) d[i] = s[5-i]; } @@ -51,7 +57,7 @@ char *batostr(const bdaddr_t *ba) return NULL; sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", - ba->b[0], ba->b[1], ba->b[2], + ba->b[0], ba->b[1], ba->b[2], ba->b[3], ba->b[4], ba->b[5]); return str; } @@ -65,9 +71,9 @@ bdaddr_t *strtoba(const char *str) if (!ba) return NULL; - for(i=0; i<6; i++){ + for(i = 0; i < 6; i++) { ba[i] = (uint8_t) strtol(ptr, NULL, 16); - if( i!=5 && !(ptr=strchr(ptr,':')) ) + if (i != 5 && !(ptr = strchr(ptr,':'))) ptr = ":00:00:00:00:00"; ptr++; } @@ -78,9 +84,9 @@ int ba2str(const bdaddr_t *ba, char *str) { uint8_t b[6]; - baswap((bdaddr_t *)b, ba); + baswap((bdaddr_t *) b, ba); return sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X", - b[0], b[1], b[2], b[3], b[4], b[5]); + b[0], b[1], b[2], b[3], b[4], b[5]); } int str2ba(const char *str, bdaddr_t *ba) @@ -89,13 +95,13 @@ int str2ba(const char *str, bdaddr_t *ba) const char *ptr = str; int i; - for (i=0; i < 6; i++) { + for (i = 0; i < 6; i++) { b[i] = (uint8_t) strtol(ptr, NULL, 16); - if (i!=5 && !(ptr=strchr(ptr, ':'))) + if (i != 5 && !(ptr = strchr(ptr, ':'))) ptr = ":00:00:00:00:00"; ptr++; } - baswap(ba, (bdaddr_t *)b); + baswap(ba, (bdaddr_t *) b); return 0; } diff --git a/src/hci.c b/src/hci.c index 1530f395..e2184cbb 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1,30 +1,37 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2000-2001 Qualcomm Incorporated + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ + +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -64,7 +71,7 @@ static char *hci_bit2str(hci_map *m, unsigned int val) if ((unsigned int) m->val & val) ptr += sprintf(ptr, "%s ", m->str); m++; - } + } return str; } @@ -79,14 +86,14 @@ static int hci_str2bit(hci_map *map, char *str, unsigned int *val) *val = set = 0; - while ((t=strsep(&ptr, ","))) { - for (m=map; m->str; m++) { - if (!strcasecmp(m->str,t)) { + while ((t = strsep(&ptr, ","))) { + for (m = map; m->str; m++) { + if (!strcasecmp(m->str, t)) { *val |= (unsigned int) m->val; set = 1; } } - } + } free(str); return set; @@ -107,7 +114,7 @@ static char *hci_uint2str(hci_map *m, unsigned int val) break; } m++; - } + } return str; } @@ -122,14 +129,14 @@ static int hci_str2uint(hci_map *map, char *str, unsigned int *val) str = ptr = strdup(str); - while ((t=strsep(&ptr, ","))) { - for (m=map; m->str; m++) { + while ((t = strsep(&ptr, ","))) { + for (m = map; m->str; m++) { if (!strcasecmp(m->str,t)) { *val = (unsigned int) m->val; set = 1; break; } } - } + } free(str); return set; @@ -156,7 +163,7 @@ char *hci_dtypetostr(int type) } /* HCI dev flags mapping */ -hci_map dev_flags_map[] = { +static hci_map dev_flags_map[] = { { "UP", HCI_UP }, { "INIT", HCI_INIT }, { "RUNNING", HCI_RUNNING }, @@ -168,6 +175,7 @@ hci_map dev_flags_map[] = { { "ENCRYPT", HCI_ENCRYPT }, { NULL } }; + char *hci_dflagstostr(uint32_t flags) { char *str = malloc(50); @@ -191,7 +199,7 @@ char *hci_dflagstostr(uint32_t flags) } /* HCI packet type mapping */ -hci_map pkt_type_map[] = { +static hci_map pkt_type_map[] = { { "DM1", HCI_DM1 }, { "DM3", HCI_DM3 }, { "DM5", HCI_DM5 }, @@ -203,17 +211,19 @@ hci_map pkt_type_map[] = { { "HV3", HCI_HV3 }, { NULL } }; + char *hci_ptypetostr(unsigned int ptype) { return hci_bit2str(pkt_type_map, ptype); } + int hci_strtoptype(char *str, unsigned int *val) { return hci_str2bit(pkt_type_map, str, val); } /* Link policy mapping */ -hci_map link_policy_map[] = { +static hci_map link_policy_map[] = { { "NONE", 0 }, { "RSWITCH", HCI_LP_RSWITCH }, { "HOLD", HCI_LP_HOLD }, @@ -221,17 +231,19 @@ hci_map link_policy_map[] = { { "PARK", HCI_LP_PARK }, { NULL } }; + char *hci_lptostr(unsigned int lp) { return hci_bit2str(link_policy_map, lp); } + int hci_strtolp(char *str, unsigned int *val) { return hci_str2bit(link_policy_map, str, val); } /* Link mode mapping */ -hci_map link_mode_map[] = { +static hci_map link_mode_map[] = { { "NONE", 0 }, { "ACCEPT", HCI_LM_ACCEPT }, { "MASTER", HCI_LM_MASTER }, @@ -240,6 +252,7 @@ hci_map link_mode_map[] = { { "TRUSTED", HCI_LM_TRUSTED}, { NULL } }; + char *hci_lmtostr(unsigned int lm) { char *s, *str = malloc(50); @@ -260,23 +273,26 @@ char *hci_lmtostr(unsigned int lm) free(s); return str; } + int hci_strtolm(char *str, unsigned int *val) { return hci_str2bit(link_mode_map, str, val); } /* Version mapping */ -hci_map ver_map[] = { +static hci_map ver_map[] = { { "1.0b", 0x00 }, { "1.1", 0x01 }, { "1.2", 0x02 }, { NULL } }; + char *hci_vertostr(unsigned int ver) { char *str = hci_uint2str(ver_map, ver); return *str ? str : "n/a"; } + int hci_strtover(char *str, unsigned int *ver) { return hci_str2uint(ver_map, str, ver); @@ -287,13 +303,14 @@ char *lmp_vertostr(unsigned int ver) char *str = hci_uint2str(ver_map, ver); return *str ? str : "n/a"; } + int lmp_strtover(char *str, unsigned int *ver) { return hci_str2uint(ver_map, str, ver); } /* LMP features mapping */ -hci_map lmp_features_map[8][9] = { +static hci_map lmp_features_map[8][9] = { { /* byte 0 */ { "<3-slot packets>", LMP_3SLOT }, { "<5-slot packets>", LMP_5SLOT }, @@ -341,7 +358,7 @@ hci_map lmp_features_map[8][9] = { }, { /* byte 5 */ { "", LMP_AFH_CAP_MST }, - { "",LMP_AFH_CLS_MST }, + { "",LMP_AFH_CLS_MST }, { NULL } }, { /* byte 6 */ @@ -366,7 +383,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) if (pref) ptr += sprintf(ptr, "%s", pref); - for(i=0, w=0; i<8; i++) { + for (i = 0, w = 0; i < 8; i++) { hci_map *m; m = lmp_features_map[i]; @@ -386,7 +403,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) /* HCI functions that do not require open device */ -int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg) +int hci_for_each_dev(int flag, int (*func)(int s, int dev_id, long arg), long arg) { struct hci_dev_list_req *dl; struct hci_dev_req *dr; @@ -402,13 +419,13 @@ int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg close(s); return -1; } - + dl->dev_num = HCI_MAX_DEV; dr = dl->dev_req; if (ioctl(s, HCIGETDEVLIST, (void *)dl)) goto done; - + for (i=0; i < dl->dev_num; i++, dr++) { if (hci_test_bit(flag, &dr->dev_opt)) if (!func || func(s, dr->dev_id, arg)) { @@ -417,7 +434,7 @@ int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg } } -done: +done: close(s); free(dl); return dev_id; @@ -426,17 +443,17 @@ done: static int __other_bdaddr(int s, int dev_id, long arg) { struct hci_dev_info di = {dev_id: dev_id}; - if (ioctl(s, HCIGETDEVINFO, (void*) &di)) + if (ioctl(s, HCIGETDEVINFO, (void *) &di)) return 0; - return bacmp((bdaddr_t *)arg, &di.bdaddr); + return bacmp((bdaddr_t *) arg, &di.bdaddr); } static int __same_bdaddr(int s, int dev_id, long arg) { struct hci_dev_info di = {dev_id: dev_id}; - if (ioctl(s, HCIGETDEVINFO, (void*) &di)) + if (ioctl(s, HCIGETDEVINFO, (void *) &di)) return 0; - return !bacmp((bdaddr_t *)arg, &di.bdaddr); + return !bacmp((bdaddr_t *) arg, &di.bdaddr); } int hci_get_route(bdaddr_t *bdaddr) @@ -502,7 +519,7 @@ int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info int s, err; if (nrsp <= 0) - nrsp = 200; // enough ? + nrsp = 200; /* enough ? */ if (dev_id < 0 && (dev_id = hci_get_route(NULL)) < 0) { errno = ENODEV; @@ -563,11 +580,11 @@ int hci_open_dev(int dev_id) dd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (dd < 0) return dd; - + /* Bind socket to the HCI device */ a.hci_family = AF_BLUETOOTH; a.hci_dev = dev_id; - if (bind(dd, (struct sockaddr *)&a, sizeof(a)) < 0) + if (bind(dd, (struct sockaddr *) &a, sizeof(a)) < 0) goto failed; return dd; @@ -645,7 +662,7 @@ int hci_send_req(int dd, struct hci_request *r, int to) while (try--) { evt_cmd_complete *cc; evt_cmd_status *cs; - + if (to) { struct pollfd p; int n; @@ -661,7 +678,7 @@ int hci_send_req(int dd, struct hci_request *r, int to) errno = ETIMEDOUT; goto failed; } - + to -= 10; if (to < 0) to = 0; @@ -673,17 +690,17 @@ int hci_send_req(int dd, struct hci_request *r, int to) goto failed; } - hdr = (void *)(buf + 1); + hdr = (void *) (buf + 1); ptr = buf + (1 + HCI_EVENT_HDR_SIZE); len -= (1 + HCI_EVENT_HDR_SIZE); switch (hdr->evt) { case EVT_CMD_STATUS: - cs = (void *)ptr; - + cs = (void *) ptr; + if (cs->opcode != opcode) continue; - + if (cs->status) { errno = EIO; goto failed; @@ -691,11 +708,11 @@ int hci_send_req(int dd, struct hci_request *r, int to) break; case EVT_CMD_COMPLETE: - cc = (void *)ptr; + cc = (void *) ptr; if (cc->opcode != opcode) continue; - + ptr += EVT_CMD_COMPLETE_SIZE; len -= EVT_CMD_COMPLETE_SIZE; @@ -706,7 +723,7 @@ int hci_send_req(int dd, struct hci_request *r, int to) default: if (hdr->evt != r->event) break; - + r->rlen = MIN(len, r->rlen); memcpy(r->rparam, ptr, r->rlen); goto done; @@ -994,21 +1011,21 @@ int hci_read_class_of_dev(int dd, uint8_t *cls, int to) { read_class_of_dev_rp rp; struct hci_request rq; - + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_READ_CLASS_OF_DEV; rq.rparam = &rp; rq.rlen = READ_CLASS_OF_DEV_RP_SIZE; - + if (hci_send_req(dd, &rq, to) < 0) return -1; - + if (rp.status) { errno = EIO; return -1; } - + memcpy(cls, rp.dev_class, 3); return 0; } @@ -1070,7 +1087,7 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to) { read_current_iac_lap_rp rp; struct hci_request rq; - + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_READ_CURRENT_IAC_LAP; @@ -1094,11 +1111,11 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) { write_current_iac_lap_cp cp; struct hci_request rq; - + memset(&cp, 0, sizeof(cp)); cp.num_current_iac = num_iac; memcpy(&cp.lap, lap, num_iac * 3); - + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; diff --git a/src/sdp.c b/src/sdp.c index cbc68193..6740e9d6 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1,35 +1,38 @@ -/* - BlueZ - Bluetooth protocol stack for Linux - Copyright (C) 2000-2001 Qualcomm Incorporated - - Written 2000,2001 by Maxim Krasnyansky - - Based on an original SDP implementation by Nokia Corporation. - Copyright (C) 2001,2002 Nokia Corporation. - Original author Guruprasad Krishnamurthy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 as - published by the Free Software Foundation; - - 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - SOFTWARE IS DISCLAIMED. -*/ - /* - * $Id$ + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2001-2002 Nokia Corporation + * Copyright (C) 2002-2003 Maxim Krasnyansky + * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2003 Stephen Crane + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include -- cgit From 708758a0b94a2cbe2f1ffb061ff934f140fdacb7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 05:13:53 +0000 Subject: Use automake config header feature --- bootstrap | 2 +- configure.in | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bootstrap b/bootstrap index 019a160f..c9042454 100755 --- a/bootstrap +++ b/bootstrap @@ -1,2 +1,2 @@ #! /bin/sh -aclocal && automake --copy --add-missing && autoconf +aclocal && autoheader && automake --copy --add-missing && autoconf diff --git a/configure.in b/configure.in index 3176b1dc..9059aaf6 100644 --- a/configure.in +++ b/configure.in @@ -1,13 +1,12 @@ dnl dnl $Id$ dnl -dnl Process this file with autoconf to produce a configure script. -dnl AC_PREREQ(2.50) AC_INIT() AM_INIT_AUTOMAKE(bluez-libs, 2.6) +AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From db3ac6f0370159237530248efa79557c2cd98499 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 05:57:41 +0000 Subject: Don't install sdp_internal.h --- include/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/Makefile.am b/include/Makefile.am index ec8835a2..bdb5e939 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,9 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h sdp_internal.h bnep.h cmtp.h +include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h + +noinst_HEADERS = sdp_internal.h all-local: -- cgit From ee63ac598e56142ba513729d6b69df04d233d186 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 08:25:58 +0000 Subject: Add support for unaligned access --- include/bluetooth.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 8690f456..3dc4b245 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -86,6 +86,19 @@ enum { #error "Unknown byte order" #endif +/* Bluetooth unaligned access */ +#if defined(__i386__) +#define bt_get_unaligned(ptr) (*(ptr)) +#define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) +#else +#define bt_get_unaligned(ptr) \ + ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) +#define bt_put_unaligned(val, ptr) \ + ({ __typeof__(*(ptr)) __tmp = (val); \ + memcpy((ptr), &__tmp, sizeof(*(ptr))); \ + (void)0; }) +#endif + /* BD Address */ typedef struct { uint8_t b[6]; -- cgit From 4f6e2df58332458dd32f62fe452a99114c7d85d0 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 3 Apr 2004 09:21:06 +0000 Subject: Move some internal functions to public --- include/sdp_internal.h | 38 -------------------------------------- include/sdp_lib.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/include/sdp_internal.h b/include/sdp_internal.h index defc300a..5d6ed7f9 100644 --- a/include/sdp_internal.h +++ b/include/sdp_internal.h @@ -55,44 +55,6 @@ extern "C" { #define SDP_UUID_SEQ_SIZE 256 #define SDP_MAX_ATTR_LEN 65535 -/* - * Generate unique transaction identifiers - */ -static inline uint16_t sdp_gen_tid(sdp_session_t *session) -{ - return session->tid++; -} - -sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); -sdp_data_t *sdp_extract_string(char *, int *); - -void sdp_data_print(sdp_data_t *data); -void sdp_print_service_attr(sdp_list_t *alist); - -int sdp_attrid_comp_func(const void *key1, const void *key2); - -void sdp_set_seq_len(char *ptr, int length); -void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); -void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); -void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); - -int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); -int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); - -int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); - -sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); - -void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); -void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); - -int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); - -typedef struct { - uint8_t length; - unsigned char data[16]; -} __attribute__ ((packed)) sdp_cstate_t; - /* * SDP unaligned access. * based on linux/asm-/unaligned.h diff --git a/include/sdp_lib.h b/include/sdp_lib.h index d2753912..715f98cf 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -524,6 +524,44 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } +/* + * Generate unique transaction identifiers + */ +static inline uint16_t sdp_gen_tid(sdp_session_t *session) +{ + return session->tid++; +} + +sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); +sdp_data_t *sdp_extract_string(char *, int *); + +void sdp_data_print(sdp_data_t *data); +void sdp_print_service_attr(sdp_list_t *alist); + +int sdp_attrid_comp_func(const void *key1, const void *key2); + +void sdp_set_seq_len(char *ptr, int length); +void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); +void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); +void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); + +int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); +int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); + +int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); + +sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); + +void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); +void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); + +int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); + +typedef struct { + uint8_t length; + unsigned char data[16]; +} __attribute__ ((packed)) sdp_cstate_t; + #ifdef __cplusplus } #endif -- cgit From 40f6099fd4ffe323a369dd63652570404f4ddc02 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 24 Apr 2004 11:40:10 +0000 Subject: Add bit numbers to the features table --- src/hci.c | 82 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/src/hci.c b/src/hci.c index e2184cbb..2c19b78d 100644 --- a/src/hci.c +++ b/src/hci.c @@ -311,61 +311,61 @@ int lmp_strtover(char *str, unsigned int *ver) /* LMP features mapping */ static hci_map lmp_features_map[8][9] = { - { /* byte 0 */ - { "<3-slot packets>", LMP_3SLOT }, - { "<5-slot packets>", LMP_5SLOT }, - { "", LMP_ENCRYPT }, - { "", LMP_SOFFSET }, - { "", LMP_TACCURACY }, - { "", LMP_RSWITCH }, - { "", LMP_HOLD }, - { "", LMP_SNIFF }, + { /* Byte 0 */ + { "<3-slot packets>", LMP_3SLOT }, /* Bit 0 */ + { "<5-slot packets>", LMP_5SLOT }, /* Bit 1 */ + { "", LMP_ENCRYPT }, /* Bit 2 */ + { "", LMP_SOFFSET }, /* Bit 3 */ + { "", LMP_TACCURACY }, /* Bit 4 */ + { "", LMP_RSWITCH }, /* Bit 5 */ + { "", LMP_HOLD }, /* Bit 6 */ + { "", LMP_SNIFF }, /* Bit 7 */ { NULL } }, - { /* byte 1 */ - { "", LMP_PARK }, - { "", LMP_RSSI }, - { "", LMP_QUALITY }, - { "", LMP_SCO }, - { "", LMP_HV2 }, - { "", LMP_HV3 }, - { "", LMP_ULAW }, - { "", LMP_ALAW }, + { /* Byte 1 */ + { "", LMP_PARK }, /* Bit 0 */ + { "", LMP_RSSI }, /* Bit 1 */ + { "", LMP_QUALITY }, /* Bit 2 */ + { "", LMP_SCO }, /* Bit 3 */ + { "", LMP_HV2 }, /* Bit 4 */ + { "", LMP_HV3 }, /* Bit 5 */ + { "", LMP_ULAW }, /* Bit 6 */ + { "", LMP_ALAW }, /* Bit 7 */ { NULL } }, - { /* byte 2 */ - { "", LMP_CVSD }, - { "", LMP_PSCHEME }, - { "", LMP_PCONTROL }, - { "", LMP_TRSP_SCO }, - { "",LMP_BCAST_ENC }, + { /* Byte 2 */ + { "", LMP_CVSD }, /* Bit 0 */ + { "", LMP_PSCHEME }, /* Bit 1 */ + { "", LMP_PCONTROL }, /* Bit 2 */ + { "", LMP_TRSP_SCO }, /* Bit 3 */ + { "",LMP_BCAST_ENC }, /* Bit 7 */ { NULL } }, - { /* byte 3 */ - { "", LMP_ENH_ISCAN }, - { "", LMP_ILACE_ISCAN }, - { "", LMP_ILACE_PSCAN }, - { "",LMP_RSSI_INQ }, - { "", LMP_ESCO }, + { /* Byte 3 */ + { "", LMP_ENH_ISCAN }, /* Bit 3 */ + { "", LMP_ILACE_ISCAN }, /* Bit 4 */ + { "", LMP_ILACE_PSCAN }, /* Bit 5 */ + { "",LMP_RSSI_INQ }, /* Bit 6 */ + { "", LMP_ESCO }, /* Bit 7 */ { NULL } }, - { /* byte 4 */ - { "", LMP_EV4 }, - { "", LMP_EV5 }, - { "", LMP_AFH_CAP_SLV }, - { "", LMP_AFH_CLS_SLV }, + { /* Byte 4 */ + { "", LMP_EV4 }, /* Bit 0 */ + { "", LMP_EV5 }, /* Bit 1 */ + { "", LMP_AFH_CAP_SLV }, /* Bit 3 */ + { "", LMP_AFH_CLS_SLV }, /* Bit 4 */ { NULL } }, - { /* byte 5 */ - { "", LMP_AFH_CAP_MST }, - { "",LMP_AFH_CLS_MST }, + { /* Byte 5 */ + { "", LMP_AFH_CAP_MST }, /* Bit 3 */ + { "",LMP_AFH_CLS_MST }, /* Bit 4 */ { NULL } }, - { /* byte 6 */ + { /* Byte 6 */ { NULL } }, - { /* byte 7 */ - { "",LMP_EXT_FEAT }, + { /* Byte 7 */ + { "",LMP_EXT_FEAT }, /* Bit 7 */ { NULL } }, }; -- cgit From 6caf64335ab07e1bd138e11a1823ba9baa209fef Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 24 Apr 2004 12:09:53 +0000 Subject: Add features and packet types from EDR prototyping specification --- include/hci.h | 33 +++++++++++++++++++++++++++------ include/hci_lib.h | 2 ++ src/hci.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a/include/hci.h b/include/hci.h index fc57bbca..ce5080ef 100644 --- a/include/hci.h +++ b/include/hci.h @@ -112,17 +112,31 @@ enum { #define HCI_UNKNOWN_PKT 0xff /* HCI Packet types */ -#define HCI_DM1 0x0008 -#define HCI_DM3 0x0400 -#define HCI_DM5 0x4000 -#define HCI_DH1 0x0010 -#define HCI_DH3 0x0800 -#define HCI_DH5 0x8000 +#define HCI_2DH1 0x0002 +#define HCI_3DH1 0x0004 +#define HCI_DM1 0x0008 +#define HCI_DH1 0x0010 +#define HCI_2DH3 0x0100 +#define HCI_3DH3 0x0200 +#define HCI_DM3 0x0400 +#define HCI_DH3 0x0800 +#define HCI_2DH5 0x1000 +#define HCI_3DH5 0x2000 +#define HCI_DM5 0x4000 +#define HCI_DH5 0x8000 #define HCI_HV1 0x0020 #define HCI_HV2 0x0040 #define HCI_HV3 0x0080 +#define HCI_EV3 0x0008 +#define HCI_EV4 0x0010 +#define HCI_EV5 0x0020 +#define HCI_2EV3 0x0040 +#define HCI_3EV3 0x0080 +#define HCI_2EV5 0x0100 +#define HCI_3EV5 0x0200 + #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) @@ -204,6 +218,8 @@ enum { #define LMP_TRSP_SCO 0x08 #define LMP_BCAST_ENC 0x80 +#define LMP_EDR_ACL_2M 0x02 +#define LMP_EDR_ACL_3M 0x04 #define LMP_ENH_ISCAN 0x08 #define LMP_ILACE_ISCAN 0x10 #define LMP_ILACE_PSCAN 0x20 @@ -214,9 +230,14 @@ enum { #define LMP_EV5 0x02 #define LMP_AFH_CAP_SLV 0x08 #define LMP_AFH_CLS_SLV 0x10 +#define LMP_EDR_3SLOT 0x80 +#define LMP_EDR_5SLOT 0x01 #define LMP_AFH_CAP_MST 0x08 #define LMP_AFH_CLS_MST 0x10 +#define LMP_EDR_ESCO_2M 0x20 +#define LMP_EDR_ESCO_3M 0x40 +#define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_FEAT 0x80 diff --git a/include/hci_lib.h b/include/hci_lib.h index e048375e..70d39264 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -96,6 +96,8 @@ char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); int hci_strtoptype(char *str, unsigned int *val); +char *hci_scoptypetostr(unsigned int ptype); +int hci_strtoscoptype(char *str, unsigned int *val); char *hci_lptostr(unsigned int ptype); int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); diff --git a/src/hci.c b/src/hci.c index 2c19b78d..f1e278cb 100644 --- a/src/hci.c +++ b/src/hci.c @@ -200,15 +200,35 @@ char *hci_dflagstostr(uint32_t flags) /* HCI packet type mapping */ static hci_map pkt_type_map[] = { - { "DM1", HCI_DM1 }, - { "DM3", HCI_DM3 }, - { "DM5", HCI_DM5 }, - { "DH1", HCI_DH1 }, - { "DH3", HCI_DH3 }, - { "DH5", HCI_DH5 }, - { "HV1", HCI_HV1 }, - { "HV2", HCI_HV2 }, - { "HV3", HCI_HV3 }, + { "DM1", HCI_DM1 }, + { "DM3", HCI_DM3 }, + { "DM5", HCI_DM5 }, + { "DH1", HCI_DH1 }, + { "DH3", HCI_DH3 }, + { "DH5", HCI_DH5 }, + { "HV1", HCI_HV1 }, + { "HV2", HCI_HV2 }, + { "HV3", HCI_HV3 }, + { "2-DH1", HCI_2DH1 }, + { "2-DH3", HCI_2DH3 }, + { "2-DH5", HCI_2DH5 }, + { "3-DH1", HCI_3DH1 }, + { "3-DH3", HCI_3DH3 }, + { "3-DH5", HCI_3DH5 }, + { NULL } +}; + +static hci_map sco_ptype_map[] = { + { "HV1", 0x0001 }, + { "HV2", 0x0002 }, + { "HV3", 0x0004 }, + { "EV3", HCI_EV3 }, + { "EV4", HCI_EV4 }, + { "EV5", HCI_EV5 }, + { "2-EV3", HCI_2EV3 }, + { "2-EV5", HCI_2EV5 }, + { "3-EV3", HCI_3EV3 }, + { "3-EV5", HCI_3EV5 }, { NULL } }; @@ -222,6 +242,16 @@ int hci_strtoptype(char *str, unsigned int *val) return hci_str2bit(pkt_type_map, str, val); } +char *hci_scoptypetostr(unsigned int ptype) +{ + return hci_bit2str(sco_ptype_map, ptype); +} + +int hci_strtoscoptype(char *str, unsigned int *val) +{ + return hci_str2bit(sco_ptype_map, str, val); +} + /* Link policy mapping */ static hci_map link_policy_map[] = { { "NONE", 0 }, @@ -342,6 +372,8 @@ static hci_map lmp_features_map[8][9] = { { NULL } }, { /* Byte 3 */ + { "", LMP_EDR_ACL_2M }, /* Bit 1 */ + { "", LMP_EDR_ACL_3M }, /* Bit 2 */ { "", LMP_ENH_ISCAN }, /* Bit 3 */ { "", LMP_ILACE_ISCAN }, /* Bit 4 */ { "", LMP_ILACE_PSCAN }, /* Bit 5 */ @@ -354,11 +386,16 @@ static hci_map lmp_features_map[8][9] = { { "", LMP_EV5 }, /* Bit 1 */ { "", LMP_AFH_CAP_SLV }, /* Bit 3 */ { "", LMP_AFH_CLS_SLV }, /* Bit 4 */ + { "<3-slot EDR ACL>", LMP_EDR_3SLOT }, /* Bit 7 */ { NULL } }, { /* Byte 5 */ + { "<5-slot EDR ACL>", LMP_EDR_5SLOT }, /* Bit 0 */ { "", LMP_AFH_CAP_MST }, /* Bit 3 */ { "",LMP_AFH_CLS_MST }, /* Bit 4 */ + { "", LMP_EDR_ESCO_2M }, /* Bit 5 */ + { "", LMP_EDR_ESCO_3M }, /* Bit 6 */ + { "<3-slot EDR eSCO>", LMP_EDR_3S_ESCO }, /* Bit 7 */ { NULL } }, { /* Byte 6 */ -- cgit From 9717723fd7bdc64648c258967911d0932248cf1f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 14:10:03 +0000 Subject: Better display of decoded LMP features --- src/hci.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hci.c b/src/hci.c index f1e278cb..5acbe7cd 100644 --- a/src/hci.c +++ b/src/hci.c @@ -409,8 +409,8 @@ static hci_map lmp_features_map[8][9] = { char *lmp_featurestostr(uint8_t *features, char *pref, int width) { - char *ptr, *str = malloc(400); - int i, w; + char *off, *ptr, *str = malloc(400); + int i; if (!str) return NULL; @@ -420,16 +420,19 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) if (pref) ptr += sprintf(ptr, "%s", pref); - for (i = 0, w = 0; i < 8; i++) { + off = ptr; + + for (i = 0; i < 8; i++) { hci_map *m; m = lmp_features_map[i]; while (m->str) { if ((unsigned int) m->val & (unsigned int) features[i]) { - ptr += sprintf(ptr, "%s ", m->str); - w = (w + 1) & width; - if (!w) + if (strlen(off) + strlen(m->str) > width - 1) { ptr += sprintf(ptr, "\n%s", pref ? pref : ""); + off = ptr; + } + ptr += sprintf(ptr, "%s ", m->str); } m++; } -- cgit From 4b647efc5c26a0aedfd43fcc7914d31d5bf3799d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 15:07:23 +0000 Subject: Add support for inquiry_mode and inquiry_info_with_rssi --- include/hci.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/hci.h b/include/hci.h index ce5080ef..1b46cec7 100644 --- a/include/hci.h +++ b/include/hci.h @@ -674,6 +674,23 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_READ_INQUIRY_MODE 0x0044 +typedef struct { + uint8_t status; + uint8_t mode; +} __attribute__ ((packed)) read_inquiry_mode_rp; +#define READ_INQUIRY_MODE_RP_SIZE 2 + +#define OCF_WRITE_INQUIRY_MODE 0x0045 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_inquiry_mode_cp; +#define WRITE_INQUIRY_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_inquiry_mode_rp; +#define WRITE_INQUIRY_MODE_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -921,6 +938,17 @@ typedef struct { } __attribute__ ((packed)) evt_qos_violation; #define EVT_QOS_VIOLATION_SIZE 2 +#define EVT_INQUIRY_RESULT_WITH_RSSI 0x02 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; + uint8_t rssi; +} __attribute__ ((packed)) inquiry_info_with_rssi; +#define INQUIRY_INFO_WITH_RSSI_SIZE 14 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From cf128e135d9f8e6f5e2c1b24539a5ca1950cec7f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 15:31:49 +0000 Subject: Add extra comment --- include/cmtp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/cmtp.h b/include/cmtp.h index 0883556f..f0981f2d 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -33,6 +33,7 @@ extern "C" { #endif +/* CMTP defaults */ #define CMTP_MINIMUM_MTU 152 #define CMTP_DEFAULT_MTU 672 -- cgit From 8b9071e009bb469a12095ae83178567d30e9177b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 15:34:37 +0000 Subject: Add HIDP header file --- include/Makefile.am | 4 ++- include/hidp.h | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 include/hidp.h diff --git a/include/Makefile.am b/include/Makefile.am index bdb5e939..cbde42bf 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,7 +4,9 @@ includedir = @includedir@/bluetooth -include_HEADERS = bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h +include_HEADERS = \ + bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h \ + l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h noinst_HEADERS = sdp_internal.h diff --git a/include/hidp.h b/include/hidp.h new file mode 100644 index 00000000..f374b9e8 --- /dev/null +++ b/include/hidp.h @@ -0,0 +1,84 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2003-2004 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * 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 OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY + * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, + * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS + * SOFTWARE IS DISCLAIMED. + * + * + * $Id$ + */ + +#ifndef __HIDP_H +#define __HIDP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* HIDP defaults */ +#define HIDP_MINIMUM_MTU 48 +#define HIDP_DEFAULT_MTU 48 + +/* HIDP ioctl defines */ +#define HIDPCONNADD _IOW('H', 200, int) +#define HIDPCONNDEL _IOW('H', 201, int) +#define HIDPGETCONNLIST _IOR('H', 210, int) +#define HIDPGETCONNINFO _IOR('H', 211, int) + +#define HIDP_VIRTUAL_CABLE_UNPLUG 0 +#define HIDP_BLUETOOTH_VENDOR_ID 1 + +struct hidp_connadd_req { + int ctrl_sock; /* Connected control socket */ + int intr_sock; /* Connected interrupt socket */ + uint16_t parser; /* Parser version */ + uint16_t rd_size; /* Report descriptor size */ + uint8_t *rd_data; /* Report descriptor data */ + uint8_t country; + uint16_t vendor; + uint16_t product; + uint16_t version; + uint32_t flags; + uint32_t idle_to; + char name[128]; /* Device name */ +}; + +struct hidp_conndel_req { + bdaddr_t bdaddr; + uint32_t flags; +}; + +struct hidp_conninfo { + bdaddr_t bdaddr; + uint32_t flags; + uint16_t state; +}; + +struct hidp_connlist_req { + uint16_t cnum; + struct hidp_conninfo *ci; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __HIDP_H */ -- cgit From d1577755011c1ea10d9752b6e984f36eea349171 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Apr 2004 19:06:24 +0000 Subject: Add AFH related types --- include/hci.h | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/include/hci.h b/include/hci.h index 1b46cec7..5ab61c77 100644 --- a/include/hci.h +++ b/include/hci.h @@ -691,6 +691,23 @@ typedef struct { } __attribute__ ((packed)) write_inquiry_mode_rp; #define WRITE_INQUIRY_MODE_RP_SIZE 1 +#define OCF_READ_AFH_MODE 0x0048 +typedef struct { + uint8_t status; + uint8_t mode; +} __attribute__ ((packed)) read_afh_mode_rp; +#define READ_AFH_MODE_RP_SIZE 2 + +#define OCF_WRITE_AFH_MODE 0x0049 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_afh_mode_cp; +#define WRITE_AFH_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_afh_mode_rp; +#define WRITE_AFH_MODE_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -734,14 +751,14 @@ typedef struct { uint8_t status; uint16_t handle; uint8_t counter; -} __attribute__ ((packed)) read_failed_contact_counter_rp; +} __attribute__ ((packed)) read_failed_contact_counter_rp; #define READ_FAILED_CONTACT_COUNTER_RP_SIZE 4 #define OCF_RESET_FAILED_CONTACT_COUNTER 0x0002 typedef struct { uint8_t status; uint16_t handle; -} __attribute__ ((packed)) reset_failed_contact_counter_rp; +} __attribute__ ((packed)) reset_failed_contact_counter_rp; #define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 #define OCF_GET_LINK_QUALITY 0x0003 @@ -749,7 +766,7 @@ typedef struct { uint8_t status; uint16_t handle; uint8_t link_quality; -} __attribute__ ((packed)) get_link_quality_rp; +} __attribute__ ((packed)) get_link_quality_rp; #define GET_LINK_QUALITY_RP_SIZE 4 #define OCF_READ_RSSI 0x0005 @@ -757,9 +774,18 @@ typedef struct { uint8_t status; uint16_t handle; int8_t rssi; -} __attribute__ ((packed)) read_rssi_rp; +} __attribute__ ((packed)) read_rssi_rp; #define READ_RSSI_RP_SIZE 4 +#define OCF_READ_AFH_MAP 0x0006 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t mode; + uint8_t map[10]; +} __attribute__ ((packed)) read_afh_map_rp; +#define READ_AFH_MAP_RP_SIZE 14 + /* Testing commands */ #define OGF_TESTING_CMD 0x3e -- cgit From edb4586c5bd45aaa69c0910150f0012ca3251c7e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:33:54 +0000 Subject: Add attribute id for additional protocol list --- include/sdp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sdp.h b/include/sdp.h index 13205b9b..e62ab876 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -150,6 +150,7 @@ extern "C" { #define SDP_ATTR_DOC_URL 0x000A #define SDP_ATTR_CLNT_EXEC_URL 0x000B #define SDP_ATTR_ICON_URL 0x000C +#define SDP_ATTR_ADD_PROTO_DESC_LIST 0x000D #define SDP_ATTR_IP_SUBNET 0x0200 #define SDP_ATTR_SERVICE_VERSION 0x0300 -- cgit From 233bd39dee08afc5176b203e6348184da56d7bff Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:40:30 +0000 Subject: Add sdp_get_add_access_protos() function --- include/sdp_lib.h | 5 +++++ src/sdp.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 715f98cf..0fa7cb7a 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -453,6 +453,11 @@ int sdp_profile_uuid2strn(const uuid_t *uuid, char *str, size_t n); */ int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos); +/* + * Get the additional access protocols from the service record + */ +int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap); + /* * Extract the list of browse groups to which the service belongs. * When set, seqp contains elements of GroupID (uint16_t) diff --git a/src/sdp.c b/src/sdp.c index 6740e9d6..75c8edcb 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1310,6 +1310,30 @@ int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **pap) return 0; } +int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap) +{ + sdp_data_t *pdlist, *curr; + sdp_list_t *ap = 0; + + pdlist = sdp_data_get(rec, SDP_ATTR_ADD_PROTO_DESC_LIST); + if (pdlist == NULL) { + errno = ENODATA; + return -1; + } + SDPDBG("AP type : 0%x\n", pdlist->dtd); + + pdlist = pdlist->val.dataseq; + + for (; pdlist; pdlist = pdlist->next) { + sdp_list_t *pds = 0; + for (curr = pdlist->val.dataseq; curr; curr = curr->next) + pds = sdp_list_append(pds, curr->val.dataseq); + ap = sdp_list_append(ap, pds); + } + *pap = ap; + return 0; +} + int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **seqp) { sdp_data_t *sdpdata = sdp_data_get(rec, attr); -- cgit From 2d0eb2ad3222761c5c410fc9340ff23ce58680ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:50:20 +0000 Subject: Add HCRP related profile and service class id's --- include/sdp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index e62ab876..e28c4702 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -96,6 +96,9 @@ extern "C" { #define HANDSFREE_SVCLASS_ID 0x111e #define HANDSFREE_AUDIO_GW_SVCLASS_ID 0x111f #define HID_SVCLASS_ID 0x1124 +#define HCR_SVCLASS_ID 0x1125 +#define HCR_PRINT_SVCLASS_ID 0x1126 +#define HCR_SCAN_SVCLASS_ID 0x1127 #define CIP_SVCLASS_ID 0x1128 #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 @@ -126,6 +129,7 @@ extern "C" { #define IMAGING_RESPONDER_PROFILE_ID 0x111b #define HANDSFREE_PROFILE_ID 0x111e #define HID_PROFILE_ID 0x1124 +#define HCR_PROFILE_ID 0x1125 #define CIP_PROFILE_ID 0x1128 /* -- cgit From 6537173ad53f64d51bfa11788a3588c5fde27afc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 May 2004 21:55:01 +0000 Subject: Add HCRP UUID defines --- include/sdp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index e28c4702..7a654fc4 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -68,6 +68,9 @@ extern "C" { #define WSP_UUID 0x000E #define BNEP_UUID 0x000F #define HIDP_UUID 0x0011 +#define HCRP_CTRL_UUID 0x0012 +#define HCRP_DATA_UUID 0x0014 +#define HCRP_NOTE_UUID 0x0016 #define CMTP_UUID 0x001B /* -- cgit From 2d0aca374edda17c9dfb547679b8f03feacf616e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 May 2004 18:17:29 +0000 Subject: Update company identifiers --- src/bluetooth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bluetooth.c b/src/bluetooth.c index 61a632a5..1cd247d6 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -176,7 +176,7 @@ char *bt_compidtostr(int compid) { switch (compid) { case 0: - return "Ericsson Mobile Comunications"; + return "Ericsson Technology Licensing"; case 1: return "Nokia Mobile Phones"; case 2: @@ -212,7 +212,7 @@ char *bt_compidtostr(int compid) case 17: return "Widcomm, Inc."; case 18: - return "Telencomm Inc."; + return "Zeevo, Inc."; case 19: return "Atmel Corporation"; case 20: -- cgit From 55543cd15f83edbc560f45bd23adae86c511d7ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 May 2004 19:11:30 +0000 Subject: Update connection information --- include/hidp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hidp.h b/include/hidp.h index f374b9e8..894ddd1b 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -70,6 +70,10 @@ struct hidp_conninfo { bdaddr_t bdaddr; uint32_t flags; uint16_t state; + uint16_t vendor; + uint16_t product; + uint16_t version; + char name[128]; }; struct hidp_connlist_req { -- cgit From c7b26f3e5d03e1d54dfb945e5ca0c041da524348 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 May 2004 19:52:55 +0000 Subject: Add BDADDR_ALL constant --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 3dc4b245..412ccf61 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -105,6 +105,7 @@ typedef struct { } __attribute__((packed)) bdaddr_t; #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) +#define BDADDR_ALL (&(bdaddr_t) {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}) #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) /* Copy, swap, convert BD Address */ -- cgit From 15f0222e04e33cbfc622007d6bac851e44477dd9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 May 2004 20:22:26 +0000 Subject: Update library version number --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 17fdbf6d..73b6854f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libsdp.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:4:0 +libbluetooth_la_LDFLAGS = -version-info 1:7:0 libsdp_la_SOURCES = libsdp_la_LDFLAGS = -version-info 2:2:0 -- cgit From 997224301bb21bcd345026e9634d2d501e6918e7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 May 2004 20:36:18 +0000 Subject: Update changelog and bump version number --- ChangeLog | 9 +++++++++ configure.in | 2 +- libs.spec | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3bbb255..c77d7b2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +ver 2.7: + Fix display of decoded LMP features. + Update company identifiers. + Add AFH related types. + Add first bits from EDR prototyping specification. + Add support for inquiry with RSSI. + Add HCRP related SDP functions. + Add HIDP header file. + ver 2.6: Use R2 for default value of pscan_rep_mode. Add new company identifiers. diff --git a/configure.in b/configure.in index 9059aaf6..253f256e 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.6) +AM_INIT_AUTOMAKE(bluez-libs, 2.7) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/libs.spec b/libs.spec index 6a660514..ff758ddc 100644 --- a/libs.spec +++ b/libs.spec @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 2.6 +%define ver 2.7 %define RELEASE 1 %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr -- cgit From 60def948f68b9c02a9bb508e662d172ccab7ab65 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 12 May 2004 13:27:50 +0000 Subject: Fix the event code of inquiry with RSSI --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 5ab61c77..f498b16d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -964,7 +964,7 @@ typedef struct { } __attribute__ ((packed)) evt_qos_violation; #define EVT_QOS_VIOLATION_SIZE 2 -#define EVT_INQUIRY_RESULT_WITH_RSSI 0x02 +#define EVT_INQUIRY_RESULT_WITH_RSSI 0x22 typedef struct { bdaddr_t bdaddr; uint8_t pscan_rep_mode; -- cgit From 72c595e96c615d138d37d204152d3f71a60f02d1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Jun 2004 10:05:20 +0000 Subject: Add PKGConfig support --- Makefile.am | 5 ++++- bluez.pc.in | 11 +++++++++++ configure.in | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 bluez.pc.in diff --git a/Makefile.am b/Makefile.am index 2f4de561..2de6775b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,9 @@ SUBDIRS := include src -DISTCLEANFILES = conftest.c conftest +DISTCLEANFILES = conftest.c conftest bluez.pc EXTRA_DIST = ChangeLog libs.spec + +install-data-local: + $(INSTALL) -D -m 755 $(top_builddir)/bluez.pc $(DESTDIR)$(libdir)/pkgconfig/bluez.pc diff --git a/bluez.pc.in b/bluez.pc.in new file mode 100644 index 00000000..e7d98ee8 --- /dev/null +++ b/bluez.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: BlueZ +Description: Bluetooth protocol stack for Linux +Version: @VERSION@ +Requires: +Libs: -L${libdir} -lbluetooth +Cflags: -I${includedir} diff --git a/configure.in b/configure.in index 253f256e..4aa3aef5 100644 --- a/configure.in +++ b/configure.in @@ -23,4 +23,4 @@ m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])]) AC_PROG_LIBTOOL -AC_OUTPUT(Makefile include/Makefile src/Makefile) +AC_OUTPUT(Makefile include/Makefile src/Makefile bluez.pc) -- cgit From c420aef6fe7d316ee053e69f7e901db39443361b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 Jun 2004 13:59:03 +0000 Subject: Add defines for audio/video profiles --- include/sdp.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index 7a654fc4..3ba10f20 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -88,6 +88,8 @@ extern "C" { #define IRMC_SYNC_CMD_SVCLASS_ID 0x1107 #define HEADSET_SVCLASS_ID 0x1108 #define CORDLESS_TELEPHONY_SVCLASS_ID 0x1109 +#define AUDIO_SOURCE_SVCLASS_ID 0x110a +#define AUDIO_SINK_SVCLASS_ID 0x110b #define INTERCOM_SVCLASS_ID 0x1110 #define FAX_SVCLASS_ID 0x1111 #define HEADSET_AGW_SVCLASS_ID 0x1112 @@ -108,6 +110,8 @@ extern "C" { #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 #define GENERIC_AUDIO_SVCLASS_ID 0x1203 #define GENERIC_TELEPHONY_SVCLASS_ID 0x1204 +#define VIDEO_SOURCE_SVCLASS_ID 0x1303 +#define VIDEO_SINK_SVCLASS_ID 0x1304 /* * Standard profile descriptor identifiers; note these @@ -122,6 +126,7 @@ extern "C" { #define IRMC_SYNC_CMD_PROFILE_ID 0x1107 #define HEADSET_PROFILE_ID 0x1108 #define CORDLESS_TELEPHONY_PROFILE_ID 0x1109 +#define ADVANCED_AUDIO_PROFILE_ID 0x110d #define INTERCOM_PROFILE_ID 0x1110 #define FAX_PROFILE_ID 0x1111 #define HEADSET_AGW_PROFILE_ID 0x1112 -- cgit From 4691560c56de8c5cef68bd4acee97e53e193b717 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 Jun 2004 16:41:51 +0000 Subject: Add UUID's for AVCTP and AVDTP --- include/sdp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index 3ba10f20..8acd862e 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -71,6 +71,8 @@ extern "C" { #define HCRP_CTRL_UUID 0x0012 #define HCRP_DATA_UUID 0x0014 #define HCRP_NOTE_UUID 0x0016 +#define AVCTP_UUID 0x0017 +#define AVDTP_UUID 0x0019 #define CMTP_UUID 0x001B /* -- cgit From b51c6e3aa307c37a12f34e92c048dc4f1ef4e223 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 16 Jun 2004 09:34:22 +0000 Subject: Update README --- README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index 6e232e32..f4a6ae92 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ Copyright (C) 2002-2004 Marcel Holtmann Bluetooth libraries -1. Compilation and installation. +1. Compilation and installation In order to compile Bluetooth libraries you need following software packages: - Linux Bluetooth protocol stack (BlueZ) @@ -25,8 +25,8 @@ To compile and install run: 2. Information Mailing lists: - bluez-users@lists.sourceforge.net - BlueZ general questions and discussions - bluez-devel@lists.sourceforge.net - BlueZ development + bluez-users@lists.sf.net - BlueZ general questions and discussions + bluez-devel@lists.sf.net - BlueZ development For additional information about the project visit BlueZ web site: http://www.bluez.org -- cgit From a4a1f2b6249f30899c8226d15d9006d878cf55b5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 4 Jul 2004 15:32:57 +0000 Subject: Add subclass field --- include/hidp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hidp.h b/include/hidp.h index 894ddd1b..21b62513 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -44,7 +44,8 @@ extern "C" { #define HIDPGETCONNINFO _IOR('H', 211, int) #define HIDP_VIRTUAL_CABLE_UNPLUG 0 -#define HIDP_BLUETOOTH_VENDOR_ID 1 +#define HIDP_BOOT_PROTOCOL_MODE 1 +#define HIDP_BLUETOOTH_VENDOR_ID 9 struct hidp_connadd_req { int ctrl_sock; /* Connected control socket */ @@ -53,6 +54,7 @@ struct hidp_connadd_req { uint16_t rd_size; /* Report descriptor size */ uint8_t *rd_data; /* Report descriptor data */ uint8_t country; + uint8_t subclass; uint16_t vendor; uint16_t product; uint16_t version; -- cgit From f843c841cfdcb3bfd45ba136847421ad8e18efbe Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 4 Jul 2004 15:38:11 +0000 Subject: Add AVDTP protocol identifier --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 412ccf61..d6359938 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -52,6 +52,7 @@ extern "C" { #define BTPROTO_BNEP 4 #define BTPROTO_CMTP 5 #define BTPROTO_HIDP 6 +#define BTPROTO_AVDTP 7 #define SOL_HCI 0 #define SOL_L2CAP 6 -- cgit From 7ab16cfb4cff8e163fc287b12157929b33c0a4c4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 7 Jul 2004 15:55:31 +0000 Subject: Change permission for bluez.pc file --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2de6775b..c4fc53e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,5 +8,5 @@ DISTCLEANFILES = conftest.c conftest bluez.pc EXTRA_DIST = ChangeLog libs.spec -install-data-local: - $(INSTALL) -D -m 755 $(top_builddir)/bluez.pc $(DESTDIR)$(libdir)/pkgconfig/bluez.pc +install-data-local: bluez.pc + $(INSTALL) -D -m 644 $(top_builddir)/bluez.pc $(DESTDIR)$(libdir)/pkgconfig/bluez.pc -- cgit From 989349a83ad8b475eb36e2b9b47f46f796ce69ef Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 7 Jul 2004 15:56:21 +0000 Subject: Update automake bootstrap process --- bootstrap | 2 +- configure.in | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index c9042454..109dcb25 100755 --- a/bootstrap +++ b/bootstrap @@ -1,2 +1,2 @@ #! /bin/sh -aclocal && autoheader && automake --copy --add-missing && autoconf +aclocal && autoheader && libtoolize --copy --force && automake --add-missing --copy --force-missing --ignore-deps && autoconf diff --git a/configure.in b/configure.in index 4aa3aef5..2966c490 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,7 @@ AC_LANG_C AC_PROG_CC AC_PROG_INSTALL +m4_define([_LT_AC_TAGCONFIG], []) m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])]) AC_PROG_LIBTOOL -- cgit From a315030f93449c55905df6b0b8b85f2c6260b838 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 7 Jul 2004 15:58:33 +0000 Subject: Update library version number and remove dummy libsdp --- src/Makefile.am | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 73b6854f..119b3762 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,12 +2,9 @@ # $Id$ # -lib_LTLIBRARIES = libbluetooth.la libsdp.la +lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:7:0 - -libsdp_la_SOURCES = -libsdp_la_LDFLAGS = -version-info 2:2:0 +libbluetooth_la_LDFLAGS = -version-info 1:8:0 INCLUDES = -I$(top_builddir)/include -- cgit From 8fc2bc09804346200619138a9c245be9daac0b6a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 7 Jul 2004 16:13:22 +0000 Subject: Update changelog and bump version number --- ChangeLog | 8 ++++++++ configure.in | 2 +- libs.spec | 7 +++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c77d7b2f..ebf07e71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +ver 2.8: + Fix the event code of inquiry with RSSI. + Add defines and UUID's for audio/video profiles. + Add AVDTP protocol identifier. + Add HIDP subclass field. + Add PKGConfig support. + Remove dummy SDP library. + ver 2.7: Fix display of decoded LMP features. Update company identifiers. diff --git a/configure.in b/configure.in index 2966c490..6bd235a6 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.7) +AM_INIT_AUTOMAKE(bluez-libs, 2.8) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/libs.spec b/libs.spec index ff758ddc..a8a90ab4 100644 --- a/libs.spec +++ b/libs.spec @@ -1,5 +1,5 @@ # Note that this is NOT a relocatable package -%define ver 2.7 +%define ver 2.8 %define RELEASE 1 %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr @@ -12,9 +12,9 @@ Copyright: GPL Group: Applications/System Vendor: Official Linux Bluetooth protocol stack Packager: Sebastian Frankfurt -Source: http://bluez.sourceforge.net/%{name}-%{ver}.tar.gz +Source: http://bluez.sf.net/download/%{name}-%{ver}.tar.gz BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root -URL: http://bluez.sourceforge.net +URL: http://www.bluez.org Docdir: %{prefix}/share/doc Requires: glibc >= 2.2.4 BuildRequires: glibc >= 2.2.4 @@ -54,7 +54,6 @@ rm -rf $RPM_BUILD_ROOT /usr/include/bluetooth/* /usr/lib/libbluetooth* -/usr/lib/libsdp* %doc AUTHORS COPYING INSTALL ChangeLog NEWS README -- cgit From 4f018af0f15901dcda46f6b93ebf9db7c0d1b993 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jul 2004 19:43:49 +0000 Subject: Add info type and info result definitions --- include/l2cap.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/l2cap.h b/include/l2cap.h index d06eb800..e2fa860e 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -196,6 +196,14 @@ typedef struct { } __attribute__ ((packed)) l2cap_info_rsp; #define L2CAP_INFO_RSP_SIZE 4 +/* info type */ +#define L2CAP_IT_CL_MTU 0x0001 +#define L2CAP_IT_FEAT_MASK 0x0002 + +/* info result */ +#define L2CAP_IR_SUCCESS 0x0000 +#define L2CAP_IR_NOTSUPP 0x0001 + #ifdef __cplusplus } #endif -- cgit From 0c8f74212a5345507db372c9ba78c63000971f89 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jul 2004 22:30:56 +0000 Subject: Add value for L2CAP_CONF_RFC_MODE --- include/l2cap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/l2cap.h b/include/l2cap.h index e2fa860e..b5052dcf 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -168,6 +168,7 @@ typedef struct { #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 #define L2CAP_CONF_QOS 0x03 +#define L2CAP_CONF_RFC_MODE 0x04 #define L2CAP_CONF_MAX_SIZE 22 -- cgit From 0320edae7f734cbc1ad02b6221650ca577b46bc7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 10 Jul 2004 11:28:03 +0000 Subject: The RSSI value is signed and not unsigned --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index f498b16d..6cc7e4bd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -971,7 +971,7 @@ typedef struct { uint8_t pscan_period_mode; uint8_t dev_class[3]; uint16_t clock_offset; - uint8_t rssi; + int8_t rssi; } __attribute__ ((packed)) inquiry_info_with_rssi; #define INQUIRY_INFO_WITH_RSSI_SIZE 14 -- cgit From e477eda75a71e2149ed302d950b5acc2db7c2f16 Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 12 Jul 2004 16:54:04 +0000 Subject: add bluez.pc --- libs.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/libs.spec b/libs.spec index a8a90ab4..e30782dd 100644 --- a/libs.spec +++ b/libs.spec @@ -54,6 +54,7 @@ rm -rf $RPM_BUILD_ROOT /usr/include/bluetooth/* /usr/lib/libbluetooth* +/usr/lib/pkgconfig/bluez.pc %doc AUTHORS COPYING INSTALL ChangeLog NEWS README -- cgit From 0109c65ae52526d6b262181fb8c63a4e6dcb337a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 15 Jul 2004 18:26:32 +0000 Subject: Don't use --force-missing --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 109dcb25..199053bb 100755 --- a/bootstrap +++ b/bootstrap @@ -1,2 +1,2 @@ #! /bin/sh -aclocal && autoheader && libtoolize --copy --force && automake --add-missing --copy --force-missing --ignore-deps && autoconf +aclocal && autoheader && libtoolize --copy --force && automake --add-missing --copy --ignore-deps && autoconf -- cgit From e9eeb41ebdc975e33d992bfa190fd84399550e34 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 19 Jul 2004 09:57:10 +0000 Subject: Update COPYING and INSTALL from automake-1.7 --- COPYING | 4 +- INSTALL | 131 +++++++++++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 91 insertions(+), 44 deletions(-) diff --git a/COPYING b/COPYING index 5b6e7c66..d60c31a9 100644 --- a/COPYING +++ b/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/INSTALL b/INSTALL index b42a17ac..54caf7c1 100644 --- a/INSTALL +++ b/INSTALL @@ -1,3 +1,9 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + Basic Installation ================== @@ -8,20 +14,27 @@ various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. The simplest way to compile this package is: @@ -55,14 +68,16 @@ Compilers and Options ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== @@ -75,11 +90,11 @@ directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. Installation Names ================== @@ -122,22 +137,32 @@ you can use the `configure' options `--x-includes=DIR' and Specifying the System Type ========================== - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + CPU-COMPANY-SYSTEM -See the file `config.sub' for the possible values of each field. If +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't -need to know the host type. +need to know the machine type. - If you are building compiler tools for cross-compiling, you can also + If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. Sharing Defaults ================ @@ -150,20 +175,44 @@ default values for variables like `CC', `cache_file', and `prefix'. `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. -Operation Controls +Defining Variables ================== + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + `configure' recognizes the following options to control how it operates. -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - `--help' +`-h' Print a summary of the options to `configure', and exit. +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + `--quiet' `--silent' `-q' @@ -175,8 +224,6 @@ operates. Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. -`configure' also accepts some other, not widely useful, options. -- cgit From 3429ef600fcef09e96408f8b476ead6cb519cf83 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 21 Jul 2004 13:30:34 +0000 Subject: Make use of MAINTAINERCLEANFILES --- Makefile.am | 15 +++++++++++---- include/Makefile.am | 3 ++- src/Makefile.am | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index c4fc53e6..34e8e0a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,11 +2,18 @@ # $Id$ # -SUBDIRS := include src - -DISTCLEANFILES = conftest.c conftest bluez.pc +SUBDIRS = include src EXTRA_DIST = ChangeLog libs.spec +DISTCLEANFILES = bluez.pc + +MAINTAINERCLEANFILES = Makefile.in \ + aclocal.m4 configure config.h.in config.sub config.guess \ + ltmain.sh missing install-sh mkinstalldirs + install-data-local: bluez.pc - $(INSTALL) -D -m 644 $(top_builddir)/bluez.pc $(DESTDIR)$(libdir)/pkgconfig/bluez.pc + $(INSTALL) -D -m 644 $(top_builddir)/$< $(DESTDIR)$(libdir)/pkgconfig/$< + +uninstall-local: bluez.pc + @rm -f $(DESTDIR)$(libdir)/pkgconfig/$< diff --git a/include/Makefile.am b/include/Makefile.am index cbde42bf..4ac8aada 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -10,9 +10,10 @@ include_HEADERS = \ noinst_HEADERS = sdp_internal.h +MAINTAINERCLEANFILES = Makefile.in all-local: - @if [ ! -e bluetooth ] ; then ln -s $(top_srcdir)/include bluetooth ; fi + @if [ ! -e bluetooth ] ; then $(LN_S) $(top_srcdir)/include bluetooth ; fi clean-local: @rm -f bluetooth diff --git a/src/Makefile.am b/src/Makefile.am index 119b3762..46985678 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,3 +8,5 @@ libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c libbluetooth_la_LDFLAGS = -version-info 1:8:0 INCLUDES = -I$(top_builddir)/include + +MAINTAINERCLEANFILES = Makefile.in -- cgit From 8d358dc737350567d81161e9fce4335392508e3a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 21 Jul 2004 15:31:20 +0000 Subject: No need to add ChangeLog to EXTRA_DIST --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 34e8e0a7..538873b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = include src -EXTRA_DIST = ChangeLog libs.spec +EXTRA_DIST = libs.spec DISTCLEANFILES = bluez.pc -- cgit From a8efcfa5ca81ef29e4d56dac70761d9b9ffc9708 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 22 Jul 2004 18:08:49 +0000 Subject: UUID32 values can also be used as protocol identifiers --- src/sdp.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 75c8edcb..9cb2230a 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2069,14 +2069,14 @@ int sdp_uuid128_to_uuid(uuid_t *uuid) uint128_t *b = sdp_create_base_uuid(); uint128_t *u = &uuid->value.uuid128; uint32_t data; - + if (uuid->type != SDP_UUID128) return 1; - + for (i = 4; i < sizeof(b->data); i++) if (b->data[i] != u->data[i]) return 0; - + memcpy(&data, u->data, 4); data = htonl(data); if (data <= 0xffff) { @@ -2095,8 +2095,14 @@ int sdp_uuid128_to_uuid(uuid_t *uuid) int sdp_uuid_to_proto(uuid_t *uuid) { uuid_t u = *uuid; - if (sdp_uuid128_to_uuid(&u) && u.type == SDP_UUID16) - return u.value.uuid16; + if (sdp_uuid128_to_uuid(&u)) { + switch (u.type) { + case SDP_UUID16: + return u.value.uuid16; + case SDP_UUID32: + return u.value.uuid32; + } + } return 0; } -- cgit From 77f2433200ee85d3efc1a5a261b190cb0a3c1422 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Jul 2004 15:13:06 +0000 Subject: Update RPM spec file --- libs.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs.spec b/libs.spec index e30782dd..e3d4ac1c 100644 --- a/libs.spec +++ b/libs.spec @@ -30,17 +30,16 @@ The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. %prep rm -rf $RPM_BUILD_ROOT -#rm -rf /usr/src/redhat/BUILD/* %setup -q %build -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --mandir=%{_mandir} --sysconfdir=%{_sysconfdir} make %install rm -rf $RPM_BUILD_ROOT -make prefix=$RPM_BUILD_ROOT%{prefix} install +make DESTDIR=$RPM_BUILD_ROOT prefix=%{prefix} mandir=%{_mandir} sysconfdir=%{_sysconfdir} install %clean rm -rf $RPM_BUILD_ROOT -- cgit From ed7c684d772592204d02a5d04bb1f68746cf91e2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 27 Jul 2004 13:41:45 +0000 Subject: The library don't uses --sysconfdir --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index f4a6ae92..935dcccd 100644 --- a/README +++ b/README @@ -14,7 +14,7 @@ In order to compile Bluetooth libraries you need following software packages: - GCC compiler To configure run: - ./configure --prefix=/usr --sysconfdir=/etc + ./configure --prefix=/usr Configure automatically searches for all required components and packages. -- cgit From 510555837596e01a69cdcc40a7ffdafeeabd80cd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 28 Jul 2004 07:09:49 +0000 Subject: Use simpler way to install bluez.pc --- Makefile.am | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 538873b1..dde46889 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,10 @@ SUBDIRS = include src +pkgconfigdir = $(libdir)/pkgconfig + +pkgconfig_DATA = bluez.pc + EXTRA_DIST = libs.spec DISTCLEANFILES = bluez.pc @@ -11,9 +15,3 @@ DISTCLEANFILES = bluez.pc MAINTAINERCLEANFILES = Makefile.in \ aclocal.m4 configure config.h.in config.sub config.guess \ ltmain.sh missing install-sh mkinstalldirs - -install-data-local: bluez.pc - $(INSTALL) -D -m 644 $(top_builddir)/$< $(DESTDIR)$(libdir)/pkgconfig/$< - -uninstall-local: bluez.pc - @rm -f $(DESTDIR)$(libdir)/pkgconfig/$< -- cgit From c2ce952c89bf07118d8d4d174979cc41fe047065 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 29 Jul 2004 09:26:14 +0000 Subject: Remove RPM spec file --- Makefile.am | 2 -- libs.spec | 59 ----------------------------------------------------------- 2 files changed, 61 deletions(-) delete mode 100644 libs.spec diff --git a/Makefile.am b/Makefile.am index dde46889..c3075ae1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,8 +8,6 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = bluez.pc -EXTRA_DIST = libs.spec - DISTCLEANFILES = bluez.pc MAINTAINERCLEANFILES = Makefile.in \ diff --git a/libs.spec b/libs.spec deleted file mode 100644 index e3d4ac1c..00000000 --- a/libs.spec +++ /dev/null @@ -1,59 +0,0 @@ -# Note that this is NOT a relocatable package -%define ver 2.8 -%define RELEASE 1 -%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} -%define prefix /usr - -Summary: Bluetooth libraries -Name: bluez-libs -Version: %ver -Release: %rel -Copyright: GPL -Group: Applications/System -Vendor: Official Linux Bluetooth protocol stack -Packager: Sebastian Frankfurt -Source: http://bluez.sf.net/download/%{name}-%{ver}.tar.gz -BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root -URL: http://www.bluez.org -Docdir: %{prefix}/share/doc -Requires: glibc >= 2.2.4 -BuildRequires: glibc >= 2.2.4 - -%description -Bluetooth libraries. - -The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A. - -%changelog -* Tue Aug 13 2002 Sebastian Frankfurt -- Initial RPM - -%prep -rm -rf $RPM_BUILD_ROOT - -%setup -q - -%build -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --mandir=%{_mandir} --sysconfdir=%{_sysconfdir} -make - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT prefix=%{prefix} mandir=%{_mandir} sysconfdir=%{_sysconfdir} install - -%clean -rm -rf $RPM_BUILD_ROOT - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(-, root, root) - -/usr/include/bluetooth/* -/usr/lib/libbluetooth* -/usr/lib/pkgconfig/bluez.pc - -%doc AUTHORS COPYING INSTALL ChangeLog NEWS README - -- cgit From 79755a2cfbd1ed4838851cd22413daa572d4f3b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 29 Jul 2004 09:40:32 +0000 Subject: Update changelog and bump version number --- ChangeLog | 6 ++++++ configure.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ebf07e71..b00dc5af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 2.9: + Add L2CAP info type and info result definitions. + Add value for L2CAP_CONF_RFC_MODE. + Change RSSI value to signed instead of unsigned. + Allow UUID32 values as protocol identifiers. + ver 2.8: Fix the event code of inquiry with RSSI. Add defines and UUID's for audio/video profiles. diff --git a/configure.in b/configure.in index 6bd235a6..e0ab76f0 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.8) +AM_INIT_AUTOMAKE(bluez-libs, 2.9) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 1590d5be4605667ca2b405172d99a65c814723b2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 29 Jul 2004 13:35:42 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 46985678..4bca9333 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:8:0 +libbluetooth_la_LDFLAGS = -version-info 1:9:0 INCLUDES = -I$(top_builddir)/include -- cgit From 8b84723cea240cbd9e55ba2acd683fadb3a79282 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 11 Aug 2004 07:07:12 +0000 Subject: Use memmove for unaligned access, so gcc does not insert a __builtin_memcpy --- include/bluetooth.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index d6359938..e286ffb9 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -93,10 +93,10 @@ enum { #define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) #else #define bt_get_unaligned(ptr) \ - ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) + ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) #define bt_put_unaligned(val, ptr) \ ({ __typeof__(*(ptr)) __tmp = (val); \ - memcpy((ptr), &__tmp, sizeof(*(ptr))); \ + memmove((ptr), &__tmp, sizeof(*(ptr))); \ (void)0; }) #endif -- cgit From bb42dcd5202fce11689ba81d73783ccb9b79e8d6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 12 Aug 2004 16:00:35 +0000 Subject: Make compiling with debug information optional --- acinclude.m4 | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 6 +++--- 2 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 acinclude.m4 diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 00000000..eaeb4ffc --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,59 @@ +dnl +dnl $Id$ +dnl + +AC_DEFUN([AC_PROG_CC_PIE], [ + AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [ + 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* + ]) +]) + +AC_DEFUN([AC_INIT_BLUEZ], [ + AC_PREFIX_DEFAULT(/usr) + + CFLAGS="-Wall -O2" + + if (test "${prefix}" = "NONE"); then + dnl no prefix and no sysconfdir, so default to /etc + if (test "$sysconfdir" = '${prefix}/etc'); then + AC_SUBST([sysconfdir], ['/etc']) + fi + + dnl no prefix and no mandir, so use ${prefix}/share/man as default + if (test "$mandir" = '${prefix}/man'); then + AC_SUBST([mandir], ['${prefix}/share/man']) + fi + + prefix="${ac_default_prefix}" + fi + + if (test "${libdir}" = '${exec_prefix}/lib'); then + libdir="${prefix}/lib" + fi + + if (test "$sysconfdir" = '${prefix}/etc'); then + configdir="${prefix}/etc/bluetooth" + else + configdir="${sysconfdir}/bluetooth" + fi + + AC_DEFINE_UNQUOTED(CONFIGDIR, "${configdir}", [Directory for the configuration files]) +]) + +AC_DEFUN([AC_ARG_BLUEZ], [ + debug_enable=no + + AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable compiling with debugging information]), [ + debug_enable=${enableval} + ]) + + if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then + CFLAGS="$CFLAGS -g" + fi +]) diff --git a/configure.in b/configure.in index e0ab76f0..8d4ce6dc 100644 --- a/configure.in +++ b/configure.in @@ -10,9 +10,7 @@ AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -AC_PREFIX_DEFAULT(/usr) - -CFLAGS="-Wall -g -O2" +AC_INIT_BLUEZ AC_LANG_C @@ -24,4 +22,6 @@ m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])]) AC_PROG_LIBTOOL +AC_ARG_BLUEZ + AC_OUTPUT(Makefile include/Makefile src/Makefile bluez.pc) -- cgit From 02f41dc112d035da030b2c14f02baaae2f7c3c18 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 12 Aug 2004 21:22:37 +0000 Subject: Add architectures that can do unaligned access by themself --- include/bluetooth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index e286ffb9..9304ddd6 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -88,7 +88,7 @@ enum { #endif /* Bluetooth unaligned access */ -#if defined(__i386__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) #define bt_get_unaligned(ptr) (*(ptr)) #define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) #else -- cgit From ea6bf1beea4d3fcc98e2e940e940735a5a0b3c5e Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Thu, 12 Aug 2004 21:59:42 +0000 Subject: The CRIS architecture handles unaligned accesses too. --- include/bluetooth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index 9304ddd6..80a2d169 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -88,7 +88,7 @@ enum { #endif /* Bluetooth unaligned access */ -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) || defined(__cris__) #define bt_get_unaligned(ptr) (*(ptr)) #define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) #else -- cgit From 083f0466ab9b77d6320f91dcca315860da1a54b2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 13 Aug 2004 12:34:54 +0000 Subject: Don't override CFLAGS --- acinclude.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index eaeb4ffc..2f1077ea 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -17,7 +17,9 @@ AC_DEFUN([AC_PROG_CC_PIE], [ AC_DEFUN([AC_INIT_BLUEZ], [ AC_PREFIX_DEFAULT(/usr) - CFLAGS="-Wall -O2" + if (test "${CFLAGS}" = ""); then + CFLAGS="-Wall -O2" + fi if (test "${prefix}" = "NONE"); then dnl no prefix and no sysconfdir, so default to /etc -- cgit From c64da0295f5260a07d56dfd6df14d7369859164a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 13 Aug 2004 13:48:14 +0000 Subject: Update library version number --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 4bca9333..414c7b53 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:9:0 +libbluetooth_la_LDFLAGS = -version-info 1:10:0 INCLUDES = -I$(top_builddir)/include -- cgit From 4454737ea24db7e7f99c5c6f305c3d802c27b12a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 13 Aug 2004 13:48:35 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b00dc5af..7f341c88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 2.10: + Fix and extend the unaligned access macros. + Make compiling with debug information optional. + Don't override CFLAGS from configure. + ver 2.9: Add L2CAP info type and info result definitions. Add value for L2CAP_CONF_RFC_MODE. diff --git a/configure.in b/configure.in index 8d4ce6dc..82b4e724 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.9) +AM_INIT_AUTOMAKE(bluez-libs, 2.10) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From a867781820a4b7a85031c54fe38399c33affdb9c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 Oct 2004 17:39:53 +0000 Subject: Add support for the kernel security manager --- include/hci.h | 6 +++++- src/hci.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 6cc7e4bd..6cabc0b4 100644 --- a/include/hci.h +++ b/include/hci.h @@ -70,7 +70,9 @@ enum { HCI_ENCRYPT, HCI_INQUIRY, - HCI_RAW + HCI_RAW, + + HCI_SECMGR }; /* HCI ioctl defines */ @@ -94,6 +96,8 @@ enum { #define HCISETACLMTU _IOW('H', 227, int) #define HCISETSCOMTU _IOW('H', 228, int) +#define HCISETSECMGR _IOW('H', 230, int) + #define HCIINQUIRY _IOR('H', 240, int) /* HCI timeouts */ diff --git a/src/hci.c b/src/hci.c index 5acbe7cd..43baa7b7 100644 --- a/src/hci.c +++ b/src/hci.c @@ -173,6 +173,7 @@ static hci_map dev_flags_map[] = { { "INQUIRY", HCI_INQUIRY }, { "AUTH", HCI_AUTH }, { "ENCRYPT", HCI_ENCRYPT }, + { "SECMGR", HCI_SECMGR }, { NULL } }; -- cgit From 735e59b37803748fea1077de064b285f78de1c10 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 13 Oct 2004 12:03:16 +0000 Subject: Add SIM Access types --- include/sdp.h | 2 ++ src/sdp.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 8acd862e..7c529de1 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -107,6 +107,7 @@ extern "C" { #define HCR_PRINT_SVCLASS_ID 0x1126 #define HCR_SCAN_SVCLASS_ID 0x1127 #define CIP_SVCLASS_ID 0x1128 +#define SAP_SVCLASS_ID 0x112d #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 @@ -141,6 +142,7 @@ extern "C" { #define HID_PROFILE_ID 0x1124 #define HCR_PROFILE_ID 0x1125 #define CIP_PROFILE_ID 0x1128 +#define SAP_PROFILE_ID 0x112d /* * Attribute identifier codes diff --git a/src/sdp.c b/src/sdp.c index 9cb2230a..971644ba 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -104,6 +104,7 @@ static struct tupla ServiceClass[] = { { GN_SVCLASS_ID, "PAN group network" }, { HID_SVCLASS_ID, "Human Interface Device" }, { CIP_SVCLASS_ID, "Common ISDN Access" }, + { SAP_SVCLASS_ID, "SIM Access" }, { 0 } }; @@ -123,8 +124,9 @@ static struct tupla Profile[] = { { PANU_PROFILE_ID, "PAN user" }, { NAP_PROFILE_ID, "PAN access point" }, { GN_PROFILE_ID, "PAN group network" }, - { HID_SVCLASS_ID, "Human Interface Device" }, - { CIP_SVCLASS_ID, "Common ISDN Access" }, + { HID_PROFILE_ID, "Human Interface Device" }, + { CIP_PROFILE_ID, "Common ISDN Access" }, + { SAP_PROFILE_ID, "SIM Access" }, { 0 } }; -- cgit From 81c45f31a8b4897e0a6267fb3a84b3f6b73557b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 23 Oct 2004 17:51:55 +0000 Subject: For vendor packets set bit 0 in the packet type bitmask of the filter --- include/hci.h | 2 +- include/hci_lib.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hci.h b/include/hci.h index 6cabc0b4..00f2d21a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -113,7 +113,7 @@ enum { #define HCI_ACLDATA_PKT 0x02 #define HCI_SCODATA_PKT 0x03 #define HCI_EVENT_PKT 0x04 -#define HCI_UNKNOWN_PKT 0xff +#define HCI_VENDOR_PKT 0xff /* HCI Packet types */ #define HCI_2DH1 0x0002 diff --git a/include/hci_lib.h b/include/hci_lib.h index 70d39264..49857768 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -132,19 +132,19 @@ static inline void hci_filter_clear(struct hci_filter *f) } static inline void hci_filter_set_ptype(int t, struct hci_filter *f) { - hci_set_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); + hci_set_bit((t == HCI_VENDOR_PKT) ? 0 : (t & HCI_FLT_TYPE_BITS), &f->type_mask); } static inline void hci_filter_clear_ptype(int t, struct hci_filter *f) { - hci_clear_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); + hci_clear_bit((t == HCI_VENDOR_PKT) ? 0 : (t & HCI_FLT_TYPE_BITS), &f->type_mask); } static inline int hci_filter_test_ptype(int t, struct hci_filter *f) { - return hci_test_bit((t & HCI_FLT_TYPE_BITS), &f->type_mask); + return hci_test_bit((t == HCI_VENDOR_PKT) ? 0 : (t & HCI_FLT_TYPE_BITS), &f->type_mask); } static inline void hci_filter_all_ptypes(struct hci_filter *f) { - memset((void *)&f->type_mask, 0xff, sizeof(f->type_mask)); + memset((void *) &f->type_mask, 0xff, sizeof(f->type_mask)); } static inline void hci_filter_set_event(int e, struct hci_filter *f) { @@ -160,7 +160,7 @@ static inline int hci_filter_test_event(int e, struct hci_filter *f) } static inline void hci_filter_all_events(struct hci_filter *f) { - memset((void *)f->event_mask, 0xff, sizeof(f->event_mask)); + memset((void *) f->event_mask, 0xff, sizeof(f->event_mask)); } static inline void hci_filter_set_opcode(int opcode, struct hci_filter *f) { -- cgit From cc0deab6cac822b062e1c6ab7322d1e1d75d463e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 25 Oct 2004 06:44:47 +0000 Subject: Cleanup the API to prevent endian bugs --- include/hci_lib.h | 12 ++++++------ src/hci.c | 48 +++++++++++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 49857768..8c321d90 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -58,20 +58,20 @@ int hci_close_dev(int dd); 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); -int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); +int hci_create_connection(int dd, const bdaddr_t *bdaddr, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to); int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to); int hci_inquiry(int dev_id, int len, int num_rsp, const uint8_t *lap, inquiry_info **ii, long flags); int hci_devinfo(int dev_id, struct hci_dev_info *di); -int hci_devba(int dev_id, bdaddr_t *ba); +int hci_devba(int dev_id, bdaddr_t *bdaddr); int hci_devid(const char *str); /* deprecated: preserve compatibility */ int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); -int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); -int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to); +int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); +int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); @@ -83,9 +83,9 @@ int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); -int hci_encrypt_link(int dd, uint16_t handle, int on, int to); +int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); /* role == 0 is master, 1 is slave */ -int hci_switch_role(int dd, bdaddr_t peer, int role, int to); +int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); diff --git a/src/hci.c b/src/hci.c index 43baa7b7..ffa453f3 100644 --- a/src/hci.c +++ b/src/hci.c @@ -537,7 +537,7 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di) return err; } -int hci_devba(int dev_id, bdaddr_t *ba) +int hci_devba(int dev_id, bdaddr_t *bdaddr) { struct hci_dev_info di; @@ -549,7 +549,7 @@ int hci_devba(int dev_id, bdaddr_t *ba) return -1; } - bacpy(ba, &di.bdaddr); + bacpy(bdaddr, &di.bdaddr); return 0; } @@ -783,14 +783,14 @@ done: return 0; } -int hci_create_connection(int dd, const bdaddr_t *ba, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to) +int hci_create_connection(int dd, const bdaddr_t *bdaddr, uint16_t ptype, uint16_t clkoffset, uint8_t rswitch, uint16_t *handle, int to) { evt_conn_complete rp; create_conn_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - bacpy(&cp.bdaddr, ba); + bacpy(&cp.bdaddr, bdaddr); cp.pkt_type = ptype; cp.pscan_rep_mode = 0x02; cp.clock_offset = clkoffset; @@ -892,19 +892,19 @@ int hci_write_local_name(int dd, const char *name, int to) return 0; } -int hci_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to) +int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) { - return hci_read_remote_name(dd, ba, len, name, to); + return hci_read_remote_name(dd, bdaddr, len, name, to); } -int hci_read_remote_name(int dd, const bdaddr_t *ba, int len, char *name, int to) +int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) { evt_remote_name_req_complete rn; remote_name_req_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - bacpy(&cp.bdaddr, ba); + bacpy(&cp.bdaddr, bdaddr); cp.pscan_rep_mode = 0x02; memset(&rq, 0, sizeof(rq)); @@ -1121,6 +1121,7 @@ int hci_write_voice_setting(int dd, uint16_t vs, int to) rq.ocf = OCF_WRITE_VOICE_SETTING; rq.cparam = &cp; rq.clen = WRITE_VOICE_SETTING_CP_SIZE; + return hci_send_req(dd, &rq, to); } @@ -1162,6 +1163,7 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; rq.cparam = &cp; rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; + return hci_send_req(dd, &rq, to); } @@ -1179,32 +1181,37 @@ int hci_authenticate_link(int dd, uint16_t handle, int to) rq.rparam = &rp; rq.event = EVT_AUTH_COMPLETE; rq.rlen = EVT_AUTH_COMPLETE_SIZE; + if (hci_send_req(dd, &rq, to) < 0) return -1; + if (rp.status) { errno = EIO; return -1; } + return 0; } -int hci_encrypt_link(int dd, uint16_t handle, int on, int to) +int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to) { set_conn_encrypt_cp cp; evt_encrypt_change rp; struct hci_request rq; cp.handle = handle; - cp.encrypt = on; - rq.ogf = OGF_LINK_CTL; - rq.ocf = OCF_SET_CONN_ENCRYPT; - rq.cparam = &cp; - rq.clen = SET_CONN_ENCRYPT_CP_SIZE; - rq.event = EVT_ENCRYPT_CHANGE; - rq.rlen = EVT_ENCRYPT_CHANGE_SIZE; - rq.rparam = &rp; + cp.encrypt = encrypt; + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_SET_CONN_ENCRYPT; + rq.cparam = &cp; + rq.clen = SET_CONN_ENCRYPT_CP_SIZE; + rq.event = EVT_ENCRYPT_CHANGE; + rq.rlen = EVT_ENCRYPT_CHANGE_SIZE; + rq.rparam = &rp; + if (hci_send_req(dd, &rq, to) < 0) return -1; + if (rp.status) { errno = EIO; return -1; @@ -1212,13 +1219,13 @@ int hci_encrypt_link(int dd, uint16_t handle, int on, int to) return 0; } -int hci_switch_role(int dd, bdaddr_t peer, int role, int to) +int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to) { switch_role_cp cp; evt_role_change rp; struct hci_request rq; - cp.bdaddr = peer; + bacpy(&cp.bdaddr, bdaddr); cp.role = role; rq.ogf = OGF_LINK_POLICY; rq.ocf = OCF_SWITCH_ROLE; @@ -1227,12 +1234,15 @@ int hci_switch_role(int dd, bdaddr_t peer, int role, int to) rq.rparam = &rp; rq.rlen = EVT_ROLE_CHANGE_SIZE; rq.event = EVT_ROLE_CHANGE; + if (hci_send_req(dd, &rq, to) < 0) return -1; + if (rp.status) { errno = EIO; return -1; } + return 0; } -- cgit From 1a04074615c182634202f03fd74a73f62107b93c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 25 Oct 2004 07:36:45 +0000 Subject: Add functions for reading and writing the inquiry mode --- include/hci_lib.h | 2 ++ src/hci.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 8c321d90..e40a1afd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -88,6 +88,8 @@ int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); +int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); +int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/hci.c b/src/hci.c index ffa453f3..3ab433f0 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1305,3 +1305,54 @@ int hci_exit_park_mode(int dd, uint16_t handle, int to) return 0; } + +int hci_read_inquiry_mode(int dd, uint8_t *mode, int to) +{ + read_inquiry_mode_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_INQUIRY_MODE; + rq.rparam = &rp; + rq.rlen = READ_INQUIRY_MODE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *mode = rp.mode; + return 0; +} + +int hci_write_inquiry_mode(int dd, uint8_t mode, int to) +{ + write_inquiry_mode_cp cp; + write_inquiry_mode_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.mode = mode; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_INQUIRY_MODE; + rq.cparam = &cp; + rq.clen = WRITE_INQUIRY_MODE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_INQUIRY_MODE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} -- cgit From 11cc772e89c75f5bf58fd887befac4b88a25c91c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 26 Oct 2004 02:18:45 +0000 Subject: Add more audio/video profile translations --- src/sdp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sdp.c b/src/sdp.c index 971644ba..28fffc6f 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -74,6 +74,8 @@ static struct tupla Protocol[] = { { WSP_UUID, "WSP" }, { BNEP_UUID, "BNEP" }, { HIDP_UUID, "HIDP" }, + { AVCTP_UUID, "AVCTP" }, + { AVDTP_UUID, "AVDTP" }, { CMTP_UUID, "CMTP" }, { 0 } }; @@ -91,6 +93,8 @@ static struct tupla ServiceClass[] = { { IRMC_SYNC_CMD_SVCLASS_ID, "IrMCSync Command" }, { HEADSET_SVCLASS_ID, "Headset" }, { CORDLESS_TELEPHONY_SVCLASS_ID,"Cordless Telephony" }, + { AUDIO_SOURCE_SVCLASS_ID, "Audio Source" }, + { AUDIO_SINK_SVCLASS_ID, "Audio Sink" }, { INTERCOM_SVCLASS_ID, "Intercom" }, { FAX_SVCLASS_ID, "Fax" }, { HEADSET_AGW_SVCLASS_ID, "Headset Audio Gateway" }, @@ -118,6 +122,7 @@ static struct tupla Profile[] = { { IRMC_SYNC_CMD_PROFILE_ID, "IrMCSync Command" }, { HEADSET_PROFILE_ID, "Headset" }, { CORDLESS_TELEPHONY_PROFILE_ID, "Cordless Telephony" }, + { ADVANCED_AUDIO_PROFILE_ID, "Advanced Audio" }, { INTERCOM_PROFILE_ID, "Intercom" }, { FAX_PROFILE_ID, "Fax" }, { HEADSET_AGW_PROFILE_ID, "Headset Audio Gateway" }, -- cgit From a01d0b2417283b208e951db3a950cc0374b44b61 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 26 Oct 2004 13:36:41 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 1cd247d6..22957c7f 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -297,6 +297,8 @@ char *bt_compidtostr(int compid) return "Gennum Corporation"; case 60: return "Research In Motion"; + case 61: + return "IPextreme, Inc."; case 65535: return "internal use"; default: -- cgit From 1eccad4e5bd6f163a44e7b6e772993db5a37cf69 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 26 Oct 2004 21:30:57 +0000 Subject: Correct typo in comment --- src/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index 3ab433f0..d3892bbc 100644 --- a/src/hci.c +++ b/src/hci.c @@ -643,7 +643,7 @@ int hci_close_dev(int dd) } /* HCI functions that require open device - * dd - Device descriptor returned by hci_dev_open. */ + * dd - Device descriptor returned by hci_open_dev. */ int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param) { -- cgit From e32d72e13f1ad2b8fb9d97f99e9c2bd5f94771f9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 28 Oct 2004 10:38:41 +0000 Subject: Delete comment for a no long used parameter --- src/sdp.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 28fffc6f..05cb4e97 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2565,11 +2565,6 @@ static int copy_cstate(char *pdata, const sdp_cstate_t *cstate) * This variable is set on a successful return if there are * non-zero service handles. It is a singly linked list of * service records (sdp_record_t *) - * - * uint16_t *handleCount - * This is a pointer to a 16 bit integer, which is set to - * indicate the number of service record handles present in - * rec_list */ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num, sdp_list_t **rsp) -- cgit From e1650950c01cf268c61b332efbb9b5b3f731a158 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 29 Oct 2004 02:44:56 +0000 Subject: Add RFCOMM socket options --- include/l2cap.h | 2 +- include/rfcomm.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/l2cap.h b/include/l2cap.h index b5052dcf..e76f9020 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -48,7 +48,7 @@ struct sockaddr_l2 { bdaddr_t l2_bdaddr; }; -/* Socket options */ +/* L2CAP socket options */ #define L2CAP_OPTIONS 0x01 struct l2cap_options { uint16_t omtu; diff --git a/include/rfcomm.h b/include/rfcomm.h index bb79a7a2..8cb8ac47 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -49,6 +49,14 @@ struct sockaddr_rc { uint8_t rc_channel; }; +/* RFCOMM socket options */ +#define RFCOMM_LM 0x03 +#define RFCOMM_LM_MASTER 0x0001 +#define RFCOMM_LM_AUTH 0x0002 +#define RFCOMM_LM_ENCRYPT 0x0004 +#define RFCOMM_LM_TRUSTED 0x0008 +#define RFCOMM_LM_RELIABLE 0x0010 + /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -- cgit From 599e9c7e04dd55654ba8664ef2eba467ea0de277 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 2 Nov 2004 11:04:19 +0000 Subject: Fix bug where htonl() should be used instead of htons() --- src/sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 05cb4e97..e6035bf0 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -488,7 +488,7 @@ void sdp_set_seq_len(char *ptr, int length) case SDP_ALT32: case SDP_TEXT_STR32: case SDP_URL_STR32: - sdp_put_unaligned(htons(length), (uint32_t *)ptr); + sdp_put_unaligned(htonl(length), (uint32_t *)ptr); break; } } -- cgit From 9427f5dc51c6962692eecd7250f2a1130dbc49ad Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 4 Nov 2004 11:21:34 +0000 Subject: Add hci_change_link_key() function --- include/hci.h | 13 +++++++++++++ include/hci_lib.h | 1 + src/hci.c | 36 +++++++++++++++++++++++++++++++++--- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/include/hci.h b/include/hci.h index 00f2d21a..c8c3aa16 100644 --- a/include/hci.h +++ b/include/hci.h @@ -370,6 +370,12 @@ typedef struct { } __attribute__ ((packed)) set_conn_encrypt_cp; #define SET_CONN_ENCRYPT_CP_SIZE 3 +#define OCF_CHANGE_CONN_LINK_KEY 0x0015 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) change_conn_link_key_cp; +#define CHANGE_CONN_LINK_KEY_CP_SIZE 2 + #define OCF_REMOTE_NAME_REQ 0x0019 typedef struct { bdaddr_t bdaddr; @@ -860,6 +866,13 @@ typedef struct { } __attribute__ ((packed)) evt_encrypt_change; #define EVT_ENCRYPT_CHANGE_SIZE 5 +#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE 0x09 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) evt_change_conn_link_key_complete; +#define EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE 3 + #define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index e40a1afd..0d9867f9 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -84,6 +84,7 @@ int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); +int hci_change_link_key(int dd, uint16_t handle, int to); /* role == 0 is master, 1 is slave */ int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); diff --git a/src/hci.c b/src/hci.c index d3892bbc..23f890a6 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1174,12 +1174,13 @@ int hci_authenticate_link(int dd, uint16_t handle, int to) struct hci_request rq; cp.handle = handle; + rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_AUTH_REQUESTED; + rq.event = EVT_AUTH_COMPLETE; rq.cparam = &cp; rq.clen = AUTH_REQUESTED_CP_SIZE; rq.rparam = &rp; - rq.event = EVT_AUTH_COMPLETE; rq.rlen = EVT_AUTH_COMPLETE_SIZE; if (hci_send_req(dd, &rq, to) < 0) @@ -1201,13 +1202,14 @@ int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to) cp.handle = handle; cp.encrypt = encrypt; + rq.ogf = OGF_LINK_CTL; rq.ocf = OCF_SET_CONN_ENCRYPT; + rq.event = EVT_ENCRYPT_CHANGE; rq.cparam = &cp; rq.clen = SET_CONN_ENCRYPT_CP_SIZE; - rq.event = EVT_ENCRYPT_CHANGE; - rq.rlen = EVT_ENCRYPT_CHANGE_SIZE; rq.rparam = &rp; + rq.rlen = EVT_ENCRYPT_CHANGE_SIZE; if (hci_send_req(dd, &rq, to) < 0) return -1; @@ -1216,6 +1218,34 @@ int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to) errno = EIO; return -1; } + + return 0; +} + +int hci_change_link_key(int dd, uint16_t handle, int to) +{ + change_conn_link_key_cp cp; + evt_change_conn_link_key_complete rp; + struct hci_request rq; + + cp.handle = handle; + + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_CHANGE_CONN_LINK_KEY; + rq.event = EVT_CHANGE_CONN_LINK_KEY_COMPLETE; + rq.cparam = &cp; + rq.clen = CHANGE_CONN_LINK_KEY_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + return 0; } -- cgit From 52e03fab5cb877505e6a4c391b5b0456726ed162 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 8 Nov 2004 13:37:59 +0000 Subject: Add version identifier for Bluetooth 2.0 --- src/hci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hci.c b/src/hci.c index 23f890a6..5895563e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -312,9 +312,10 @@ int hci_strtolm(char *str, unsigned int *val) /* Version mapping */ static hci_map ver_map[] = { - { "1.0b", 0x00 }, - { "1.1", 0x01 }, - { "1.2", 0x02 }, + { "1.0b", 0x00 }, + { "1.1", 0x01 }, + { "1.2", 0x02 }, + { "2.0", 0x03 }, { NULL } }; -- cgit From 34fb9e62566cddafd8d4fea40e368434859ae25a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 8 Nov 2004 21:51:52 +0000 Subject: Change HCI_KEY_MISSING to HCI_PIN_OR_KEY_MISSING --- include/hci.h | 2 +- src/bluetooth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hci.h b/include/hci.h index c8c3aa16..2f959fe2 100644 --- a/include/hci.h +++ b/include/hci.h @@ -150,7 +150,7 @@ enum { #define HCI_HARDWARE_FAILURE 0x03 #define HCI_PAGE_TIMEOUT 0x04 #define HCI_AUTHENTICATION_FAILURE 0x05 -#define HCI_KEY_MISSING 0x06 +#define HCI_PIN_OR_KEY_MISSING 0x06 #define HCI_MEMORY_FULL 0x07 #define HCI_CONNECTION_TIMEOUT 0x08 #define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09 diff --git a/src/bluetooth.c b/src/bluetooth.c index 22957c7f..00639d2d 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -121,7 +121,7 @@ int bt_error(uint16_t code) return EHOSTDOWN; case HCI_AUTHENTICATION_FAILURE: return EACCES; - case HCI_KEY_MISSING: + case HCI_PIN_OR_KEY_MISSING: return EINVAL; case HCI_MEMORY_FULL: return ENOMEM; -- cgit From c3b2524a78dc4d27025f6cd3c8f4c56f5de012ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 00:05:01 +0000 Subject: Add the missing HCI error codes --- include/hci.h | 9 +++++++++ src/bluetooth.c | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 2f959fe2..e7f04596 100644 --- a/include/hci.h +++ b/include/hci.h @@ -186,6 +186,15 @@ enum { #define HCI_QOS_NOT_SUPPORTED 0x27 #define HCI_INSTANT_PASSED 0x28 #define HCI_PAIRING_NOT_SUPPORTED 0x29 +#define HCI_TRANSACTION_COLLISION 0x2a +#define HCI_QOS_UNACCEPTABLE_PARAMETER 0x2c +#define HCI_QOS_REJECTED 0x2d +#define HCI_CLASSIFICATION_NOT_SUPPORTED 0x2e +#define HCI_INSUFFICIENT_SECURITY 0x2f +#define HCI_PARAMETER_OUT_OF_RANGE 0x30 +#define HCI_ROLE_SWITCH_PENDING 0x32 +#define HCI_SLOT_VIOLATION 0x34 +#define HCI_ROLE_SWITCH_FAILED 0x35 /* ACL flags */ #define ACL_CONT 0x01 diff --git a/src/bluetooth.c b/src/bluetooth.c index 00639d2d..20a1aee6 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -133,19 +133,25 @@ int bt_error(uint16_t code) case HCI_ACL_CONNECTION_EXISTS: return EALREADY; case HCI_COMMAND_DISALLOWED: + case HCI_TRANSACTION_COLLISION: + case HCI_ROLE_SWITCH_PENDING: return EBUSY; case HCI_REJECTED_LIMITED_RESOURCES: - case HCI_REJECTED_SECURITY: case HCI_REJECTED_PERSONAL: + case HCI_QOS_REJECTED: return ECONNREFUSED; case HCI_HOST_TIMEOUT: return ETIMEDOUT; case HCI_UNSUPPORTED_FEATURE: case HCI_QOS_NOT_SUPPORTED: case HCI_PAIRING_NOT_SUPPORTED: + case HCI_CLASSIFICATION_NOT_SUPPORTED: case HCI_UNSUPPORTED_LMP_PARAMETER_VALUE: + case HCI_PARAMETER_OUT_OF_RANGE: + case HCI_QOS_UNACCEPTABLE_PARAMETER: return EOPNOTSUPP; case HCI_INVALID_PARAMETERS: + case HCI_SLOT_VIOLATION: return EINVAL; case HCI_OE_USER_ENDED_CONNECTION: case HCI_OE_LOW_RESOURCES: @@ -155,7 +161,9 @@ int bt_error(uint16_t code) return ECONNABORTED; case HCI_REPEATED_ATTEMPTS: return ELOOP; + case HCI_REJECTED_SECURITY: case HCI_PAIRING_NOT_ALLOWED: + case HCI_INSUFFICIENT_SECURITY: return EACCES; case HCI_UNSUPPORTED_REMOTE_FEATURE: return EPROTONOSUPPORT; -- cgit From 5106bfbab293c6168eeb0f036a37efc548a632b4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 12:46:34 +0000 Subject: Add definition for the SECURE link mode --- include/hci.h | 1 + include/l2cap.h | 1 + include/rfcomm.h | 1 + 3 files changed, 3 insertions(+) diff --git a/include/hci.h b/include/hci.h index e7f04596..5e874e07 100644 --- a/include/hci.h +++ b/include/hci.h @@ -267,6 +267,7 @@ enum { #define HCI_LM_ENCRYPT 0x0004 #define HCI_LM_TRUSTED 0x0008 #define HCI_LM_RELIABLE 0x0010 +#define HCI_LM_SECURE 0x0020 /* ----- HCI Commands ----- */ diff --git a/include/l2cap.h b/include/l2cap.h index e76f9020..025d0f66 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -67,6 +67,7 @@ struct l2cap_conninfo { #define L2CAP_LM_ENCRYPT 0x0004 #define L2CAP_LM_TRUSTED 0x0008 #define L2CAP_LM_RELIABLE 0x0010 +#define L2CAP_LM_SECURE 0x0020 #define L2CAP_QOS 0x04 struct l2cap_qos { diff --git a/include/rfcomm.h b/include/rfcomm.h index 8cb8ac47..02775d50 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -56,6 +56,7 @@ struct sockaddr_rc { #define RFCOMM_LM_ENCRYPT 0x0004 #define RFCOMM_LM_TRUSTED 0x0008 #define RFCOMM_LM_RELIABLE 0x0010 +#define RFCOMM_LM_SECURE 0x0020 /* RFCOMM TTY support */ #define RFCOMM_MAX_DEV 256 -- cgit From 0bae50cd5c691f338f6fa820a8b803a45c0de181 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 21:33:17 +0000 Subject: Add hci_{read|write}_afh_mode() functions --- include/hci_lib.h | 2 ++ src/hci.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 0d9867f9..356e4edd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -91,6 +91,8 @@ int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_i int hci_exit_park_mode(int dd, uint16_t handle, int to); int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); +int hci_read_afh_mode(int dd, uint8_t *mode, int to); +int hci_write_afh_mode(int dd, uint8_t mode, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/hci.c b/src/hci.c index 5895563e..9ebd5a23 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1387,3 +1387,54 @@ int hci_write_inquiry_mode(int dd, uint8_t mode, int to) return 0; } + +int hci_read_afh_mode(int dd, uint8_t *mode, int to) +{ + read_afh_mode_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_AFH_MODE; + rq.rparam = &rp; + rq.rlen = READ_AFH_MODE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *mode = rp.mode; + return 0; +} + +int hci_write_afh_mode(int dd, uint8_t mode, int to) +{ + write_afh_mode_cp cp; + write_afh_mode_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.mode = mode; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_AFH_MODE; + rq.cparam = &cp; + rq.clen = WRITE_AFH_MODE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_AFH_MODE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} -- cgit From 213febe584cdd8c7b5fd2defc2d56f0c84677e51 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 22:29:55 +0000 Subject: Add hci_read_afh_map() function --- include/hci_lib.h | 1 + src/hci.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 356e4edd..095a0b80 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -93,6 +93,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/hci.c b/src/hci.c index 9ebd5a23..ee8dce2f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1438,3 +1438,29 @@ int hci_write_afh_mode(int dd, uint8_t mode, int to) return 0; } + +int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to) +{ + read_afh_map_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_STATUS_PARAM; + rq.ocf = OCF_READ_AFH_MAP; + rq.cparam = &handle; + rq.clen = 2; + rq.rparam = &rp; + rq.rlen = READ_AFH_MAP_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *mode = rp.mode; + memcpy(map, rp.map, 10); + return 0; +} -- cgit From 0792c0b319112503dd5129f05536f3c6ae4c746c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 9 Nov 2004 22:52:40 +0000 Subject: Add hci_set_afh_classification() function --- include/hci.h | 10 ++++++++++ include/hci_lib.h | 1 + src/hci.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/include/hci.h b/include/hci.h index 5e874e07..683c988f 100644 --- a/include/hci.h +++ b/include/hci.h @@ -694,6 +694,16 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_SET_AFH_CLASSIFICATION 0x003F +typedef struct { + uint8_t map[10]; +} __attribute__ ((packed)) set_afh_classification_cp; +#define SET_AFH_CLASSIFICATION_CP_SIZE 10 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) set_afh_classification_rp; +#define SET_AFH_CLASSIFICATION_RP_SIZE 1 + #define OCF_READ_INQUIRY_MODE 0x0044 typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index 095a0b80..b8dbd432 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -93,6 +93,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_set_afh_classification(int dd, uint8_t *map, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); diff --git a/src/hci.c b/src/hci.c index ee8dce2f..19ee3c4c 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1439,6 +1439,34 @@ int hci_write_afh_mode(int dd, uint8_t mode, int to) return 0; } +int hci_set_afh_classification(int dd, uint8_t *map, int to) +{ + set_afh_classification_cp cp; + set_afh_classification_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + memcpy(cp.map, map, 10); + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_SET_AFH_CLASSIFICATION; + rq.cparam = &cp; + rq.clen = SET_AFH_CLASSIFICATION_CP_SIZE; + rq.rparam = &rp; + rq.rlen = SET_AFH_CLASSIFICATION_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} + int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to) { read_afh_map_rp rp; -- cgit From 9dbfdb30dc538930eadd36df65917b1e68f7558a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 11 Nov 2004 18:03:20 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 414c7b53..fad7b418 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:10:0 +libbluetooth_la_LDFLAGS = -version-info 1:11:0 INCLUDES = -I$(top_builddir)/include -- cgit From 482415a6c4907713f531f29ab3b804ba75d788e8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 11 Nov 2004 18:12:18 +0000 Subject: Update changelog and bump version number --- ChangeLog | 13 +++++++++++++ configure.in | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7f341c88..73a15640 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +ver 2.11: + Initial support for the kernel security manager. + Use bit zero for vendor packets in the filter type bitmask. + Add SIM Access types for service discovery. + Add more audio/video profile translations. + Add another company identifier. + Add the missing HCI error codes. + Add RFCOMM socket options. + Add definition for the SECURE link mode. + Add functions for reading and writing the inquiry mode. + Add functions for AFH related settings and information. + Add version identifier for the Bluetooth 2.0 specification. + ver 2.10: Fix and extend the unaligned access macros. Make compiling with debug information optional. diff --git a/configure.in b/configure.in index 82b4e724..765b6896 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.10) +AM_INIT_AUTOMAKE(bluez-libs, 2.11) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 113e48df05d54510646b3dcf33a1df2c60e3461f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Nov 2004 12:54:41 +0000 Subject: The cnum value must be uint32_t to match the kernel interface --- include/cmtp.h | 2 +- include/hidp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cmtp.h b/include/cmtp.h index f0981f2d..3f8e943c 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -63,7 +63,7 @@ struct cmtp_conninfo { }; struct cmtp_connlist_req { - uint16_t cnum; + uint32_t cnum; struct cmtp_conninfo *ci; }; diff --git a/include/hidp.h b/include/hidp.h index 21b62513..7f27fde1 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -79,7 +79,7 @@ struct hidp_conninfo { }; struct hidp_connlist_req { - uint16_t cnum; + uint32_t cnum; struct hidp_conninfo *ci; }; -- cgit From 518528c36107e8ea6d11b59c97e241f2fec208f3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 23 Nov 2004 06:46:40 +0000 Subject: Add simple AM_PATH_BLUEZ macro --- Makefile.am | 6 ++++++ bluez.m4 | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 bluez.m4 diff --git a/Makefile.am b/Makefile.am index c3075ae1..4dbfb31a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,12 @@ SUBDIRS = include src +aclocaldir = $(datadir)/aclocal + +aclocal_DATA = bluez.m4 + +EXTRA_DIST = $(aclocal_DATA) + pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = bluez.pc diff --git a/bluez.m4 b/bluez.m4 new file mode 100644 index 00000000..abcbaae2 --- /dev/null +++ b/bluez.m4 @@ -0,0 +1,11 @@ +dnl +dnl $Id$ +dnl + +AC_DEFUN([AM_PATH_BLUEZ], [ + BLUEZ_CFLAGS="" + BLUEZ_LIBS="-lbluetooth" + + AC_SUBST(BLUEZ_CFLAGS) + AC_SUBST(BLUEZ_LIBS) +]) -- cgit From 0ea7064b34d9f03e9aa7d8abeb7c0e6bcc8a37ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 29 Nov 2004 03:48:21 +0000 Subject: Add service classes and profile ids for WAP --- include/sdp.h | 4 ++++ src/sdp.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index 7c529de1..712e42e7 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -95,6 +95,8 @@ extern "C" { #define INTERCOM_SVCLASS_ID 0x1110 #define FAX_SVCLASS_ID 0x1111 #define HEADSET_AGW_SVCLASS_ID 0x1112 +#define WAP_SVCLASS_ID 0x1113 +#define WAP_CLIENT_SVCLASS_ID 0x1114 #define PANU_SVCLASS_ID 0x1115 #define NAP_SVCLASS_ID 0x1116 #define GN_SVCLASS_ID 0x1117 @@ -133,6 +135,8 @@ extern "C" { #define INTERCOM_PROFILE_ID 0x1110 #define FAX_PROFILE_ID 0x1111 #define HEADSET_AGW_PROFILE_ID 0x1112 +#define WAP_PROFILE_ID 0x1113 +#define WAP_CLIENT_PROFILE_ID 0x1114 #define PANU_PROFILE_ID 0x1115 #define NAP_PROFILE_ID 0x1116 #define GN_PROFILE_ID 0x1117 diff --git a/src/sdp.c b/src/sdp.c index e6035bf0..a830cf8b 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -98,6 +98,8 @@ static struct tupla ServiceClass[] = { { INTERCOM_SVCLASS_ID, "Intercom" }, { FAX_SVCLASS_ID, "Fax" }, { HEADSET_AGW_SVCLASS_ID, "Headset Audio Gateway" }, + { WAP_SVCLASS_ID, "WAP" }, + { WAP_CLIENT_SVCLASS_ID, "WAP Client" }, { PNP_INFO_SVCLASS_ID, "PnP Information" }, { GENERIC_NETWORKING_SVCLASS_ID,"Generic Networking" }, { GENERIC_FILETRANS_SVCLASS_ID, "Generic File Transfer" }, @@ -126,6 +128,8 @@ static struct tupla Profile[] = { { INTERCOM_PROFILE_ID, "Intercom" }, { FAX_PROFILE_ID, "Fax" }, { HEADSET_AGW_PROFILE_ID, "Headset Audio Gateway" }, + { WAP_PROFILE_ID, "WAP" }, + { WAP_CLIENT_PROFILE_ID, "WAP Client" }, { PANU_PROFILE_ID, "PAN user" }, { NAP_PROFILE_ID, "PAN access point" }, { GN_PROFILE_ID, "PAN group network" }, -- cgit From 603532d2b4141998d2c943c0b5f4077e27f6060f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 1 Dec 2004 14:48:16 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index fad7b418..d805a0ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:11:0 +libbluetooth_la_LDFLAGS = -version-info 1:12:0 INCLUDES = -I$(top_builddir)/include -- cgit From 027ee4fcad36b7f6926fecef47a449038eefdbc5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 2 Dec 2004 08:36:05 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 73a15640..b7a293b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 2.12: + Correct kernel interface for CMTP and HIDP support. + Add service classes and profile ids for WAP. + Add simple AM_PATH_BLUEZ macro. + ver 2.11: Initial support for the kernel security manager. Use bit zero for vendor packets in the filter type bitmask. diff --git a/configure.in b/configure.in index 765b6896..d44f85cf 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.11) +AM_INIT_AUTOMAKE(bluez-libs, 2.12) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 6864c723272d4790a2fec4a1c23fa5e46ac15e5f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Dec 2004 11:29:58 +0000 Subject: Update the UUID constants and its translations --- include/sdp.h | 126 ++++++++++++++++++++++++++++++++------------- src/sdp.c | 160 ++++++++++++++++++++++++++++++++-------------------------- 2 files changed, 179 insertions(+), 107 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 712e42e7..8f832ea6 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -54,26 +54,27 @@ extern "C" { * Protocol UUIDs */ #define SDP_UUID 0x0001 -#define RFCOMM_UUID 0x0003 -#define TCS_BIN_UUID 0x0005 -#define L2CAP_UUID 0x0100 -#define IP_UUID 0x0009 #define UDP_UUID 0x0002 +#define RFCOMM_UUID 0x0003 #define TCP_UUID 0x0004 #define TCS_BIN_UUID 0x0005 #define TCS_AT_UUID 0x0006 #define OBEX_UUID 0x0008 -#define FTP_UUID 0x000A -#define HTTP_UUID 0x000C -#define WSP_UUID 0x000E -#define BNEP_UUID 0x000F +#define IP_UUID 0x0009 +#define FTP_UUID 0x000a +#define HTTP_UUID 0x000c +#define WSP_UUID 0x000e +#define BNEP_UUID 0x000f +#define UPNP_UUID 0x0010 #define HIDP_UUID 0x0011 #define HCRP_CTRL_UUID 0x0012 #define HCRP_DATA_UUID 0x0014 #define HCRP_NOTE_UUID 0x0016 #define AVCTP_UUID 0x0017 #define AVDTP_UUID 0x0019 -#define CMTP_UUID 0x001B +#define CMTP_UUID 0x001b +#define UDI_UUID 0x001d +#define L2CAP_UUID 0x0100 /* * Service class identifiers of standard services and service groups @@ -92,6 +93,10 @@ extern "C" { #define CORDLESS_TELEPHONY_SVCLASS_ID 0x1109 #define AUDIO_SOURCE_SVCLASS_ID 0x110a #define AUDIO_SINK_SVCLASS_ID 0x110b +#define AV_REMOTE_TARGET_SVCLASS_ID 0x110c +#define ADVANCED_AUDIO_SVCLASS_ID 0x110d +#define AV_REMOTE_SVCLASS_ID 0x110e +#define VIDEO_CONF_SVCLASS_ID 0x110f #define INTERCOM_SVCLASS_ID 0x1110 #define FAX_SVCLASS_ID 0x1111 #define HEADSET_AGW_SVCLASS_ID 0x1112 @@ -100,21 +105,38 @@ extern "C" { #define PANU_SVCLASS_ID 0x1115 #define NAP_SVCLASS_ID 0x1116 #define GN_SVCLASS_ID 0x1117 +#define DIRECT_PRINTING_SVCLASS_ID 0x1118 +#define REFERENCE_PRINTING_SVCLASS_ID 0x1119 #define IMAGING_SVCLASS_ID 0x111a #define IMAGING_RESPONDER_SVCLASS_ID 0x111b +#define IMAGING_ARCHIVE_SVCLASS_ID 0x111c +#define IMAGING_REFOBJS_SVCLASS_ID 0x111d #define HANDSFREE_SVCLASS_ID 0x111e -#define HANDSFREE_AUDIO_GW_SVCLASS_ID 0x111f +#define HANDSFREE_AGW_SVCLASS_ID 0x111f +#define DIRECT_PRT_REFOBJS_SVCLASS_ID 0x1120 +#define REFLECTED_UI_SVCLASS_ID 0x1121 +#define BASIC_PRINTING_SVCLASS_ID 0x1122 +#define PRINTING_STATUS_SVCLASS_ID 0x1123 #define HID_SVCLASS_ID 0x1124 #define HCR_SVCLASS_ID 0x1125 #define HCR_PRINT_SVCLASS_ID 0x1126 #define HCR_SCAN_SVCLASS_ID 0x1127 #define CIP_SVCLASS_ID 0x1128 +#define VIDEO_CONF_GW_SVCLASS_ID 0x1129 +#define UDI_MT_SVCLASS_ID 0x112a +#define UDI_TA_SVCLASS_ID 0x112b +#define AV_SVCLASS_ID 0x112c #define SAP_SVCLASS_ID 0x112d #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 #define GENERIC_AUDIO_SVCLASS_ID 0x1203 #define GENERIC_TELEPHONY_SVCLASS_ID 0x1204 +#define UPNP_SVCLASS_ID 0x1205 +#define UPNP_IP_SVCLASS_ID 0x1206 +#define UPNP_PAN_SVCLASS_ID 0x1300 +#define UPNP_LAP_SVCLASS_ID 0x1301 +#define UPNP_L2CAP_SVCLASS_ID 0x1302 #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 @@ -122,31 +144,65 @@ extern "C" { * Standard profile descriptor identifiers; note these * may be identical to some of the service classes defined above */ -#define SERIAL_PORT_PROFILE_ID 0x1101 -#define LAN_ACCESS_PROFILE_ID 0x1102 -#define DIALUP_NET_PROFILE_ID 0x1103 -#define IRMC_SYNC_PROFILE_ID 0x1104 -#define OBEX_OBJPUSH_PROFILE_ID 0x1105 -#define OBEX_FILETRANS_PROFILE_ID 0x1106 -#define IRMC_SYNC_CMD_PROFILE_ID 0x1107 -#define HEADSET_PROFILE_ID 0x1108 -#define CORDLESS_TELEPHONY_PROFILE_ID 0x1109 -#define ADVANCED_AUDIO_PROFILE_ID 0x110d -#define INTERCOM_PROFILE_ID 0x1110 -#define FAX_PROFILE_ID 0x1111 -#define HEADSET_AGW_PROFILE_ID 0x1112 -#define WAP_PROFILE_ID 0x1113 -#define WAP_CLIENT_PROFILE_ID 0x1114 -#define PANU_PROFILE_ID 0x1115 -#define NAP_PROFILE_ID 0x1116 -#define GN_PROFILE_ID 0x1117 -#define IMAGING_PROFILE_ID 0x111a -#define IMAGING_RESPONDER_PROFILE_ID 0x111b -#define HANDSFREE_PROFILE_ID 0x111e -#define HID_PROFILE_ID 0x1124 -#define HCR_PROFILE_ID 0x1125 -#define CIP_PROFILE_ID 0x1128 -#define SAP_PROFILE_ID 0x112d +#define SDP_SERVER_PROFILE_ID SDP_SERVER_SVCLASS_ID +#define BROWSE_GRP_DESC_PROFILE_ID BROWSE_GRP_DESC_SVCLASS_ID +#define SERIAL_PORT_PROFILE_ID SERIAL_PORT_SVCLASS_ID +#define LAN_ACCESS_PROFILE_ID LAN_ACCESS_SVCLASS_ID +#define DIALUP_NET_PROFILE_ID DIALUP_NET_SVCLASS_ID +#define IRMC_SYNC_PROFILE_ID IRMC_SYNC_SVCLASS_ID +#define OBEX_OBJPUSH_PROFILE_ID OBEX_OBJPUSH_SVCLASS_ID +#define OBEX_FILETRANS_PROFILE_ID OBEX_FILETRANS_SVCLASS_ID +#define IRMC_SYNC_CMD_PROFILE_ID IRMC_SYNC_CMD_SVCLASS_ID +#define HEADSET_PROFILE_ID HEADSET_SVCLASS_ID +#define CORDLESS_TELEPHONY_PROFILE_ID CORDLESS_TELEPHONY_SVCLASS_ID +#define AUDIO_SOURCE_PROFILE_ID AUDIO_SOURCE_SVCLASS_ID +#define AUDIO_SINK_PROFILE_ID AUDIO_SINK_SVCLASS_ID +#define AV_REMOTE_TARGET_PROFILE_ID AV_REMOTE_TARGET_SVCLASS_ID +#define ADVANCED_AUDIO_PROFILE_ID ADVANCED_AUDIO_SVCLASS_ID +#define AV_REMOTE_PROFILE_ID AV_REMOTE_SVCLASS_ID +#define VIDEO_CONF_PROFILE_ID VIDEO_CONF_SVCLASS_ID +#define INTERCOM_PROFILE_ID INTERCOM_SVCLASS_ID +#define FAX_PROFILE_ID FAX_SVCLASS_ID +#define HEADSET_AGW_PROFILE_ID HEADSET_AGW_SVCLASS_ID +#define WAP_PROFILE_ID WAP_SVCLASS_ID +#define WAP_CLIENT_PROFILE_ID WAP_CLIENT_SVCLASS_ID +#define PANU_PROFILE_ID PANU_SVCLASS_ID +#define NAP_PROFILE_ID NAP_SVCLASS_ID +#define GN_PROFILE_ID GN_SVCLASS_ID +#define DIRECT_PRINTING_PROFILE_ID DIRECT_PRINTING_SVCLASS_ID +#define REFERENCE_PRINTING_PROFILE_ID REFERENCE_PRINTING_SVCLASS_ID +#define IMAGING_PROFILE_ID IMAGING_SVCLASS_ID +#define IMAGING_RESPONDER_PROFILE_ID IMAGING_RESPONDER_SVCLASS_ID +#define IMAGING_ARCHIVE_PROFILE_ID IMAGING_ARCHIVE_SVCLASS_ID +#define IMAGING_REFOBJS_PROFILE_ID IMAGING_REFOBJS_SVCLASS_ID +#define HANDSFREE_PROFILE_ID HANDSFREE_SVCLASS_ID +#define HANDSFREE_AGW_PROFILE_ID HANDSFREE_AGW_SVCLASS_ID +#define DIRECT_PRT_REFOBJS_PROFILE_ID DIRECT_PRT_REFOBJS_SVCLASS_ID +#define REFLECTED_UI_PROFILE_ID REFLECTED_UI_SVCLASS_ID +#define BASIC_PRINTING_PROFILE_ID BASIC_PRINTING_SVCLASS_ID +#define PRINTING_STATUS_PROFILE_ID PRINTING_STATUS_SVCLASS_ID +#define HID_PROFILE_ID HID_SVCLASS_ID +#define HCR_PROFILE_ID HCR_SCAN_SVCLASS_ID +#define HCR_PRINT_PROFILE_ID HCR_PRINT_SVCLASS_ID +#define HCR_SCAN_PROFILE_ID HCR_SCAN_SVCLASS_ID +#define CIP_PROFILE_ID CIP_SVCLASS_ID +#define VIDEO_CONF_GW_PROFILE_ID VIDEO_CONF_GW_SVCLASS_ID +#define UDI_MT_PROFILE_ID UDI_MT_SVCLASS_ID +#define UDI_TA_PROFILE_ID UDI_TA_SVCLASS_ID +#define AV_PROFILE_ID AV_SVCLASS_ID +#define SAP_PROFILE_ID SAP_SVCLASS_ID +#define PNP_INFO_PROFILE_ID PNP_INFO_SVCLASS_ID +#define GENERIC_NETWORKING_PROFILE_ID GENERIC_NETWORKING_SVCLASS_ID +#define GENERIC_FILETRANS_PROFILE_ID GENERIC_FILETRANS_SVCLASS_ID +#define GENERIC_AUDIO_PROFILE_ID GENERIC_AUDIO_SVCLASS_ID +#define GENERIC_TELEPHONY_PROFILE_ID GENERIC_TELEPHONY_SVCLASS_ID +#define UPNP_PROFILE_ID UPNP_SVCLASS_ID +#define UPNP_IP_PROFILE_ID UPNP_IP_SVCLASS_ID +#define UPNP_PAN_PROFILE_ID UPNP_PAN_SVCLASS_ID +#define UPNP_LAP_PROFILE_ID UPNP_LAP_SVCLASS_ID +#define UPNP_L2CAP_PROFILE_ID UPNP_L2CAP_SVCLASS_ID +#define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID +#define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID /* * Attribute identifier codes diff --git a/src/sdp.c b/src/sdp.c index a830cf8b..7c3bd7d7 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -60,91 +60,105 @@ struct tupla { }; static struct tupla Protocol[] = { - { SDP_UUID, "SDP" }, - { RFCOMM_UUID, "RFCOMM" }, - { TCS_BIN_UUID, "TCS-BIN" }, - { L2CAP_UUID, "L2CAP" }, - { IP_UUID, "IP" }, - { UDP_UUID, "UDP" }, - { TCP_UUID, "TCP" }, - { TCS_AT_UUID, "TCS-AT" }, - { OBEX_UUID, "OBEX" }, - { FTP_UUID, "FTP" }, - { HTTP_UUID, "HTTP" }, - { WSP_UUID, "WSP" }, - { BNEP_UUID, "BNEP" }, - { HIDP_UUID, "HIDP" }, - { AVCTP_UUID, "AVCTP" }, - { AVDTP_UUID, "AVDTP" }, - { CMTP_UUID, "CMTP" }, + { SDP_UUID, "SDP" }, + { UDP_UUID, "UDP" }, + { RFCOMM_UUID, "RFCOMM" }, + { TCP_UUID, "TCP" }, + { TCS_BIN_UUID, "TCS-BIN" }, + { TCS_AT_UUID, "TCS-AT" }, + { OBEX_UUID, "OBEX" }, + { IP_UUID, "IP" }, + { FTP_UUID, "FTP" }, + { HTTP_UUID, "HTTP" }, + { WSP_UUID, "WSP" }, + { BNEP_UUID, "BNEP" }, + { UPNP_UUID, "UPNP" }, + { HIDP_UUID, "HIDP" }, + { HCRP_CTRL_UUID, "HCRP-Ctrl" }, + { HCRP_DATA_UUID, "HCRP-Data" }, + { HCRP_NOTE_UUID, "HCRP-Notify" }, + { AVCTP_UUID, "AVCTP" }, + { AVDTP_UUID, "AVDTP" }, + { CMTP_UUID, "CMTP" }, + { UDI_UUID, "UDI" }, + { L2CAP_UUID, "L2CAP" }, { 0 } }; static struct tupla ServiceClass[] = { - { SDP_SERVER_SVCLASS_ID, "SDP Server" }, - { BROWSE_GRP_DESC_SVCLASS_ID, "Browse Group Descriptor" }, - { PUBLIC_BROWSE_GROUP, "Public Browse Group" }, - { SERIAL_PORT_SVCLASS_ID, "Serial Port" }, - { LAN_ACCESS_SVCLASS_ID, "LAN Access Using PPP" }, - { DIALUP_NET_SVCLASS_ID, "Dialup Networking" }, - { IRMC_SYNC_SVCLASS_ID, "IrMCSync" }, - { OBEX_OBJPUSH_SVCLASS_ID, "OBEX Object Push" }, - { OBEX_FILETRANS_SVCLASS_ID, "OBEX File Transfer" }, - { IRMC_SYNC_CMD_SVCLASS_ID, "IrMCSync Command" }, - { HEADSET_SVCLASS_ID, "Headset" }, - { CORDLESS_TELEPHONY_SVCLASS_ID,"Cordless Telephony" }, - { AUDIO_SOURCE_SVCLASS_ID, "Audio Source" }, - { AUDIO_SINK_SVCLASS_ID, "Audio Sink" }, - { INTERCOM_SVCLASS_ID, "Intercom" }, - { FAX_SVCLASS_ID, "Fax" }, - { HEADSET_AGW_SVCLASS_ID, "Headset Audio Gateway" }, - { WAP_SVCLASS_ID, "WAP" }, - { WAP_CLIENT_SVCLASS_ID, "WAP Client" }, - { PNP_INFO_SVCLASS_ID, "PnP Information" }, - { GENERIC_NETWORKING_SVCLASS_ID,"Generic Networking" }, - { GENERIC_FILETRANS_SVCLASS_ID, "Generic File Transfer" }, - { GENERIC_AUDIO_SVCLASS_ID, "Generic Audio" }, - { GENERIC_TELEPHONY_SVCLASS_ID, "Generic Telephony" }, - { PANU_SVCLASS_ID, "PAN user" }, - { NAP_SVCLASS_ID, "Network access point" }, - { GN_SVCLASS_ID, "PAN group network" }, - { HID_SVCLASS_ID, "Human Interface Device" }, - { CIP_SVCLASS_ID, "Common ISDN Access" }, - { SAP_SVCLASS_ID, "SIM Access" }, + { SDP_SERVER_SVCLASS_ID, "SDP Server" }, + { BROWSE_GRP_DESC_SVCLASS_ID, "Browse Group Descriptor" }, + { PUBLIC_BROWSE_GROUP, "Public Browse Group" }, + { SERIAL_PORT_SVCLASS_ID, "Serial Port" }, + { LAN_ACCESS_SVCLASS_ID, "LAN Access Using PPP" }, + { DIALUP_NET_SVCLASS_ID, "Dialup Networking" }, + { IRMC_SYNC_SVCLASS_ID, "IrMC Sync" }, + { OBEX_OBJPUSH_SVCLASS_ID, "OBEX Object Push" }, + { OBEX_FILETRANS_SVCLASS_ID, "OBEX File Transfer" }, + { IRMC_SYNC_CMD_SVCLASS_ID, "IrMC Sync Command" }, + { HEADSET_SVCLASS_ID, "Headset" }, + { CORDLESS_TELEPHONY_SVCLASS_ID, "Cordless Telephony" }, + { AUDIO_SOURCE_SVCLASS_ID, "Audio Source" }, + { AUDIO_SINK_SVCLASS_ID, "Audio Sink" }, + { AV_REMOTE_TARGET_SVCLASS_ID, "AV Remote Target" }, + { ADVANCED_AUDIO_SVCLASS_ID, "Advanced Audio" }, + { AV_REMOTE_SVCLASS_ID, "AV Remote" }, + { VIDEO_CONF_SVCLASS_ID, "Video Conferencing" }, + { INTERCOM_SVCLASS_ID, "Intercom" }, + { FAX_SVCLASS_ID, "Fax" }, + { HEADSET_AGW_SVCLASS_ID, "Headset Audio Gateway" }, + { WAP_SVCLASS_ID, "WAP" }, + { WAP_CLIENT_SVCLASS_ID, "WAP Client" }, + { PANU_SVCLASS_ID, "PAN User" }, + { NAP_SVCLASS_ID, "Network Access Point" }, + { GN_SVCLASS_ID, "PAN Group Network" }, + { DIRECT_PRINTING_SVCLASS_ID, "Direct Printing" }, + { REFERENCE_PRINTING_SVCLASS_ID, "Reference Printing" }, + { IMAGING_SVCLASS_ID, "Imaging" }, + { IMAGING_RESPONDER_SVCLASS_ID, "Imaging Responder" }, + { IMAGING_ARCHIVE_SVCLASS_ID, "Imaging Automatic Archive" }, + { IMAGING_REFOBJS_SVCLASS_ID, "Imaging Referenced Objects" }, + { HANDSFREE_SVCLASS_ID, "Handsfree" }, + { HANDSFREE_AGW_SVCLASS_ID, "Handfree Audio Gateway" }, + { DIRECT_PRT_REFOBJS_SVCLASS_ID, "Direct Printing Ref. Objects" }, + { REFLECTED_UI_SVCLASS_ID, "Reflected UI" }, + { BASIC_PRINTING_SVCLASS_ID, "Basic Printing" }, + { PRINTING_STATUS_SVCLASS_ID, "Printing Status" }, + { HID_SVCLASS_ID, "Human Interface Device" }, + { HCR_SVCLASS_ID, "Hardcopy Cable Replacement" }, + { HCR_PRINT_SVCLASS_ID, "HCR Print" }, + { HCR_SCAN_SVCLASS_ID, "HCR Scan" }, + { CIP_SVCLASS_ID, "Common ISDN Access" }, + { VIDEO_CONF_GW_SVCLASS_ID, "Video Conferencing Gateway" }, + { UDI_MT_SVCLASS_ID, "UDI MT" }, + { UDI_TA_SVCLASS_ID, "UDI TA" }, + { AV_SVCLASS_ID, "Audio/Video" }, + { SAP_SVCLASS_ID, "SIM Access" }, + { PNP_INFO_SVCLASS_ID, "PnP Information" }, + { GENERIC_NETWORKING_SVCLASS_ID, "Generic Networking" }, + { GENERIC_FILETRANS_SVCLASS_ID, "Generic File Transfer" }, + { GENERIC_AUDIO_SVCLASS_ID, "Generic Audio" }, + { GENERIC_TELEPHONY_SVCLASS_ID, "Generic Telephony" }, + { UPNP_SVCLASS_ID, "UPnP" }, + { UPNP_IP_SVCLASS_ID, "UPnP IP" }, + { UPNP_PAN_SVCLASS_ID, "UPnP PAN" }, + { UPNP_LAP_SVCLASS_ID, "UPnP LAP" }, + { UPNP_L2CAP_SVCLASS_ID, "UPnP L2CAP" }, + { VIDEO_SOURCE_SVCLASS_ID, "Video Source" }, + { VIDEO_SINK_SVCLASS_ID, "Video Sink" }, { 0 } }; -static struct tupla Profile[] = { - { SERIAL_PORT_PROFILE_ID, "Serial Port" }, - { LAN_ACCESS_PROFILE_ID, "LAN Access Using PPP" }, - { DIALUP_NET_PROFILE_ID, "Dialup Networking" }, - { IRMC_SYNC_PROFILE_ID, "IrMCSync" }, - { OBEX_OBJPUSH_PROFILE_ID, "OBEX Object Push" }, - { OBEX_FILETRANS_PROFILE_ID, "OBEX File Transfer" }, - { IRMC_SYNC_CMD_PROFILE_ID, "IrMCSync Command" }, - { HEADSET_PROFILE_ID, "Headset" }, - { CORDLESS_TELEPHONY_PROFILE_ID, "Cordless Telephony" }, - { ADVANCED_AUDIO_PROFILE_ID, "Advanced Audio" }, - { INTERCOM_PROFILE_ID, "Intercom" }, - { FAX_PROFILE_ID, "Fax" }, - { HEADSET_AGW_PROFILE_ID, "Headset Audio Gateway" }, - { WAP_PROFILE_ID, "WAP" }, - { WAP_CLIENT_PROFILE_ID, "WAP Client" }, - { PANU_PROFILE_ID, "PAN user" }, - { NAP_PROFILE_ID, "PAN access point" }, - { GN_PROFILE_ID, "PAN group network" }, - { HID_PROFILE_ID, "Human Interface Device" }, - { CIP_PROFILE_ID, "Common ISDN Access" }, - { SAP_PROFILE_ID, "SIM Access" }, - { 0 } -}; +#define Profile ServiceClass static char *string_lookup(struct tupla *pt0, int index) { struct tupla *pt; + for (pt = pt0; pt->index; pt++) - if (pt->index == index) + if (pt->index == index) return pt->str; + return ""; } @@ -160,6 +174,7 @@ static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t snprintf(str, n, "NULL"); return -2; } + switch (uuid->type) { case SDP_UUID16: str2 = string_lookup(message, uuid->value.uuid16); @@ -175,6 +190,7 @@ static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type); return -1; } + return 0; } -- cgit From 2fda2326e810170225ddc7bf0c43479b617a1a5f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Dec 2004 12:17:16 +0000 Subject: Cleanup attribute definitions --- include/sdp.h | 97 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 8f832ea6..4b966618 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -207,44 +207,62 @@ extern "C" { /* * Attribute identifier codes */ -#define SDP_SERVER_RECORD_HANDLE 0x0000 +#define SDP_SERVER_RECORD_HANDLE 0x0000 /* - * Possible values for attribute-id are listed below. + * Possible values for attribute-id are listed below. * See SDP Spec, section "Service Attribute Definitions" for more details. */ -#define SDP_ATTR_RECORD_HANDLE 0x0000 -#define SDP_ATTR_SVCLASS_ID_LIST 0x0001 -#define SDP_ATTR_RECORD_STATE 0x0002 -#define SDP_ATTR_SERVICE_ID 0x0003 -#define SDP_ATTR_PROTO_DESC_LIST 0x0004 -#define SDP_ATTR_BROWSE_GRP_LIST 0x0005 -#define SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006 -#define SDP_ATTR_SVCINFO_TTL 0x0007 -#define SDP_ATTR_SERVICE_AVAILABILITY 0x0008 -#define SDP_ATTR_PFILE_DESC_LIST 0x0009 -#define SDP_ATTR_DOC_URL 0x000A -#define SDP_ATTR_CLNT_EXEC_URL 0x000B -#define SDP_ATTR_ICON_URL 0x000C -#define SDP_ATTR_ADD_PROTO_DESC_LIST 0x000D - +#define SDP_ATTR_RECORD_HANDLE 0x0000 +#define SDP_ATTR_SVCLASS_ID_LIST 0x0001 +#define SDP_ATTR_RECORD_STATE 0x0002 +#define SDP_ATTR_SERVICE_ID 0x0003 +#define SDP_ATTR_PROTO_DESC_LIST 0x0004 +#define SDP_ATTR_BROWSE_GRP_LIST 0x0005 +#define SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006 +#define SDP_ATTR_SVCINFO_TTL 0x0007 +#define SDP_ATTR_SERVICE_AVAILABILITY 0x0008 +#define SDP_ATTR_PFILE_DESC_LIST 0x0009 +#define SDP_ATTR_DOC_URL 0x000a +#define SDP_ATTR_CLNT_EXEC_URL 0x000b +#define SDP_ATTR_ICON_URL 0x000c +#define SDP_ATTR_ADD_PROTO_DESC_LIST 0x000d + +#define SDP_ATTR_GROUP_ID 0x0200 #define SDP_ATTR_IP_SUBNET 0x0200 +#define SDP_ATTR_VERSION_NUM_LIST 0x0200 +#define SDP_ATTR_SVCDB_STATE 0x0201 + #define SDP_ATTR_SERVICE_VERSION 0x0300 -#define SDP_EXTERNAL_NETWORK 0x0301 +#define SDP_ATTR_EXTERNAL_NETWORK 0x0301 #define SDP_ATTR_SUPPORTED_DATA_STORES_LIST 0x0301 +#define SDP_ATTR_FAX_CLASS1_SUPPORT 0x0302 #define SDP_ATTR_REMOTE_AUDIO_VOLUME_CONTROL 0x0302 +#define SDP_ATTR_FAX_CLASS20_SUPPORT 0x0303 #define SDP_ATTR_SUPPORTED_FORMATS_LIST 0x0303 -#define SDP_ATTR_SECURITY_DESC 0x030A -#define SDP_ATTR_NET_ACCESS_TYPE 0x030B -#define SDP_ATTR_MAX_NET_ACCESSRATE 0x030C -#define SDP_ATTR_IP4_SUBNET 0x030D -#define SDP_ATTR_IP6_SUBNET 0x030E -#define SDP_SUPPORTED_FEATURES 0x0311 - +#define SDP_ATTR_FAX_CLASS2_SUPPORT 0x0304 +#define SDP_ATTR_AUDIO_FEEDBACK_SUPPORT 0x0305 +#define SDP_ATTR_NETWORK_ADDRESS 0x0306 +#define SDP_ATTR_WAP_GATEWAY 0x0307 +#define SDP_ATTR_HOMEPAGE_URL 0x0308 +#define SDP_ATTR_WAP_STACK_TYPE 0x0309 +#define SDP_ATTR_SECURITY_DESC 0x030a +#define SDP_ATTR_NET_ACCESS_TYPE 0x030b +#define SDP_ATTR_MAX_NET_ACCESSRATE 0x030c +#define SDP_ATTR_IP4_SUBNET 0x030d +#define SDP_ATTR_IP6_SUBNET 0x030e +#define SDP_ATTR_SUPPORTED_CAPABILITIES 0x0310 +#define SDP_ATTR_SUPPORTED_FEATURES 0x0311 +#define SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312 +#define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313 /* * These identifiers are based on the SDP spec stating that * "base attribute id of the primary (universal) language must be 0x0100" + * + * Other languages should have their own offset; e.g.: + * #define XXXLangBase yyyy + * #define AttrServiceName_XXX 0x0000+XXXLangBase */ #define SDP_PRIMARY_LANG_BASE 0x0100 @@ -252,21 +270,6 @@ extern "C" { #define SDP_ATTR_SVCDESC_PRIMARY 0x0001 + SDP_PRIMARY_LANG_BASE #define SDP_ATTR_PROVNAME_PRIMARY 0x0002 + SDP_PRIMARY_LANG_BASE -/* - * Other languages should have their own offset; e.g.: - * #define XXXLangBase yyyy - * #define AttrServiceName_XXX 0x0000+XXXLangBase - * ... - */ - -/* - * These attributes are specific to the SDP server only; i.e., - * can be present only in the service record of the SDP server - */ -#define SDP_ATTR_VERSION_NUM_LIST 0x0200 -#define SDP_ATTR_SVCDB_STATE 0x0201 -#define SDP_ATTR_GROUP_ID 0x0200 - /* * The Data representation in SDP PDUs (pps 339, 340 of BT SDP Spec) * These are the exact data type+size descriptor values @@ -371,7 +374,7 @@ typedef struct { /* * Common definitions for attributes in the SDP. - * Should the type of any of these change, you need only make a change here. + * Should the type of any of these change, you need only make a change here. */ typedef struct { char data[16]; @@ -398,10 +401,10 @@ struct _sdp_list { * User-visible strings can be in many languages * in addition to the universal language. * - * Language meta-data includes language code in ISO639 - * followed by the encoding format. The third field in this - * structure is the attribute offset for the language. - * User-visible strings in the specified language can be + * Language meta-data includes language code in ISO639 + * followed by the encoding format. The third field in this + * structure is the attribute offset for the language. + * User-visible strings in the specified language can be * obtained at this offset. */ typedef struct { @@ -411,8 +414,8 @@ typedef struct { } sdp_lang_attr_t; /* - * Profile descriptor is the Bluetooth profile metadata. If a - * service conforms to a well-known profile, then its profile + * Profile descriptor is the Bluetooth profile metadata. If a + * service conforms to a well-known profile, then its profile * identifier (UUID) is an attribute of the service. In addition, * if the profile has a version number it is specified here. */ -- cgit From 01a43396075f47dffb2d6fffc9a2d3bb713a7f8d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Dec 2004 12:44:48 +0000 Subject: Add Device ID and HID attribute definitions --- include/sdp.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index 4b966618..7cb11bd8 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -256,6 +256,29 @@ extern "C" { #define SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312 #define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313 +#define SDP_ATTR_SPECIFICATION_ID 0x0200 +#define SDP_ATTR_VENDOR_ID 0x0201 +#define SDP_ATTR_PRODUCT_ID 0x0202 +#define SDP_ATTR_VERSION 0x0203 +#define SDP_ATTR_PRIMARY_RECORD 0x0204 +#define SDP_ATTR_VENDOR_ID_SOURCE 0x0205 + +#define SDP_ATTR_HID_DEVICE_RELEASE_NUMBER 0x0200 +#define SDP_ATTR_HID_PARSER_VERSION 0x0201 +#define SDP_ATTR_HID_DEVICE_SUBCLASS 0x0202 +#define SDP_ATTR_HID_COUNTRY_CODE 0x0203 +#define SDP_ATTR_HID_VIRTUAL_CABLE 0x0204 +#define SDP_ATTR_HID_RECONNECT_INITIATE 0x0205 +#define SDP_ATTR_HID_DESCRIPTOR_LIST 0x0206 +#define SDP_ATTR_HID_LANG_ID_BASE_LIST 0x0207 +#define SDP_ATTR_HID_SDP_DISABLE 0x0208 +#define SDP_ATTR_HID_BATTERY_POWER 0x0209 +#define SDP_ATTR_HID_REMOTE_WAKEUP 0x020a +#define SDP_ATTR_HID_PROFILE_VERSION 0x020b +#define SDP_ATTR_HID_SUPERVISION_TIMEOUT 0x020c +#define SDP_ATTR_HID_NORMALLY_CONNECTABLE 0x020d +#define SDP_ATTR_HID_BOOT_DEVICE 0x020e + /* * These identifiers are based on the SDP spec stating that * "base attribute id of the primary (universal) language must be 0x0100" -- cgit From 0e6eb45baedd15cc65beb454ec00cefb5fb7962d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 10 Dec 2004 09:05:49 +0000 Subject: Fix UUID-32 to string translation --- src/sdp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 7c3bd7d7..f138f1b3 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -181,10 +181,11 @@ static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t snprintf(str, n, str2); break; case SDP_UUID32: - snprintf(str, n, "Error: This is uuid32"); - return -3; + str2 = string_lookup(message, uuid->value.uuid32); + snprintf(str, n, str2); + break; case SDP_UUID128: - snprintf(str, n, "Error: This is uuid128"); + snprintf(str, n, "Error: This is UUID-128"); return -4; default: snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type); -- cgit From 984277aa49d35e4033f6c65266096364ac3243ed Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Dec 2004 17:26:06 +0000 Subject: Update socket option definitions --- include/l2cap.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/include/l2cap.h b/include/l2cap.h index 025d0f66..6fa155f1 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -54,11 +54,13 @@ struct l2cap_options { uint16_t omtu; uint16_t imtu; uint16_t flush_to; + uint8_t mode; }; #define L2CAP_CONNINFO 0x02 struct l2cap_conninfo { uint16_t hci_handle; + uint8_t dev_class[3]; }; #define L2CAP_LM 0x03 @@ -69,20 +71,6 @@ struct l2cap_conninfo { #define L2CAP_LM_RELIABLE 0x0010 #define L2CAP_LM_SECURE 0x0020 -#define L2CAP_QOS 0x04 -struct l2cap_qos { - uint16_t service_type; - uint32_t token_rate; - uint32_t token_bucket_size; - uint32_t peak_bandwidth; - uint32_t latency; - uint32_t delay_variation; -}; - -#define L2CAP_SERV_NO_TRAFFIC 0x00 -#define L2CAP_SERV_BEST_EFFORT 0x01 -#define L2CAP_SERV_GUARANTEED 0x02 - /* L2CAP command codes */ #define L2CAP_COMMAND_REJ 0x01 #define L2CAP_CONN_REQ 0x02 @@ -156,8 +144,10 @@ typedef struct { } __attribute__ ((packed)) l2cap_conf_rsp; #define L2CAP_CONF_RSP_SIZE 6 -#define L2CAP_CONF_SUCCESS 0x00 -#define L2CAP_CONF_UNACCEPT 0x01 +#define L2CAP_CONF_SUCCESS 0x0000 +#define L2CAP_CONF_UNACCEPT 0x0001 +#define L2CAP_CONF_REJECT 0x0002 +#define L2CAP_CONF_UNKNOWN 0x0003 typedef struct { uint8_t type; @@ -169,6 +159,7 @@ typedef struct { #define L2CAP_CONF_MTU 0x01 #define L2CAP_CONF_FLUSH_TO 0x02 #define L2CAP_CONF_QOS 0x03 +#define L2CAP_CONF_RFC 0x04 #define L2CAP_CONF_RFC_MODE 0x04 #define L2CAP_CONF_MAX_SIZE 22 -- cgit From 43e9e65bd31bb549babf77b33587243b1824b6c5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Dec 2004 17:27:06 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index d805a0ce..508eaa98 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:12:0 +libbluetooth_la_LDFLAGS = -version-info 1:13:0 INCLUDES = -I$(top_builddir)/include -- cgit From 8661484ddc5d79689c6a3d1dd41102ca9e89a8cf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Dec 2004 17:35:34 +0000 Subject: Update connection information definitions --- include/l2cap.h | 12 ++++++------ include/rfcomm.h | 6 ++++++ include/sco.h | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/l2cap.h b/include/l2cap.h index 6fa155f1..7029c32c 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -51,16 +51,16 @@ struct sockaddr_l2 { /* L2CAP socket options */ #define L2CAP_OPTIONS 0x01 struct l2cap_options { - uint16_t omtu; - uint16_t imtu; - uint16_t flush_to; - uint8_t mode; + uint16_t omtu; + uint16_t imtu; + uint16_t flush_to; + uint8_t mode; }; #define L2CAP_CONNINFO 0x02 struct l2cap_conninfo { - uint16_t hci_handle; - uint8_t dev_class[3]; + uint16_t hci_handle; + uint8_t dev_class[3]; }; #define L2CAP_LM 0x03 diff --git a/include/rfcomm.h b/include/rfcomm.h index 02775d50..d4cfc056 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -50,6 +50,12 @@ struct sockaddr_rc { }; /* RFCOMM socket options */ +#define RFCOMM_CONNINFO 0x02 +struct rfcomm_conninfo { + uint16_t hci_handle; + uint8_t dev_class[3]; +}; + #define RFCOMM_LM 0x03 #define RFCOMM_LM_MASTER 0x0001 #define RFCOMM_LM_AUTH 0x0002 diff --git a/include/sco.h b/include/sco.h index 0d0ac123..09ab395e 100644 --- a/include/sco.h +++ b/include/sco.h @@ -51,12 +51,13 @@ struct sockaddr_sco { /* set/get sockopt defines */ #define SCO_OPTIONS 0x01 struct sco_options { - uint16_t mtu; + uint16_t mtu; }; #define SCO_CONNINFO 0x02 struct sco_conninfo { - uint16_t hci_handle; + uint16_t hci_handle; + uint8_t dev_class[3]; }; #ifdef __cplusplus -- cgit From be59bde48abafbc4ec4f4053c1cf25a80e2fc64e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 25 Dec 2004 17:37:52 +0000 Subject: Update changelog and bump version number --- ChangeLog | 6 ++++++ configure.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b7a293b7..d6a927c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 2.13: + Add Device ID and HID attribute definitions. + Update the UUID constants and its translations. + Update L2CAP socket option definitions. + Update connection information definitions. + ver 2.12: Correct kernel interface for CMTP and HIDP support. Add service classes and profile ids for WAP. diff --git a/configure.in b/configure.in index d44f85cf..9e3885b3 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.12) +AM_INIT_AUTOMAKE(bluez-libs, 2.13) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 6c2fed4529b256285e495ccdb066de331db42ff4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 20:05:05 +0000 Subject: Remove deprecated functions --- include/hci_lib.h | 14 ++++++-------- src/hci.c | 37 +++++++++++++++---------------------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index b8dbd432..5c83b5e8 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -67,10 +67,8 @@ int hci_devba(int dev_id, bdaddr_t *bdaddr); int hci_devid(const char *str); /* deprecated: preserve compatibility */ -int hci_local_name(int dd, int len, char *name, int to); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); -int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); @@ -102,18 +100,18 @@ int hci_get_route(bdaddr_t *bdaddr); char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); -int hci_strtoptype(char *str, unsigned int *val); +int hci_strtoptype(char *str, unsigned int *val); char *hci_scoptypetostr(unsigned int ptype); -int hci_strtoscoptype(char *str, unsigned int *val); +int hci_strtoscoptype(char *str, unsigned int *val); char *hci_lptostr(unsigned int ptype); -int hci_strtolp(char *str, unsigned int *val); +int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); -int hci_strtolm(char *str, unsigned int *val); +int hci_strtolm(char *str, unsigned int *val); char *hci_vertostr(unsigned int ver); -int hci_strtover(char *str, unsigned int *ver); +int hci_strtover(char *str, unsigned int *ver); char *lmp_vertostr(unsigned int ver); -int lmp_strtover(char *str, unsigned int *ver); +int lmp_strtover(char *str, unsigned int *ver); char *lmp_featurestostr(uint8_t *features, char *pref, int width); diff --git a/src/hci.c b/src/hci.c index 19ee3c4c..5d11309f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -55,7 +55,8 @@ #include typedef struct { - char *str; unsigned int val; + char *str; + unsigned int val; } hci_map; static char *hci_bit2str(hci_map *m, unsigned int val) @@ -255,11 +256,11 @@ int hci_strtoscoptype(char *str, unsigned int *val) /* Link policy mapping */ static hci_map link_policy_map[] = { - { "NONE", 0 }, - { "RSWITCH", HCI_LP_RSWITCH }, - { "HOLD", HCI_LP_HOLD }, - { "SNIFF", HCI_LP_SNIFF }, - { "PARK", HCI_LP_PARK }, + { "NONE", 0 }, + { "RSWITCH", HCI_LP_RSWITCH }, + { "HOLD", HCI_LP_HOLD }, + { "SNIFF", HCI_LP_SNIFF }, + { "PARK", HCI_LP_PARK }, { NULL } }; @@ -275,12 +276,14 @@ int hci_strtolp(char *str, unsigned int *val) /* Link mode mapping */ static hci_map link_mode_map[] = { - { "NONE", 0 }, - { "ACCEPT", HCI_LM_ACCEPT }, - { "MASTER", HCI_LM_MASTER }, - { "AUTH", HCI_LM_AUTH }, - { "ENCRYPT", HCI_LM_ENCRYPT}, - { "TRUSTED", HCI_LM_TRUSTED}, + { "NONE", 0 }, + { "ACCEPT", HCI_LM_ACCEPT }, + { "MASTER", HCI_LM_MASTER }, + { "AUTH", HCI_LM_AUTH }, + { "ENCRYPT", HCI_LM_ENCRYPT }, + { "TRUSTED", HCI_LM_TRUSTED }, + { "RELIABLE", HCI_LM_RELIABLE }, + { "SECURE", HCI_LM_SECURE }, { NULL } }; @@ -847,11 +850,6 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to) return 0; } -int hci_local_name(int dd, int len, char *name, int to) -{ - return hci_read_local_name(dd, len, name, to); -} - int hci_read_local_name(int dd, int len, char *name, int to) { read_local_name_rp rp; @@ -893,11 +891,6 @@ int hci_write_local_name(int dd, const char *name, int to) return 0; } -int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) -{ - return hci_read_remote_name(dd, bdaddr, len, name, to); -} - int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) { evt_remote_name_req_complete rn; -- cgit From 32c8a21b7da2397da204015f4bf45983226cbed9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 20:16:40 +0000 Subject: Add function for reading the RSSI and the link quality --- include/hci.h | 6 +++--- include/hci_lib.h | 2 ++ src/hci.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/include/hci.h b/include/hci.h index 683c988f..54bb8849 100644 --- a/include/hci.h +++ b/include/hci.h @@ -791,13 +791,13 @@ typedef struct { } __attribute__ ((packed)) reset_failed_contact_counter_rp; #define RESET_FAILED_CONTACT_COUNTER_RP_SIZE 4 -#define OCF_GET_LINK_QUALITY 0x0003 +#define OCF_READ_LINK_QUALITY 0x0003 typedef struct { uint8_t status; uint16_t handle; uint8_t link_quality; -} __attribute__ ((packed)) get_link_quality_rp; -#define GET_LINK_QUALITY_RP_SIZE 4 +} __attribute__ ((packed)) read_link_quality_rp; +#define READ_LINK_QUALITY_RP_SIZE 4 #define OCF_READ_RSSI 0x0005 typedef struct { diff --git a/include/hci_lib.h b/include/hci_lib.h index 5c83b5e8..969db1f2 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -92,6 +92,8 @@ int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); +int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to); +int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); diff --git a/src/hci.c b/src/hci.c index 5d11309f..63a79d06 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1460,6 +1460,56 @@ int hci_set_afh_classification(int dd, uint8_t *map, int to) return 0; } +int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to) +{ + read_link_quality_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_STATUS_PARAM; + rq.ocf = OCF_READ_LINK_QUALITY; + rq.cparam = &handle; + rq.clen = 2; + rq.rparam = &rp; + rq.rlen = READ_LINK_QUALITY_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *link_quality = rp.link_quality; + return 0; +} + +int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to) +{ + read_rssi_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_STATUS_PARAM; + rq.ocf = OCF_READ_RSSI; + rq.cparam = &handle; + rq.clen = 2; + rq.rparam = &rp; + rq.rlen = READ_RSSI_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *rssi = rp.rssi; + return 0; +} + int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to) { read_afh_map_rp rp; -- cgit From 3d400b430ca82b915570be699d98b10648c593ac Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 22:37:58 +0000 Subject: Add link supervision timeout functions --- include/hci.h | 5 +++++ include/hci_lib.h | 2 ++ src/hci.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/include/hci.h b/include/hci.h index 54bb8849..a5435cd1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -677,6 +677,11 @@ typedef struct { uint16_t link_sup_to; } __attribute__ ((packed)) write_link_supervision_timeout_cp; #define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) write_link_supervision_timeout_rp; +#define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE 3 #define MAX_IAC_LAP 0x40 #define OCF_READ_CURRENT_IAC_LAP 0x0039 diff --git a/include/hci_lib.h b/include/hci_lib.h index 969db1f2..2edc9e0e 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -91,6 +91,8 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); +int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to); int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); diff --git a/src/hci.c b/src/hci.c index 63a79d06..10f4fcb6 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1432,6 +1432,60 @@ int hci_write_afh_mode(int dd, uint8_t mode, int to) return 0; } +int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to) +{ + read_link_supervision_timeout_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_STATUS_PARAM; + rq.ocf = OCF_READ_LINK_SUPERVISION_TIMEOUT; + rq.cparam = &handle; + rq.clen = 2; + rq.rparam = &rp; + rq.rlen = READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *timeout = rp.link_sup_to; + return 0; +} + +int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to) +{ + write_link_supervision_timeout_cp cp; + write_link_supervision_timeout_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = handle; + cp.link_sup_to = timeout; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_STATUS_PARAM; + rq.ocf = OCF_WRITE_LINK_SUPERVISION_TIMEOUT; + rq.cparam = &cp; + rq.clen = WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} + int hci_set_afh_classification(int dd, uint8_t *map, int to) { set_afh_classification_cp cp; -- cgit From ef8d27c6202740ad13ec702f6a29a1a71be5acc4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 22:38:50 +0000 Subject: Remove comments --- include/hci_lib.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 2edc9e0e..7e6acfaf 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -66,7 +66,6 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di); int hci_devba(int dev_id, bdaddr_t *bdaddr); int hci_devid(const char *str); -/* deprecated: preserve compatibility */ int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); @@ -83,7 +82,6 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); int hci_change_link_key(int dd, uint16_t handle, int to); -/* role == 0 is master, 1 is slave */ int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); -- cgit From 864124c296636015f90e26512143cf2c297ed6d2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 22:46:41 +0000 Subject: The link supervision timeout is host control --- src/hci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index 10f4fcb6..ca53105e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1438,7 +1438,7 @@ int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout struct hci_request rq; memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_STATUS_PARAM; + rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_READ_LINK_SUPERVISION_TIMEOUT; rq.cparam = &handle; rq.clen = 2; @@ -1468,7 +1468,7 @@ int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout cp.link_sup_to = timeout; memset(&rq, 0, sizeof(rq)); - rq.ogf = OGF_STATUS_PARAM; + rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_WRITE_LINK_SUPERVISION_TIMEOUT; rq.cparam = &cp; rq.clen = WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE; -- cgit From 84cc44acd712f84ff544b7e1b96d1410c732dc8c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 22:57:36 +0000 Subject: Add function for reading the transmit power level --- include/hci_lib.h | 1 + src/hci.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 7e6acfaf..3c44bd8a 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -89,6 +89,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, uint8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); diff --git a/src/hci.c b/src/hci.c index ca53105e..8e0b7938 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1432,6 +1432,36 @@ int hci_write_afh_mode(int dd, uint8_t mode, int to) return 0; } +int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, uint8_t *level, int to) +{ + read_transmit_power_level_cp cp; + read_transmit_power_level_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = handle; + cp.type = type; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_TRANSMIT_POWER_LEVEL; + rq.cparam = &cp; + rq.clen = READ_TRANSMIT_POWER_LEVEL_CP_SIZE; + rq.rparam = &rp; + rq.rlen = READ_TRANSMIT_POWER_LEVEL_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *level = rp.level; + return 0; +} + int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to) { read_link_supervision_timeout_rp rp; -- cgit From a84b1dac0d625874fa1828f07efc7be7bcf7a49c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 13 Jan 2005 23:17:13 +0000 Subject: Update AM_PATH_BLUEZ macro --- bluez.m4 | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/bluez.m4 b/bluez.m4 index abcbaae2..c432a2fa 100644 --- a/bluez.m4 +++ b/bluez.m4 @@ -3,8 +3,41 @@ dnl $Id$ dnl AC_DEFUN([AM_PATH_BLUEZ], [ + if (test "${prefix}" = "NONE"); then + bluez_prefix=${ac_default_prefix} + else + bluez_prefix=${prefix} + fi + + AC_ARG_WITH(bluez, AC_HELP_STRING([--with-bluez=DIR], [BlueZ library is installed in DIR]), [ + if (test "${withval}" != "yes"); then + bluez_prefix=${withval} + fi + ]) + + ac_save_CPPFLAGS=$CPPFLAGS + ac_save_LDFLAGS=$LDFLAGS + BLUEZ_CFLAGS="" - BLUEZ_LIBS="-lbluetooth" + test -d "${bluez_prefix}/include" && BLUEZ_CFLAGS="$BLUEZ_CFLAGS -I${bluez_prefix}/include" + + CPPFLAGS="$CPPFLAGS $BLUEZ_CFLAGS" + AC_CHECK_HEADER(bluetooth/bluetooth.h,, AC_MSG_ERROR(Bluetooth header files not found)) + + BLUEZ_LIBS="" + if (test "${ac_default_prefix}" = "${bluez_prefix}"); then + test -d "${libdir}" && BLUEZ_LIBS="$BLUEZ_LIBS -L${libdir}" + else + test -d "${bluez_prefix}/lib64" && BLUEZ_LIBS="$BLUEZ_LIBS -L${bluez_prefix}/lib64" + test -d "${bluez_prefix}/lib" && BLUEZ_LIBS="$BLUEZ_LIBS -L${bluez_prefix}/lib" + fi + + LDFLAGS="$LDFLAGS $BLUEZ_LIBS" + AC_CHECK_LIB(bluetooth, hci_open_dev, BLUEZ_LIBS="$BLUEZ_LIBS -lbluetooth", AC_MSG_ERROR(Bluetooth library not found)) + AC_CHECK_LIB(bluetooth, sdp_connect,, AC_CHECK_LIB(sdp, sdp_connect, BLUEZ_LIBS="$BLUEZ_LIBS -lsdp")) + + CPPFLAGS=$ac_save_CPPFLAGS + LDFLAGS=$ac_save_LDFLAGS AC_SUBST(BLUEZ_CFLAGS) AC_SUBST(BLUEZ_LIBS) -- cgit From 00bb0adf5a9c8dee2ed3b25ec0f3c1588f2c91ca Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 14 Jan 2005 00:04:29 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 508eaa98..bec2f2dc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:13:0 +libbluetooth_la_LDFLAGS = -version-info 1:14:0 INCLUDES = -I$(top_builddir)/include -- cgit From 659be2ac5b9af82ecdc63907e2a463c712187543 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 14 Jan 2005 00:08:51 +0000 Subject: Update changelog and bump version number --- ChangeLog | 8 ++++++++ configure.in | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d6a927c8..9bbf3c8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +ver 2.14: + Add function for reading the RSSI. + Add function for reading the link quality. + Add function for reading the transmit power level. + Add functions for the link supervision timeout. + Remove deprecated functions. + Update AM_PATH_BLUEZ macro. + ver 2.13: Add Device ID and HID attribute definitions. Update the UUID constants and its translations. diff --git a/configure.in b/configure.in index 9e3885b3..2f6373f0 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.13) +AM_INIT_AUTOMAKE(bluez-libs, 2.14) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From ef5f2b1b3adbc8509dc47a4c53f31e6e9f867d0b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 20 Jan 2005 18:14:19 +0000 Subject: Use better way for unaligned access --- include/bluetooth.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index 80a2d169..142f6064 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -88,17 +88,21 @@ enum { #endif /* Bluetooth unaligned access */ -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__) || defined(__cris__) -#define bt_get_unaligned(ptr) (*(ptr)) -#define bt_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) -#else -#define bt_get_unaligned(ptr) \ - ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) -#define bt_put_unaligned(val, ptr) \ - ({ __typeof__(*(ptr)) __tmp = (val); \ - memmove((ptr), &__tmp, sizeof(*(ptr))); \ - (void)0; }) -#endif +#define bt_get_unaligned(ptr) \ +({ \ + struct __attribute__((packed)) { \ + typeof(*(ptr)) __v; \ + } *__p = (ptr); \ + __p->__v; \ +}) + +#define bt_put_unaligned(val, ptr) \ +do { \ + struct __attribute__((packed)) { \ + typeof(*(ptr)) __v; \ + } *__p = (ptr); \ + __p->__v = (val); \ +} while(0) /* BD Address */ typedef struct { -- cgit From badafc6e227a175022370017008f0d839ec90b25 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 08:10:42 +0000 Subject: Add functions hci_{local|remote}_name() --- include/hci_lib.h | 3 +++ src/hci.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 3c44bd8a..f6259f51 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -97,6 +97,9 @@ int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); +int hci_local_name(int dd, int len, char *name, int to); +int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); + int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); diff --git a/src/hci.c b/src/hci.c index 8e0b7938..87f4874b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1619,3 +1619,13 @@ int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int t memcpy(map, rp.map, 10); return 0; } + +int hci_local_name(int dd, int len, char *name, int to) +{ + return hci_read_local_name(dd, len, name, to); +} + +int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) +{ + return hci_read_remote_name(dd, bdaddr, len, name, to); +} -- cgit From aae7cfb9807fd7452e6662fc9f6c3ebe0e64dbf5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 14:33:58 +0000 Subject: Replace sdp_{get|put}_unaligned with bt_{get|put}_unaligned --- src/sdp.c | 180 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index f138f1b3..6230edfe 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -304,7 +304,7 @@ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) { sdp_data_t *seq; int len = 0; - sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); if (!d) return NULL; @@ -317,36 +317,36 @@ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) case SDP_DATA_NIL: break; case SDP_UINT8: - d->val.uint8 = *(uint8_t *)value; + d->val.uint8 = *(uint8_t *) value; d->unitSize += sizeof(uint8_t); break; case SDP_INT8: case SDP_BOOL: - d->val.int8 = *(int8_t *)value; + d->val.int8 = *(int8_t *) value; d->unitSize += sizeof(int8_t); break; case SDP_UINT16: - d->val.uint16 = sdp_get_unaligned((uint16_t *)value); + d->val.uint16 = bt_get_unaligned((uint16_t *) value); d->unitSize += sizeof(uint16_t); break; case SDP_INT16: - d->val.int16 = sdp_get_unaligned((int16_t *)value); + d->val.int16 = bt_get_unaligned((int16_t *) value); d->unitSize += sizeof(int16_t); break; case SDP_UINT32: - d->val.uint32 = sdp_get_unaligned((uint32_t *)value); + d->val.uint32 = bt_get_unaligned((uint32_t *) value); d->unitSize += sizeof(uint32_t); break; case SDP_INT32: - d->val.int32 = sdp_get_unaligned((int32_t *)value); + d->val.int32 = bt_get_unaligned((int32_t *) value); d->unitSize += sizeof(int32_t); break; case SDP_INT64: - d->val.int64 = sdp_get_unaligned((int64_t *)value); + d->val.int64 = bt_get_unaligned((int64_t *) value); d->unitSize += sizeof(int64_t); break; case SDP_UINT64: - d->val.uint64 = sdp_get_unaligned((uint64_t *)value); + d->val.uint64 = bt_get_unaligned((uint64_t *) value); d->unitSize += sizeof(uint64_t); break; case SDP_UINT128: @@ -358,11 +358,11 @@ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) d->unitSize += sizeof(uint128_t); break; case SDP_UUID16: - sdp_uuid16_create(&d->val.uuid, sdp_get_unaligned((uint16_t *)value)); + sdp_uuid16_create(&d->val.uuid, bt_get_unaligned((uint16_t *) value)); d->unitSize += sizeof(uint16_t); break; case SDP_UUID32: - sdp_uuid32_create(&d->val.uuid, sdp_get_unaligned((uint32_t *)value)); + sdp_uuid32_create(&d->val.uuid, bt_get_unaligned((uint32_t *) value)); d->unitSize += sizeof(uint32_t); break; case SDP_UUID128: @@ -379,7 +379,7 @@ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) len = strlen(value); d->unitSize += len; if (len <= USHRT_MAX) { - d->val.str = (char *)malloc(len + 1); + d->val.str = (char *) malloc(len + 1); if (!d->val.str) goto out_error; @@ -490,26 +490,26 @@ void sdp_attr_remove(sdp_record_t *rec, uint16_t attr) void sdp_set_seq_len(char *ptr, int length) { - uint8_t dtd = *(uint8_t *)ptr++; + uint8_t dtd = *(uint8_t *) ptr++; switch (dtd) { case SDP_SEQ8: case SDP_ALT8: case SDP_TEXT_STR8: case SDP_URL_STR8: - *(uint8_t *)ptr = (uint8_t)length; + *(uint8_t *)ptr = (uint8_t) length; break; case SDP_SEQ16: case SDP_ALT16: case SDP_TEXT_STR16: case SDP_URL_STR16: - sdp_put_unaligned(htons(length), (uint16_t *)ptr); + bt_put_unaligned(htons(length), (uint16_t *) ptr); break; case SDP_SEQ32: case SDP_ALT32: case SDP_TEXT_STR32: case SDP_URL_STR32: - sdp_put_unaligned(htonl(length), (uint32_t *)ptr); + bt_put_unaligned(htonl(length), (uint32_t *) ptr); break; } } @@ -551,7 +551,7 @@ void sdp_set_attrid(sdp_buf_t *buf, uint16_t attr) // data type for attr *p++ = SDP_UINT16; buf->data_size = sizeof(uint8_t); - sdp_put_unaligned(htons(attr), (uint16_t *)p); + bt_put_unaligned(htons(attr), (uint16_t *) p); p += sizeof(uint16_t); buf->data_size += sizeof(uint16_t); } @@ -755,11 +755,11 @@ void sdp_data_free(sdp_data_t *d) static sdp_data_t *extract_int(const void *p, int *len) { - sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); SDPDBG("Extracting integer\n"); memset(d, 0, sizeof(sdp_data_t)); - d->dtd = *(uint8_t *)p; + d->dtd = *(uint8_t *) p; p += sizeof(uint8_t); *len += sizeof(uint8_t); @@ -770,27 +770,27 @@ static sdp_data_t *extract_int(const void *p, int *len) case SDP_INT8: case SDP_UINT8: *len += sizeof(uint8_t); - d->val.uint8 = *(uint8_t *)p; + d->val.uint8 = *(uint8_t *) p; break; case SDP_INT16: case SDP_UINT16: *len += sizeof(uint16_t); - d->val.uint16 = ntohs(sdp_get_unaligned((uint16_t *)p)); + d->val.uint16 = ntohs(bt_get_unaligned((uint16_t *) p)); break; case SDP_INT32: case SDP_UINT32: *len += sizeof(uint32_t); - d->val.uint32 = ntohl(sdp_get_unaligned((uint32_t *)p)); + d->val.uint32 = ntohl(bt_get_unaligned((uint32_t *) p)); break; case SDP_INT64: case SDP_UINT64: *len += sizeof(uint64_t); - d->val.uint64 = ntoh64(sdp_get_unaligned((uint64_t *)p)); + d->val.uint64 = ntoh64(bt_get_unaligned((uint64_t *) p)); break; case SDP_INT128: case SDP_UINT128: *len += sizeof(uint128_t); - ntoh128((uint128_t *)p, &d->val.uint128); + ntoh128((uint128_t *) p, &d->val.uint128); break; default: free(d); @@ -801,7 +801,7 @@ static sdp_data_t *extract_int(const void *p, int *len) static sdp_data_t *extract_uuid(const void *p, int *len, sdp_record_t *rec) { - sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); SDPDBG("Extracting UUID"); memset(d, 0, sizeof(sdp_data_t)); @@ -809,7 +809,7 @@ static sdp_data_t *extract_uuid(const void *p, int *len, sdp_record_t *rec) free(d); return NULL; } - d->dtd = *(uint8_t *)p; + d->dtd = *(uint8_t *) p; sdp_pattern_add_uuid(rec, &d->val.uuid); return d; } @@ -821,23 +821,23 @@ static sdp_data_t *extract_str(const void *p, int *len) { char *s; int n; - sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); memset(d, 0, sizeof(sdp_data_t)); - d->dtd = *(uint8_t *)p; + d->dtd = *(uint8_t *) p; p += sizeof(uint8_t); *len += sizeof(uint8_t); switch (d->dtd) { case SDP_TEXT_STR8: case SDP_URL_STR8: - n = *(uint8_t *)p; + n = *(uint8_t *) p; p += sizeof(uint8_t); *len += sizeof(uint8_t) + n; break; case SDP_TEXT_STR16: case SDP_URL_STR16: - n = ntohs(sdp_get_unaligned((uint16_t *)p)); + n = ntohs(bt_get_unaligned((uint16_t *) p)); p += sizeof(uint16_t); *len += sizeof(uint16_t) + n; break; @@ -984,13 +984,13 @@ sdp_record_t *sdp_extract_pdu(const char *buf, int *scanned) sdp_data_t *data = NULL; SDPDBG("Extract PDU, sequenceLength: %d localExtractedLength: %d", seqlen, extracted); - dtd = *(uint8_t *)p; - attr = ntohs(sdp_get_unaligned((uint16_t *)(p+n))); + dtd = *(uint8_t *) p; + attr = ntohs(bt_get_unaligned((uint16_t *) (p + n))); n += sizeof(uint16_t); SDPDBG("DTD of attrId : %d Attr id : 0x%x \n", dtd, attr); - data = sdp_extract_attr(p+n, &attrlen, rec); + data = sdp_extract_attr(p + n, &attrlen, rec); SDPDBG("Attr id : 0x%x attrValueLength : %d\n", attr, attrlen); @@ -1109,7 +1109,7 @@ sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attrId) */ int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *size) { - uint8_t dtd = *(uint8_t *)buf; + uint8_t dtd = *(uint8_t *) buf; int scanned = sizeof(uint8_t); buf += sizeof(uint8_t); @@ -1117,17 +1117,17 @@ int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *size) switch (dtd) { case SDP_SEQ8: case SDP_ALT8: - *size = *(uint8_t *)buf; + *size = *(uint8_t *) buf; scanned += sizeof(uint8_t); break; case SDP_SEQ16: case SDP_ALT16: - *size = ntohs(sdp_get_unaligned((uint16_t *)buf)); + *size = ntohs(bt_get_unaligned((uint16_t *) buf)); scanned += sizeof(uint16_t); break; case SDP_SEQ32: case SDP_ALT32: - *size = ntohl(sdp_get_unaligned((uint32_t *)buf)); + *size = ntohl(bt_get_unaligned((uint32_t *) buf)); scanned += sizeof(uint32_t); break; default: @@ -2136,7 +2136,7 @@ int sdp_uuid_to_proto(uuid_t *uuid) int sdp_uuid_extract(const char *p, uuid_t *uuid, int *scanned) { - uint8_t type = *(const uint8_t *)p; + uint8_t type = *(const uint8_t *) p; if (!SDP_IS_UUID(type)) { SDPERR("Unknown data type : %d expecting a svc UUID\n", type); @@ -2145,11 +2145,11 @@ int sdp_uuid_extract(const char *p, uuid_t *uuid, int *scanned) p += sizeof(uint8_t); *scanned += sizeof(uint8_t); if (type == SDP_UUID16) { - sdp_uuid16_create(uuid, ntohs(sdp_get_unaligned((uint16_t *)p))); + sdp_uuid16_create(uuid, ntohs(bt_get_unaligned((uint16_t *) p))); *scanned += sizeof(uint16_t); p += sizeof(uint16_t); } else if (type == SDP_UUID32) { - sdp_uuid32_create(uuid, ntohl(sdp_get_unaligned((uint32_t *)p))); + sdp_uuid32_create(uuid, ntohl(bt_get_unaligned((uint32_t *) p))); *scanned += sizeof(uint32_t); p += sizeof(uint32_t); } else { @@ -2169,7 +2169,7 @@ int sdp_uuid_extract(const char *p, uuid_t *uuid, int *scanned) void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len) { char *p = dst->data; - uint8_t dtd = *(uint8_t *)p; + uint8_t dtd = *(uint8_t *) p; SDPDBG("Append src size: %d\n", len); SDPDBG("Append dst size: %d\n", dst->data_size); @@ -2203,22 +2203,22 @@ void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len) short offset = sizeof(uint8_t) + sizeof(uint8_t); memmove(dst->data + offset + 1, dst->data + offset, dst->data_size - offset); p = dst->data; - *(uint8_t *)p = SDP_SEQ16; + *(uint8_t *) p = SDP_SEQ16; p += sizeof(uint8_t); dst->data_size += 1; } p = dst->data; - dtd = *(uint8_t *)p; + dtd = *(uint8_t *) p; p += sizeof(uint8_t); switch (dtd) { case SDP_SEQ8: - *(uint8_t *)p = dst->data_size - sizeof(uint8_t) - sizeof(uint8_t); + *(uint8_t *) p = dst->data_size - sizeof(uint8_t) - sizeof(uint8_t); break; case SDP_SEQ16: - sdp_put_unaligned(htons(dst->data_size - sizeof(uint8_t) - sizeof(uint16_t)), (uint16_t *)p); + bt_put_unaligned(htons(dst->data_size - sizeof(uint8_t) - sizeof(uint16_t)), (uint16_t *) p); break; case SDP_SEQ32: - sdp_put_unaligned(htonl(dst->data_size - sizeof(uint8_t) - sizeof(uint32_t)), (uint32_t *)p); + bt_put_unaligned(htonl(dst->data_size - sizeof(uint8_t) - sizeof(uint32_t)), (uint32_t *) p); break; } } @@ -2260,8 +2260,8 @@ int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags errno = EREMOTE; return -1; } - req = (char *)malloc(SDP_REQ_BUFFER_SIZE); - rsp = (char *)malloc(SDP_RSP_BUFFER_SIZE); + req = (char *) malloc(SDP_REQ_BUFFER_SIZE); + rsp = (char *) malloc(SDP_RSP_BUFFER_SIZE); if (req == NULL || rsp == NULL) { status = -1; errno = ENOMEM; @@ -2286,10 +2286,10 @@ int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags status = sdp_send_req_w4_rsp(session, req, rsp, reqsize, &rspsize); if (status < 0) goto end; - rsphdr = (sdp_pdu_hdr_t *)rsp; + rsphdr = (sdp_pdu_hdr_t *) rsp; p = rsp + sizeof(sdp_pdu_hdr_t); if (rsphdr->pdu_id == SDP_SVC_REGISTER_RSP) { - uint32_t handle = ntohl(sdp_get_unaligned((uint32_t *)p)); + uint32_t handle = ntohl(bt_get_unaligned((uint32_t *) p)); sdp_data_t *data = sdp_data_alloc(SDP_UINT32, &handle); rec->handle = handle; sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, data); @@ -2325,28 +2325,28 @@ int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) errno = EREMOTE; return -1; } - reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; goto end; } - reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr = (sdp_pdu_hdr_t *) reqbuf; reqhdr->pdu_id = SDP_SVC_REMOVE_REQ; reqhdr->tid = htons(sdp_gen_tid(session)); p = reqbuf + sizeof(sdp_pdu_hdr_t); reqsize = sizeof(sdp_pdu_hdr_t); - sdp_put_unaligned(htonl(handle), (uint32_t *)p); + bt_put_unaligned(htonl(handle), (uint32_t *) p); reqsize += sizeof(uint32_t); reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); if (status == 0) { - rsphdr = (sdp_pdu_hdr_t *)rspbuf; + rsphdr = (sdp_pdu_hdr_t *) rspbuf; p = rspbuf + sizeof(sdp_pdu_hdr_t); - status = sdp_get_unaligned((uint16_t *)p); + status = bt_get_unaligned((uint16_t *) p); if (status == 0 && rsphdr->pdu_id == SDP_SVC_REMOVE_RSP) { SDPDBG("Removing local copy\n"); sdp_record_free(rec); @@ -2384,21 +2384,21 @@ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) errno = EREMOTE; return -1; } - reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; goto end; } - reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr = (sdp_pdu_hdr_t *) reqbuf; reqhdr->pdu_id = SDP_SVC_UPDATE_REQ; reqhdr->tid = htons(sdp_gen_tid(session)); - p = (char *)(reqbuf + sizeof(sdp_pdu_hdr_t)); + p = (char *) (reqbuf + sizeof(sdp_pdu_hdr_t)); reqsize = sizeof(sdp_pdu_hdr_t); - sdp_put_unaligned(htonl(handle), (uint32_t *)p); + bt_put_unaligned(htonl(handle), (uint32_t *) p); reqsize += sizeof(uint32_t); p += sizeof(uint32_t); @@ -2416,9 +2416,9 @@ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) SDPDBG("Send req status : %d\n", status); if (status == 0) { - rsphdr = (sdp_pdu_hdr_t *)rspbuf; + rsphdr = (sdp_pdu_hdr_t *) rspbuf; p = rspbuf + sizeof(sdp_pdu_hdr_t); - status = sdp_get_unaligned((uint16_t *)p); + status = bt_get_unaligned((uint16_t *) p); } end: if (reqbuf) @@ -2484,7 +2484,7 @@ static void extract_record_handle_seq(char *pdu, sdp_list_t **seq, int count, in for (n = 0; n < count; n++) { uint32_t *pSvcRec = (uint32_t *) malloc(sizeof(uint32_t)); - *pSvcRec = ntohl(sdp_get_unaligned((uint32_t *)pdata)); + *pSvcRec = ntohl(bt_get_unaligned((uint32_t *) pdata)); pSeq = sdp_list_append(pSeq, pSvcRec); pdata += sizeof(uint32_t); *scanned += sizeof(uint32_t); @@ -2607,7 +2607,7 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, status = -1; goto end; } - reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr = (sdp_pdu_hdr_t *) reqbuf; reqhdr->pdu_id = SDP_SVC_SEARCH_REQ; pdata = reqbuf + sizeof(sdp_pdu_hdr_t); reqsize = sizeof(sdp_pdu_hdr_t); @@ -2622,7 +2622,7 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, pdata += seqlen; // specify the maximum svc rec count that client expects - sdp_put_unaligned(htons(max_rec_num), (uint16_t *)pdata); + bt_put_unaligned(htons(max_rec_num), (uint16_t *) pdata); reqsize += sizeof(uint16_t); pdata += sizeof(uint16_t); @@ -2647,7 +2647,7 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, goto end; rsplen = 0; - rsphdr = (sdp_pdu_hdr_t *)rspbuf; + rsphdr = (sdp_pdu_hdr_t *) rspbuf; rsplen = ntohs(rsphdr->plen); if (rsphdr->pdu_id == SDP_ERROR_RSP) { @@ -2659,10 +2659,10 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, pdata = rspbuf + sizeof(sdp_pdu_hdr_t); // net service record match count - total_rec_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + total_rec_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); pdata += sizeof(uint16_t); scanned += sizeof(uint16_t); - rec_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + rec_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); pdata += sizeof(uint16_t); scanned += sizeof(uint16_t); @@ -2681,7 +2681,7 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint8_t cstate_len; pdata = rspbuf + sizeof(sdp_pdu_hdr_t) + scanned; - cstate_len = *(uint8_t *)pdata; + cstate_len = *(uint8_t *) pdata; if (cstate_len > 0) { cstate = (sdp_cstate_t *)pdata; SDPDBG("Cont state length: %d\n", cstate_len); @@ -2752,27 +2752,27 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, return 0; } - reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; goto end; } - memset((char *)&rsp_concat_buf, 0, sizeof(sdp_buf_t)); - reqhdr = (sdp_pdu_hdr_t *)reqbuf; + memset((char *) &rsp_concat_buf, 0, sizeof(sdp_buf_t)); + reqhdr = (sdp_pdu_hdr_t *) reqbuf; reqhdr->pdu_id = SDP_SVC_ATTR_REQ; pdata = reqbuf + sizeof(sdp_pdu_hdr_t); reqsize = sizeof(sdp_pdu_hdr_t); // add the service record handle - sdp_put_unaligned(htonl(handle), (uint32_t *)pdata); + bt_put_unaligned(htonl(handle), (uint32_t *) pdata); reqsize += sizeof(uint32_t); pdata += sizeof(uint32_t); // specify the response limit - sdp_put_unaligned(htons(65535), (uint16_t *)pdata); + bt_put_unaligned(htons(65535), (uint16_t *) pdata); reqsize += sizeof(uint16_t); pdata += sizeof(uint16_t); @@ -2804,19 +2804,19 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, if (status < 0) goto end; rsp_count = 0; - rsphdr = (sdp_pdu_hdr_t *)rspbuf; + rsphdr = (sdp_pdu_hdr_t *) rspbuf; if (rsphdr->pdu_id == SDP_ERROR_RSP) { SDPDBG("PDU ID : 0x%x\n", rsphdr->pdu_id); status = -1; goto end; } pdata = rspbuf + sizeof(sdp_pdu_hdr_t); - rsp_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); attr_list_len += rsp_count; pdata += sizeof(uint16_t); // if continuation state set need to re-issue request before parsing - cstate_len = *(uint8_t *)(pdata + rsp_count); + cstate_len = *(uint8_t *) (pdata + rsp_count); SDPDBG("Response id : %d\n", rsphdr->pdu_id); SDPDBG("Attrlist byte count : %d\n", rsp_count); @@ -2829,10 +2829,10 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, if (cstate_len > 0 || rsp_concat_buf.data_size != 0) { char *targetPtr = NULL; - cstate = cstate_len > 0? (sdp_cstate_t *)(pdata + rsp_count): 0; + cstate = cstate_len > 0 ? (sdp_cstate_t *) (pdata + rsp_count) : 0; // build concatenated response buffer - rsp_concat_buf.data = (char *)realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); + rsp_concat_buf.data = (char *) realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); rsp_concat_buf.buf_size = rsp_concat_buf.data_size + rsp_count; targetPtr = rsp_concat_buf.data + rsp_concat_buf.data_size; memcpy(targetPtr, pdata, rsp_count); @@ -2920,8 +2920,8 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search errno = EINVAL; return -1; } - reqbuf = (char *)malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *)malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; @@ -2929,7 +2929,7 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search } memset((char *)&rsp_concat_buf, 0, sizeof(sdp_buf_t)); - reqhdr = (sdp_pdu_hdr_t *)reqbuf; + reqhdr = (sdp_pdu_hdr_t *) reqbuf; reqhdr->pdu_id = SDP_SVC_SEARCH_ATTR_REQ; // generate PDU @@ -2945,7 +2945,7 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search reqsize += seqlen; pdata += seqlen; - sdp_put_unaligned(htons(SDP_MAX_ATTR_LEN), (uint16_t *)pdata); + bt_put_unaligned(htons(SDP_MAX_ATTR_LEN), (uint16_t *) pdata); reqsize += sizeof(uint16_t); pdata += sizeof(uint16_t); @@ -2953,7 +2953,7 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search // get attr seq PDU form seqlen = gen_attridseq_pdu(pdata, attrids, - reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16: SDP_UINT32); + reqtype == SDP_ATTR_REQ_INDIVIDUAL ? SDP_UINT16 : SDP_UINT32); if (seqlen == -1) { status = EINVAL; goto end; @@ -2975,7 +2975,7 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search // set the request header's param length reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); - rsphdr = (sdp_pdu_hdr_t *)rspbuf; + rsphdr = (sdp_pdu_hdr_t *) rspbuf; status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); if (status < 0) { SDPDBG("Status : 0x%x\n", rsphdr->pdu_id); @@ -2988,10 +2988,10 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search } pdata = rspbuf + sizeof(sdp_pdu_hdr_t); - rsp_count = ntohs(sdp_get_unaligned((uint16_t *)pdata)); + rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); attr_list_len += rsp_count; pdata += sizeof(uint16_t); // pdata points to attribute list - cstate_len = *(uint8_t *)(pdata + rsp_count); + cstate_len = *(uint8_t *) (pdata + rsp_count); SDPDBG("Attrlist byte count : %d\n", attr_list_len); SDPDBG("Response byte count : %d\n", rsp_count); @@ -3003,7 +3003,7 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search if (cstate_len > 0 || rsp_concat_buf.data_size != 0) { char *targetPtr = NULL; - cstate = cstate_len > 0? (sdp_cstate_t *)(pdata + rsp_count): 0; + cstate = cstate_len > 0 ? (sdp_cstate_t *) (pdata + rsp_count) : 0; // build concatenated response buffer rsp_concat_buf.data = (char *)realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); -- cgit From 43e67213704bfbc638eec70a87001f7c69c33447 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 14:35:11 +0000 Subject: Remove sdp_{get|put}_unaligned definition --- include/sdp_internal.h | 97 -------------------------------------------------- 1 file changed, 97 deletions(-) diff --git a/include/sdp_internal.h b/include/sdp_internal.h index 5d6ed7f9..2e0e343b 100644 --- a/include/sdp_internal.h +++ b/include/sdp_internal.h @@ -55,103 +55,6 @@ extern "C" { #define SDP_UUID_SEQ_SIZE 256 #define SDP_MAX_ATTR_LEN 65535 -/* - * SDP unaligned access. - * based on linux/asm-/unaligned.h - */ -#if defined(__i386__) - -#define sdp_get_unaligned(ptr) (*(ptr)) -#define sdp_put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) - -#else - -struct __una_u64 { uint64_t x; } __attribute__((packed)); -struct __una_u32 { uint32_t x; } __attribute__((packed)); -struct __una_u16 { uint16_t x; } __attribute__((packed)); - -static inline unsigned long long __uldq(const unsigned long *r11) -{ - const struct __una_u64 *ptr = (const struct __una_u64 *) r11; - return ptr->x; -} - -static inline unsigned long __uldl(const unsigned int * r11) -{ - const struct __una_u32 *ptr = (const struct __una_u32 *) r11; - return ptr->x; -} - -static inline unsigned long __uldw(const unsigned short * r11) -{ - const struct __una_u16 *ptr = (const struct __una_u16 *) r11; - return ptr->x; -} - -static inline void __ustq(unsigned long r5, unsigned long * r11) -{ - struct __una_u64 *ptr = (struct __una_u64 *) r11; - ptr->x = r5; -} - -static inline void __ustl(unsigned long r5, unsigned int * r11) -{ - struct __una_u32 *ptr = (struct __una_u32 *) r11; - ptr->x = r5; -} - -static inline void __ustw(unsigned long r5, unsigned short * r11) -{ - struct __una_u16 *ptr = (struct __una_u16 *) r11; - ptr->x = r5; -} - -static inline unsigned long long __sdp_get_unaligned(const void *ptr, size_t size) -{ - unsigned long long val = 0; - switch (size) { - case 1: - val = *(const unsigned char *)ptr; - break; - case 2: - val = __uldw((const unsigned short *)ptr); - break; - case 4: - val = __uldl((const unsigned int *)ptr); - break; - case 8: - val = __uldq((const unsigned long *)ptr); - break; - } - return val; -} - -static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size) -{ - switch (size) { - case 1: - *(unsigned char *)ptr = (val); - break; - case 2: - __ustw(val, (unsigned short *)ptr); - break; - case 4: - __ustl(val, (unsigned int *)ptr); - break; - case 8: - __ustq(val, (unsigned long *)ptr); - break; - } -} - -#define sdp_get_unaligned(ptr) \ - ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr)))) - -#define sdp_put_unaligned(x,ptr) \ - __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) - -#endif - #if __BYTE_ORDER == __BIG_ENDIAN #define ntoh64(x) x static inline void ntoh128(uint128_t *src, uint128_t *dst) -- cgit From b4790da2d46a5f39d0fdc7fd836ec23b1b483f7e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 14:36:19 +0000 Subject: Fixup the unaligned access --- include/bluetooth.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index 142f6064..86d3f1d2 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -92,7 +92,7 @@ enum { ({ \ struct __attribute__((packed)) { \ typeof(*(ptr)) __v; \ - } *__p = (ptr); \ + } *__p = (void *) (ptr); \ __p->__v; \ }) @@ -100,7 +100,7 @@ enum { do { \ struct __attribute__((packed)) { \ typeof(*(ptr)) __v; \ - } *__p = (ptr); \ + } *__p = (void *) (ptr); \ __p->__v = (val); \ } while(0) -- cgit From 654f832d98530b05dc7ffaefff5950a32de76b3c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 23 Jan 2005 22:49:48 +0000 Subject: Remove sdp_internal.h --- include/Makefile.am | 2 -- include/sdp_internal.h | 91 -------------------------------------------------- src/sdp.c | 46 ++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 94 deletions(-) delete mode 100644 include/sdp_internal.h diff --git a/include/Makefile.am b/include/Makefile.am index 4ac8aada..5710846d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -8,8 +8,6 @@ include_HEADERS = \ bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h \ l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h -noinst_HEADERS = sdp_internal.h - MAINTAINERCLEANFILES = Makefile.in all-local: diff --git a/include/sdp_internal.h b/include/sdp_internal.h deleted file mode 100644 index 2e0e343b..00000000 --- a/include/sdp_internal.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2001-2002 Nokia Corporation - * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann - * Copyright (C) 2002-2003 Stephen Crane - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. - * - * - * $Id$ - */ - -#ifndef __SDP_INTERNAL_H -#define __SDP_INTERNAL_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include - -#define SDPINF(fmt, arg...) syslog(LOG_INFO, fmt "\n", ## arg) -#define SDPERR(fmt, arg...) syslog(LOG_ERR, "%s: " fmt "\n", __func__ , ## arg) - -#ifdef SDP_DEBUG -#define SDPDBG(fmt, arg...) syslog(LOG_DEBUG, "%s: " fmt "\n", __func__ , ## arg) -#else -#define SDPDBG(fmt...) -#endif - -#define SDP_BASIC_ATTR_PDUFORM_SIZE 32 -#define SDP_SEQ_PDUFORM_SIZE 128 -#define SDP_UUID_SEQ_SIZE 256 -#define SDP_MAX_ATTR_LEN 65535 - -#if __BYTE_ORDER == __BIG_ENDIAN -#define ntoh64(x) x -static inline void ntoh128(uint128_t *src, uint128_t *dst) -{ - int i; - for (i = 0; i < 16; i++) - dst->data[i] = src->data[i]; -} -#else -static inline uint64_t ntoh64(uint64_t n) -{ - uint64_t h; - uint64_t tmp = ntohl(n & 0x00000000ffffffff); - h = ntohl(n >> 32); - h |= tmp << 32; - return h; -} - -static inline void ntoh128(uint128_t *src, uint128_t *dst) -{ - int i; - for (i = 0; i < 16; i++) - dst->data[15 - i] = src->data[i]; -} -#endif - -#define hton64(x) ntoh64(x) -#define hton128(x,y) ntoh128(x,y) - -#ifdef __cplusplus -} -#endif - -#endif /* __SDP_INTERNAL_H */ diff --git a/src/sdp.c b/src/sdp.c index 6230edfe..6f8ce14b 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -47,12 +48,55 @@ #include #include #include -#include + +#include + +#define SDPINF(fmt, arg...) syslog(LOG_INFO, fmt "\n", ## arg) +#define SDPERR(fmt, arg...) syslog(LOG_ERR, "%s: " fmt "\n", __func__ , ## arg) + +#ifdef SDP_DEBUG +#define SDPDBG(fmt, arg...) syslog(LOG_DEBUG, "%s: " fmt "\n", __func__ , ## arg) +#else +#define SDPDBG(fmt...) +#endif + +#if __BYTE_ORDER == __BIG_ENDIAN +#define ntoh64(x) (x) +static inline void ntoh128(uint128_t *src, uint128_t *dst) +{ + int i; + for (i = 0; i < 16; i++) + dst->data[i] = src->data[i]; +} +#else +static inline uint64_t ntoh64(uint64_t n) +{ + uint64_t h; + uint64_t tmp = ntohl(n & 0x00000000ffffffff); + h = ntohl(n >> 32); + h |= tmp << 32; + return h; +} +static inline void ntoh128(uint128_t *src, uint128_t *dst) +{ + int i; + for (i = 0; i < 16; i++) + dst->data[15 - i] = src->data[i]; +} +#endif + +#define hton64(x) ntoh64(x) +#define hton128(x, y) ntoh128(x, y) #define BASE_UUID "00000000-0000-1000-8000-00805F9B34FB" static uint128_t *bluetooth_base_uuid = NULL; +#define SDP_BASIC_ATTR_PDUFORM_SIZE 32 +#define SDP_SEQ_PDUFORM_SIZE 128 +#define SDP_UUID_SEQ_SIZE 256 +#define SDP_MAX_ATTR_LEN 65535 + /* Message structure. */ struct tupla { int index; -- cgit From 1e2dec5679c175fc52d2e19ebe06b9e1a7b05461 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 25 Jan 2005 21:36:28 +0000 Subject: Add hci_read_clock() function --- include/hci.h | 14 ++++++++++++++ include/hci_lib.h | 1 + src/hci.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/include/hci.h b/include/hci.h index a5435cd1..640e22da 100644 --- a/include/hci.h +++ b/include/hci.h @@ -821,6 +821,20 @@ typedef struct { } __attribute__ ((packed)) read_afh_map_rp; #define READ_AFH_MAP_RP_SIZE 14 +#define OCF_READ_CLOCK 0x0007 +typedef struct { + uint16_t handle; + uint8_t which_clock; +} __attribute__ ((packed)) read_clock_cp; +#define READ_CLOCK_CP_SIZE 3 +typedef struct { + uint8_t status; + uint16_t handle; + uint32_t clock; + uint16_t accuracy; +} __attribute__ ((packed)) read_clock_rp; +#define READ_CLOCK_RP_SIZE 9 + /* Testing commands */ #define OGF_TESTING_CMD 0x3e diff --git a/include/hci_lib.h b/include/hci_lib.h index f6259f51..ed7ad291 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -96,6 +96,7 @@ int hci_set_afh_classification(int dd, uint8_t *map, int to); int hci_read_link_quality(int dd, uint16_t handle, uint8_t *link_quality, int to); int hci_read_rssi(int dd, uint16_t handle, int8_t *rssi, int to); int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int to); +int hci_read_clock(int dd, uint16_t handle, uint8_t which, uint32_t *clock, uint16_t *accuracy, int to); int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); diff --git a/src/hci.c b/src/hci.c index 87f4874b..387560aa 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1620,6 +1620,37 @@ int hci_read_afh_map(int dd, uint16_t handle, uint8_t *mode, uint8_t *map, int t return 0; } +int hci_read_clock(int dd, uint16_t handle, uint8_t which, uint32_t *clock, uint16_t *accuracy, int to) +{ + read_clock_cp cp; + read_clock_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = handle; + cp.which_clock = which; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_STATUS_PARAM; + rq.ocf = OCF_READ_CLOCK; + rq.cparam = &cp; + rq.clen = READ_CLOCK_CP_SIZE; + rq.rparam = &rp; + rq.rlen = READ_CLOCK_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *clock = rp.clock; + *accuracy = rp.accuracy; + return 0; +} + int hci_local_name(int dd, int len, char *name, int to) { return hci_read_local_name(dd, len, name, to); -- cgit From 816b0a911d833aeb2b8af041b55c7b7c66e43588 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 27 Jan 2005 23:14:46 +0000 Subject: Update the copyright year --- src/bluetooth.c | 2 +- src/hci.c | 2 +- src/sdp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bluetooth.c b/src/bluetooth.c index 20a1aee6..110d65cd 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/hci.c b/src/hci.c index 387560aa..a68f0122 100644 --- a/src/hci.c +++ b/src/hci.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/sdp.c b/src/sdp.c index 6f8ce14b..c6494304 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From f1d23ac858b0593afe27e6b8e00a55d92804a6bb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Jan 2005 03:08:19 +0000 Subject: Update the copyright year --- README | 2 +- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hci_uart.h | 2 +- include/hci_vhci.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README b/README index 935dcccd..4acffe33 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated Copyright (C) 2002-2003 Maxim Krasnyansky -Copyright (C) 2002-2004 Marcel Holtmann +Copyright (C) 2002-2005 Marcel Holtmann Bluetooth libraries diff --git a/include/bluetooth.h b/include/bluetooth.h index 86d3f1d2..a005c1c7 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 05ecbfed..88b922bc 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index 3f8e943c..ae987da0 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index 640e22da..d2efb5fe 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index ed7ad291..7c53f0ed 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_uart.h b/include/hci_uart.h index 0cc97794..c7575586 100644 --- a/include/hci_uart.h +++ b/include/hci_uart.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_vhci.h b/include/hci_vhci.h index 1f5c0efe..88f86562 100644 --- a/include/hci_vhci.h +++ b/include/hci_vhci.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index 7f27fde1..e485eeea 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2004 Marcel Holtmann + * Copyright (C) 2003-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index 7029c32c..1425ab6a 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index d4cfc056..2a1263d6 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index 09ab395e..d07b0153 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index 7cb11bd8..7f8ff538 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 0fa7cb7a..53c74d3f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2004 Marcel Holtmann + * Copyright (C) 2002-2005 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From e6589c0f2a6d1dd3060a86a27d859c8fb08bf278 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Jan 2005 03:24:48 +0000 Subject: Add functions for reading the BD_ADDR and the features --- include/hci.h | 3 +++ include/hci_lib.h | 2 ++ src/hci.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/include/hci.h b/include/hci.h index d2efb5fe..6e41642b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -762,6 +762,7 @@ typedef struct { uint8_t status; uint8_t features[8]; } __attribute__ ((packed)) read_local_features_rp; +#define READ_LOCAL_FEATURES_RP_SIZE 9 #define OCF_READ_BUFFER_SIZE 0x0005 typedef struct { @@ -771,12 +772,14 @@ typedef struct { uint16_t acl_max_pkt; uint16_t sco_max_pkt; } __attribute__ ((packed)) read_buffer_size_rp; +#define READ_BUFFER_SIZE_RP_SIZE 8 #define OCF_READ_BD_ADDR 0x0009 typedef struct { uint8_t status; bdaddr_t bdaddr; } __attribute__ ((packed)) read_bd_addr_rp; +#define READ_BD_ADDR_RP_SIZE 7 /* Status params */ #define OGF_STATUS_PARAM 0x05 diff --git a/include/hci_lib.h b/include/hci_lib.h index 7c53f0ed..1e5ecc96 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -73,6 +73,8 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); +int hci_read_local_features(int dd, uint8_t *features, int to); +int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); int hci_read_voice_setting(int dd, uint16_t *vs, int to); diff --git a/src/hci.c b/src/hci.c index a68f0122..822c7db4 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1042,6 +1042,52 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) return 0; } +int hci_read_local_features(int dd, uint8_t *features, int to) +{ + read_local_features_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_INFO_PARAM; + rq.ocf = OCF_READ_LOCAL_FEATURES; + rq.rparam = &rp; + rq.rlen = READ_LOCAL_FEATURES_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + memcpy(features, rp.features, 8); + return 0; +} + +int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to) +{ + read_bd_addr_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_INFO_PARAM; + rq.ocf = OCF_READ_BD_ADDR; + rq.rparam = &rp; + rq.rlen = READ_BD_ADDR_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + bacpy(bdaddr, &rp.bdaddr); + return 0; +} + int hci_read_class_of_dev(int dd, uint8_t *cls, int to) { read_class_of_dev_rp rp; -- cgit From 601655969dc1dc85696f8aa94cf68a6433228be7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Jan 2005 23:30:04 +0000 Subject: Skip devices in raw mode --- src/hci.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/hci.c b/src/hci.c index 822c7db4..088574f1 100644 --- a/src/hci.c +++ b/src/hci.c @@ -453,51 +453,58 @@ int hci_for_each_dev(int flag, int (*func)(int s, int dev_id, long arg), long ar struct hci_dev_list_req *dl; struct hci_dev_req *dr; int dev_id = -1; - int s, i; + int i, sk; - s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); - if (s < 0) + sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (sk < 0) return -1; dl = malloc(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl)); if (!dl) { - close(s); + close(sk); return -1; } dl->dev_num = HCI_MAX_DEV; dr = dl->dev_req; - if (ioctl(s, HCIGETDEVLIST, (void *)dl)) + if (ioctl(sk, HCIGETDEVLIST, (void *) dl)) goto done; - for (i=0; i < dl->dev_num; i++, dr++) { + for (i = 0; i < dl->dev_num; i++, dr++) { if (hci_test_bit(flag, &dr->dev_opt)) - if (!func || func(s, dr->dev_id, arg)) { + if (!func || func(sk, dr->dev_id, arg)) { dev_id = dr->dev_id; break; } } done: - close(s); + close(sk); free(dl); return dev_id; } -static int __other_bdaddr(int s, int dev_id, long arg) +static int __other_bdaddr(int sk, int dev_id, long arg) { - struct hci_dev_info di = {dev_id: dev_id}; - if (ioctl(s, HCIGETDEVINFO, (void *) &di)) + struct hci_dev_info di = { dev_id: dev_id }; + + if (ioctl(sk, HCIGETDEVINFO, (void *) &di)) return 0; + + if (hci_test_bit(HCI_RAW, &di.flags)) + return 0; + return bacmp((bdaddr_t *) arg, &di.bdaddr); } -static int __same_bdaddr(int s, int dev_id, long arg) +static int __same_bdaddr(int sk, int dev_id, long arg) { - struct hci_dev_info di = {dev_id: dev_id}; - if (ioctl(s, HCIGETDEVINFO, (void *) &di)) + struct hci_dev_info di = { dev_id: dev_id }; + + if (ioctl(sk, HCIGETDEVINFO, (void *) &di)) return 0; + return !bacmp((bdaddr_t *) arg, &di.bdaddr); } -- cgit From 25efdcf40470f471d7d4412f3c5d11e918b8452e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Jan 2005 23:04:28 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index bec2f2dc..2724291a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:14:0 +libbluetooth_la_LDFLAGS = -version-info 1:15:0 INCLUDES = -I$(top_builddir)/include -- cgit From 49ce09906c8786d890da498fe2708c0cd6484c6c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Jan 2005 23:09:22 +0000 Subject: Update changelog and bump version number --- ChangeLog | 8 ++++++++ configure.in | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9bbf3c8f..8f46894c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +ver 2.15: + Use better way for unaligned access. + Remove sdp_internal.h and its usage. + Add deprecated functions for reading the name. + Add function for reading the clock. + Add function for reading the local Bluetooth address. + Add function for reading the local supported features. + ver 2.14: Add function for reading the RSSI. Add function for reading the link quality. diff --git a/configure.in b/configure.in index 2f6373f0..f9ab66e5 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.14) +AM_INIT_AUTOMAKE(bluez-libs, 2.15) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From c608311e7472325514f0578a20d59efc86792e39 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 11 Feb 2005 04:17:16 +0000 Subject: Add function for getting the remote name with a clock offset --- include/hci_lib.h | 1 + src/hci.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 1e5ecc96..e2f06fda 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -69,6 +69,7 @@ int hci_devid(const char *str); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, int len, char *name, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); diff --git a/src/hci.c b/src/hci.c index 088574f1..37715613 100644 --- a/src/hci.c +++ b/src/hci.c @@ -898,7 +898,7 @@ int hci_write_local_name(int dd, const char *name, int to) return 0; } -int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, int len, char *name, int to) { evt_remote_name_req_complete rn; remote_name_req_cp cp; @@ -907,6 +907,7 @@ int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, in memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, bdaddr); cp.pscan_rep_mode = 0x02; + cp.clock_offset = clkoffset; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; @@ -930,6 +931,11 @@ int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, in return 0; } +int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) +{ + return hci_read_remote_name_with_clock_offset(dd, bdaddr, 0x0000, len, name, to); +} + int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) { evt_read_remote_features_complete rp; -- cgit From ce742d95634d8a666a0f4df610c8eac4419d7716 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Feb 2005 02:36:27 +0000 Subject: Fix IAC support --- include/hci.h | 4 ++-- src/hci.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hci.h b/include/hci.h index 6e41642b..4ffa34fc 100644 --- a/include/hci.h +++ b/include/hci.h @@ -688,14 +688,14 @@ typedef struct { typedef struct { uint8_t status; uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; + uint8_t lap[MAX_IAC_LAP][3]; } __attribute__ ((packed)) read_current_iac_lap_rp; #define READ_CURRENT_IAC_LAP_RP_SIZE 2+3*MAX_IAC_LAP #define OCF_WRITE_CURRENT_IAC_LAP 0x003A typedef struct { uint8_t num_current_iac; - uint8_t lap[3][MAX_IAC_LAP]; + uint8_t lap[MAX_IAC_LAP][3]; } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP diff --git a/src/hci.c b/src/hci.c index 37715613..82bdbffc 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1215,7 +1215,7 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_WRITE_CURRENT_IAC_LAP; rq.cparam = &cp; - rq.clen = WRITE_CURRENT_IAC_LAP_CP_SIZE; + rq.clen = num_iac * 3 + 1; return hci_send_req(dd, &rq, to); } -- cgit From db01d7596aa2ba2e40df5d3c7ef9b7cd0489ecad Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Feb 2005 02:37:49 +0000 Subject: The transmit power level is a signed integer --- include/hci_lib.h | 2 +- src/hci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index e2f06fda..d140444a 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -92,7 +92,7 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); -int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, uint8_t *level, int to); +int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); diff --git a/src/hci.c b/src/hci.c index 82bdbffc..83f09d9f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1491,7 +1491,7 @@ int hci_write_afh_mode(int dd, uint8_t mode, int to) return 0; } -int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, uint8_t *level, int to) +int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to) { read_transmit_power_level_cp cp; read_transmit_power_level_rp rp; -- cgit From 1ec0481800a50aa14afe0513f69b4c7c04d5962a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Feb 2005 11:42:03 +0000 Subject: Support pscan_rep_mode for remote name request --- include/hci.h | 6 ++++++ include/hci_lib.h | 3 ++- src/hci.c | 29 ++++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/include/hci.h b/include/hci.h index 4ffa34fc..b651e22d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -395,6 +395,12 @@ typedef struct { } __attribute__ ((packed)) remote_name_req_cp; #define REMOTE_NAME_REQ_CP_SIZE 10 +#define OCF_REMOTE_NAME_REQ_CANCEL 0x001A +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) remote_name_req_cancel_cp; +#define REMOTE_NAME_REQ_CANCEL_CP_SIZE 6 + #define OCF_READ_REMOTE_FEATURES 0x001B typedef struct { uint16_t handle; diff --git a/include/hci_lib.h b/include/hci_lib.h index d140444a..b1ab43cd 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -69,7 +69,8 @@ int hci_devid(const char *str); int hci_read_local_name(int dd, int len, char *name, int to); int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); -int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, int len, char *name, int to); +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint8_t pscan_rep_mode, uint16_t clkoffset, int len, char *name, int to); +int hci_read_remote_name_cancel(int dd, const bdaddr_t *bdaddr, int to); int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); diff --git a/src/hci.c b/src/hci.c index 83f09d9f..a0c0775e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -886,7 +886,9 @@ int hci_write_local_name(int dd, const char *name, int to) change_local_name_cp cp; struct hci_request rq; + memset(&cp, 0, sizeof(cp)); strncpy(cp.name, name, sizeof(cp.name)); + memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; rq.ocf = OCF_CHANGE_LOCAL_NAME; @@ -895,10 +897,11 @@ int hci_write_local_name(int dd, const char *name, int to) if (hci_send_req(dd, &rq, to) < 0) return -1; + return 0; } -int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint16_t clkoffset, int len, char *name, int to) +int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint8_t pscan_rep_mode, uint16_t clkoffset, int len, char *name, int to) { evt_remote_name_req_complete rn; remote_name_req_cp cp; @@ -906,7 +909,7 @@ int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint1 memset(&cp, 0, sizeof(cp)); bacpy(&cp.bdaddr, bdaddr); - cp.pscan_rep_mode = 0x02; + cp.pscan_rep_mode = pscan_rep_mode; cp.clock_offset = clkoffset; memset(&rq, 0, sizeof(rq)); @@ -933,7 +936,27 @@ int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint1 int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to) { - return hci_read_remote_name_with_clock_offset(dd, bdaddr, 0x0000, len, name, to); + return hci_read_remote_name_with_clock_offset(dd, bdaddr, 0x02, 0x0000, len, name, to); +} + +int hci_read_remote_name_cancel(int dd, const bdaddr_t *bdaddr, int to) +{ + remote_name_req_cancel_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.bdaddr, bdaddr); + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_REMOTE_NAME_REQ_CANCEL; + rq.cparam = &cp; + rq.clen = REMOTE_NAME_REQ_CANCEL_CP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + return 0; } int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) -- cgit From 28b4f0aea5b15ed7c0acd17ab79705a38ffe7c2f Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Mon, 28 Feb 2005 12:19:25 +0000 Subject: fix incorrect doc comment --- include/sdp_lib.h | 2 +- src/sdp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 53c74d3f..6a5d7d82 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -286,7 +286,7 @@ void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char * * sdp_list_t *rsp_list * This variable is set on a successful return if there are * non-zero service handles. It is a singly linked list of - * service records (sdp_record_t) + * service record handles (uint16_t) */ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num, sdp_list_t **rsp_list); diff --git a/src/sdp.c b/src/sdp.c index c6494304..82bd996d 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2629,7 +2629,7 @@ static int copy_cstate(char *pdata, const sdp_cstate_t *cstate) * sdp_list_t **rsp_list * This variable is set on a successful return if there are * non-zero service handles. It is a singly linked list of - * service records (sdp_record_t *) + * service record handles (uint16_t) */ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num, sdp_list_t **rsp) -- cgit From 8b11908eac4e0b4e14534ec2d44ae62806fdfd2f Mon Sep 17 00:00:00 2001 From: Stephen Crane Date: Wed, 2 Mar 2005 10:23:16 +0000 Subject: fix comments --- include/sdp_lib.h | 3 ++- src/sdp.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 6a5d7d82..7661d24e 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -393,7 +393,8 @@ void sdp_record_free(sdp_record_t *rec); * record first and set its attributes using setXXX() methods. * * The service provider must then call sdp_record_register() to make - * the service record visible to SDP clients. + * the service record visible to SDP clients. This function returns 0 + * on success or -1 on failure (and sets errno). */ int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); diff --git a/src/sdp.c b/src/sdp.c index 82bd996d..d2b40380 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2286,8 +2286,7 @@ void sdp_append_to_pdu(sdp_buf_t *pdu, sdp_data_t *d) * It is incorrect to call this method on a record that * has been already registered with the server. * - * Returns a non-null value (a pointer) to a service - * record if successful, else -1 setting errno + * Returns zero on success, otherwise -1 (and sets errno). */ int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags) { -- cgit From 8bd7ef87e49b68c3090448f337454a1704f5e048 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 9 Mar 2005 17:04:37 +0000 Subject: Add some extra debug information --- src/sdp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdp.c b/src/sdp.c index d2b40380..1e474db4 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -41,6 +41,8 @@ #include #include #include +#include +#include #include #include @@ -1008,7 +1010,9 @@ static void attr_print_func(void *value, void *userData) void sdp_print_service_attr(sdp_list_t *svcAttrList) { + SDPDBG("Printing service attr list %p\n", svcAttrList); sdp_list_foreach(svcAttrList, attr_print_func, NULL); + SDPDBG("Printed service attr list %p\n", svcAttrList); } #endif -- cgit From 9280b803576dc54bfc7f51c8e5154d1f29692991 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 14:37:59 +0000 Subject: Add ba*printf() functions --- include/bluetooth.h | 7 ++++++- src/bluetooth.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index a005c1c7..d7747996 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -36,9 +36,9 @@ extern "C" { #endif #include +#include #include #include -#include #ifndef AF_BLUETOOTH #define AF_BLUETOOTH 31 @@ -129,6 +129,11 @@ char *batostr(const bdaddr_t *ba); int ba2str(const bdaddr_t *ba, char *str); int str2ba(const char *str, bdaddr_t *ba); +int baprintf(const char *format, ...); +int bafprintf(FILE *stream, const char *format, ...); +int basprintf(char *str, const char *format, ...); +int basnprintf(char *str, size_t size, const char *format, ...); + int bt_error(uint16_t code); char *bt_compidtostr(int id); diff --git a/src/bluetooth.c b/src/bluetooth.c index 110d65cd..484b263b 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -33,9 +33,10 @@ #endif #include +#include +#include #include #include -#include #include #include @@ -105,6 +106,54 @@ int str2ba(const char *str, bdaddr_t *ba) return 0; } +int baprintf(const char *format, ...) +{ + va_list ap; + int len; + + va_start(ap, format); + len = vprintf(format, ap); + va_end(ap); + + return len; +} + +int bafprintf(FILE *stream, const char *format, ...) +{ + va_list ap; + int len; + + va_start(ap, format); + len = vfprintf(stream, format, ap); + va_end(ap); + + return len; +} + +int basprintf(char *str, const char *format, ...) +{ + va_list ap; + int len; + + va_start(ap, format); + len = vsnprintf(str, (~0U) >> 1, format, ap); + va_end(ap); + + return len; +} + +int basnprintf(char *str, size_t size, const char *format, ...) +{ + va_list ap; + int len; + + va_start(ap, format); + len = vsnprintf(str, size, format, ap); + va_end(ap); + + return len; +} + /* Bluetooth error codes to Unix errno mapping */ int bt_error(uint16_t code) { -- cgit From 4c2d1cbe438713b5d6c350ee0983e1d312c69823 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 14:43:44 +0000 Subject: Add ba2oui() function --- include/bluetooth.h | 1 + src/bluetooth.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index d7747996..276831ae 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -128,6 +128,7 @@ bdaddr_t *strtoba(const char *str); char *batostr(const bdaddr_t *ba); int ba2str(const bdaddr_t *ba, char *str); int str2ba(const char *str, bdaddr_t *ba); +int ba2oui(const bdaddr_t *ba, char *oui); int baprintf(const char *format, ...); int bafprintf(FILE *stream, const char *format, ...); diff --git a/src/bluetooth.c b/src/bluetooth.c index 484b263b..0f4c49e6 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -106,6 +106,14 @@ int str2ba(const char *str, bdaddr_t *ba) return 0; } +int ba2oui(const bdaddr_t *ba, char *str) +{ + uint8_t b[6]; + + baswap((bdaddr_t *) b, ba); + return sprintf(str, "%2.2X-%2.2X-%2.2X", b[0], b[1], b[2]); +} + int baprintf(const char *format, ...) { va_list ap; -- cgit From 6ebd5cc786e2b2c4d0da4c69543a06e12deb7db7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 19:16:49 +0000 Subject: Change the packet type mask --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index b651e22d..f22a3daa 100644 --- a/include/hci.h +++ b/include/hci.h @@ -142,7 +142,7 @@ enum { #define HCI_3EV5 0x0200 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) -#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) +#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DM5) /* HCI Error codes */ #define HCI_UNKNOWN_COMMAND 0x01 -- cgit From 973c22b7aa5ba83bef47f2f523551ac81fb10fcb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 27 Mar 2005 19:21:15 +0000 Subject: Fix a small typo --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index f22a3daa..7311e169 100644 --- a/include/hci.h +++ b/include/hci.h @@ -142,7 +142,7 @@ enum { #define HCI_3EV5 0x0200 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) -#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DM5) +#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DH1 | HCI_DM3 | HCI_DH3 | HCI_DM5 | HCI_DH5) /* HCI Error codes */ #define HCI_UNKNOWN_COMMAND 0x01 -- cgit From 2b77e2e8198e16cae6d1411c4ec65bf87d6c4dd7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 11 Apr 2005 14:37:24 +0000 Subject: Add inquiry info structure with RSSI and page scan mode --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hci.h b/include/hci.h index 7311e169..3368121d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1039,6 +1039,16 @@ typedef struct { int8_t rssi; } __attribute__ ((packed)) inquiry_info_with_rssi; #define INQUIRY_INFO_WITH_RSSI_SIZE 14 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t pscan_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; + int8_t rssi; +} __attribute__ ((packed)) inquiry_info_with_rssi_and_pscan_mode; +#define INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE 15 #define EVT_TESTING 0xFE -- cgit From 607eee46b4e197ef0b3e73359b89daa0a8705516 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 13:09:06 +0000 Subject: Fix buffer allocation for features to string conversion --- src/hci.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/hci.c b/src/hci.c index a0c0775e..ddcd680b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -414,9 +414,20 @@ static hci_map lmp_features_map[8][9] = { char *lmp_featurestostr(uint8_t *features, char *pref, int width) { - char *off, *ptr, *str = malloc(400); - int i; + char *off, *ptr, *str; + int i, size = 0; + for (i = 0; i < 8; i++) { + hci_map *m = lmp_features_map[i]; + + while (m->str) { + if ((unsigned int) m->val & (unsigned int) features[i]) + size += strlen(m->str) + (pref ? strlen(pref) : 0) + 1; + m++; + } + } + + str = malloc(size); if (!str) return NULL; @@ -427,10 +438,9 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) off = ptr; - for (i = 0; i < 8; i++) { - hci_map *m; + for (i = 0; i < 8; i++) { + hci_map *m = lmp_features_map[i]; - m = lmp_features_map[i]; while (m->str) { if ((unsigned int) m->val & (unsigned int) features[i]) { if (strlen(off) + strlen(m->str) > width - 1) { -- cgit From 9ecc944c96728a92691e02db0f01e092df92bed8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 20:35:47 +0000 Subject: Add definition for max slots change event --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hci.h b/include/hci.h index 3368121d..7489c1c8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1007,6 +1007,13 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_MAX_SLOTS_CHANGE 0x1B +typedef struct { + uint16_t handle; + uint8_t max_slots; +} __attribute__ ((packed)) evt_max_slots_change; +#define EVT_MAX_SLOTS_CHANGE_SIZE 3 + #define EVT_READ_CLOCK_OFFSET_COMPLETE 0x1C typedef struct { uint8_t status; -- cgit From c875d7ca57c3e5bad8c8af080c7d33f85a499c07 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 20:50:54 +0000 Subject: Add definition for page scan repetition mode change event --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hci.h b/include/hci.h index 7489c1c8..5502e2b5 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1036,6 +1036,13 @@ typedef struct { } __attribute__ ((packed)) evt_qos_violation; #define EVT_QOS_VIOLATION_SIZE 2 +#define EVT_PSCAN_REP_MODE_CHANGE 0x20 +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; +} __attribute__ ((packed)) evt_pscan_rep_mode_change; +#define EVT_PSCAN_REP_MODE_CHANGE_SIZE 7 + #define EVT_INQUIRY_RESULT_WITH_RSSI 0x22 typedef struct { bdaddr_t bdaddr; -- cgit From 01aab15cf710601c93457042507b433474a78c04 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 21:30:19 +0000 Subject: Add definition for remote extended features event --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hci.h b/include/hci.h index 5502e2b5..3f811ffa 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1064,6 +1064,16 @@ typedef struct { } __attribute__ ((packed)) inquiry_info_with_rssi_and_pscan_mode; #define INQUIRY_INFO_WITH_RSSI_AND_PSCAN_MODE_SIZE 15 +#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE 0x23 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t page_num; + uint8_t max_page_num; + uint8_t features[8]; +} __attribute__ ((packed)) evt_read_remote_ext_features_complete; +#define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE 13 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From 456c8fd652c0d96500adef3dd7abb067a000bc50 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 21:45:50 +0000 Subject: Add definitions for local extended features and commands --- include/hci.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/include/hci.h b/include/hci.h index 3f811ffa..fce19b9c 100644 --- a/include/hci.h +++ b/include/hci.h @@ -407,6 +407,13 @@ typedef struct { } __attribute__ ((packed)) read_remote_features_cp; #define READ_REMOTE_FEATURES_CP_SIZE 2 +#define OCF_READ_REMOTE_EXT_FEATURES 0x001C +typedef struct { + uint16_t handle; + uint8_t page_num; +} __attribute__ ((packed)) read_remote_ext_features_cp; +#define READ_REMOTE_EXT_FEATURES_CP_SIZE 3 + #define OCF_READ_REMOTE_VERSION 0x001D typedef struct { uint16_t handle; @@ -763,6 +770,13 @@ typedef struct { } __attribute__ ((packed)) read_local_version_rp; #define READ_LOCAL_VERSION_RP_SIZE 9 +#define OCF_READ_LOCAL_COMMANDS 0x0002 +typedef struct { + uint8_t status; + uint8_t commands[64]; +} __attribute__ ((packed)) read_local_commands_rp; +#define READ_LOCAL_COMMANDS_RP_SIZE 65 + #define OCF_READ_LOCAL_FEATURES 0x0003 typedef struct { uint8_t status; @@ -770,6 +784,15 @@ typedef struct { } __attribute__ ((packed)) read_local_features_rp; #define READ_LOCAL_FEATURES_RP_SIZE 9 +#define OCF_READ_LOCAL_EXT_FEATURES 0x0004 +typedef struct { + uint8_t status; + uint8_t page_num; + uint8_t max_page_num; + uint8_t features[8]; +} __attribute__ ((packed)) read_local_ext_features_rp; +#define READ_LOCAL_EXT_FEATURES_RP_SIZE 11 + #define OCF_READ_BUFFER_SIZE 0x0005 typedef struct { uint8_t status; -- cgit From d213d431b00c0ab451257e688dfad9fb20037088 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 22:34:04 +0000 Subject: Add definition for master link key command --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hci.h b/include/hci.h index fce19b9c..a0c85e74 100644 --- a/include/hci.h +++ b/include/hci.h @@ -386,6 +386,12 @@ typedef struct { } __attribute__ ((packed)) change_conn_link_key_cp; #define CHANGE_CONN_LINK_KEY_CP_SIZE 2 +#define OCF_MASTER_LINK_KEY 0x0017 +typedef struct { + uint8_t key_flag; +} __attribute__ ((packed)) master_link_key_cp; +#define MASTER_LINK_KEY_CP_SIZE 1 + #define OCF_REMOTE_NAME_REQ 0x0019 typedef struct { bdaddr_t bdaddr; @@ -785,6 +791,10 @@ typedef struct { #define READ_LOCAL_FEATURES_RP_SIZE 9 #define OCF_READ_LOCAL_EXT_FEATURES 0x0004 +typedef struct { + uint8_t page_num; +} __attribute__ ((packed)) read_local_ext_features_cp; +#define READ_LOCAL_EXT_FEATURES_CP_SIZE 1 typedef struct { uint8_t status; uint8_t page_num; -- cgit From 4582e03695aaf2f41e3d6341f9a49c383f103320 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 22:38:24 +0000 Subject: Add definition for master link key complete event --- include/hci.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/hci.h b/include/hci.h index a0c85e74..f20a64b3 100644 --- a/include/hci.h +++ b/include/hci.h @@ -954,6 +954,14 @@ typedef struct { } __attribute__ ((packed)) evt_change_conn_link_key_complete; #define EVT_CHANGE_CONN_LINK_KEY_COMPLETE_SIZE 3 +#define EVT_MASTER_LINK_KEY_COMPLETE 0x0A +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t key_flag; +} __attribute__ ((packed)) evt_master_link_key_complete; +#define EVT_MASTER_LINK_KEY_COMPLETE_SIZE 4 + #define EVT_READ_REMOTE_FEATURES_COMPLETE 0x0B typedef struct { uint8_t status; -- cgit From be2d979b6a592484862e78bed355d079f7eeb1e6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 23:14:52 +0000 Subject: Add funtions for reading local supported commands and extended features --- include/hci_lib.h | 2 ++ src/hci.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index b1ab43cd..36347d5a 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -75,7 +75,9 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); +int hci_read_local_commands(int dd, uint8_t *commands, int to); int hci_read_local_features(int dd, uint8_t *features, int to); +int hci_read_local_ext_features(int dd, uint8_t page, uint8_t *max_page, uint8_t *features, int to); int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to); int hci_read_class_of_dev(int dd, uint8_t *cls, int to); int hci_write_class_of_dev(int dd, uint32_t cls, int to); diff --git a/src/hci.c b/src/hci.c index ddcd680b..6e1067c4 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1088,6 +1088,29 @@ int hci_read_local_version(int dd, struct hci_version *ver, int to) return 0; } +int hci_read_local_commands(int dd, uint8_t *commands, int to) +{ + read_local_commands_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_INFO_PARAM; + rq.ocf = OCF_READ_LOCAL_COMMANDS; + rq.rparam = &rp; + rq.rlen = READ_LOCAL_COMMANDS_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + memcpy(commands, rp.commands, 64); + return 0; +} + int hci_read_local_features(int dd, uint8_t *features, int to) { read_local_features_rp rp; @@ -1111,6 +1134,35 @@ int hci_read_local_features(int dd, uint8_t *features, int to) return 0; } +int hci_read_local_ext_features(int dd, uint8_t page, uint8_t *max_page, uint8_t *features, int to) +{ + read_local_ext_features_cp cp; + read_local_ext_features_rp rp; + struct hci_request rq; + + cp.page_num = page; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_INFO_PARAM; + rq.ocf = OCF_READ_LOCAL_EXT_FEATURES; + rq.cparam = &cp; + rq.clen = READ_LOCAL_EXT_FEATURES_CP_SIZE; + rq.rparam = &rp; + rq.rlen = READ_LOCAL_EXT_FEATURES_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *max_page = rp.max_page_num; + memcpy(features, rp.features, 8); + return 0; +} + int hci_read_bd_addr(int dd, bdaddr_t *bdaddr, int to) { read_bd_addr_rp rp; -- cgit From 0887d119a0b61e38cbd3d30e207c09eb5a5ff463 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 17 Apr 2005 23:31:54 +0000 Subject: Add function for remote extended features --- include/hci_lib.h | 3 ++- src/hci.c | 54 +++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index 36347d5a..2ffdef78 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -71,8 +71,9 @@ int hci_write_local_name(int dd, const char *name, int to); int hci_read_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint8_t pscan_rep_mode, uint16_t clkoffset, int len, char *name, int to); int hci_read_remote_name_cancel(int dd, const bdaddr_t *bdaddr, int to); -int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to); +int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to); +int hci_read_remote_ext_features(int dd, uint16_t handle, uint8_t page, uint8_t *max_page, uint8_t *features, int to); int hci_read_clock_offset(int dd, uint16_t handle, uint16_t *clkoffset, int to); int hci_read_local_version(int dd, struct hci_version *ver, int to); int hci_read_local_commands(int dd, uint8_t *commands, int to); diff --git a/src/hci.c b/src/hci.c index 6e1067c4..e04e55a8 100644 --- a/src/hci.c +++ b/src/hci.c @@ -969,6 +969,38 @@ int hci_read_remote_name_cancel(int dd, const bdaddr_t *bdaddr, int to) return 0; } +int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to) +{ + evt_read_remote_version_complete rp; + read_remote_version_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = handle; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_LINK_CTL; + rq.ocf = OCF_READ_REMOTE_VERSION; + rq.event = EVT_READ_REMOTE_VERSION_COMPLETE; + rq.cparam = &cp; + rq.clen = READ_REMOTE_VERSION_CP_SIZE; + rq.rparam = &rp; + rq.rlen = EVT_READ_REMOTE_VERSION_COMPLETE_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + ver->manufacturer = btohs(rp.manufacturer); + ver->lmp_ver = rp.lmp_ver; + ver->lmp_subver = btohs(rp.lmp_subver); + return 0; +} + int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) { evt_read_remote_features_complete rp; @@ -999,23 +1031,24 @@ int hci_read_remote_features(int dd, uint16_t handle, uint8_t *features, int to) return 0; } -int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, int to) +int hci_read_remote_ext_features(int dd, uint16_t handle, uint8_t page, uint8_t *max_page, uint8_t *features, int to) { - evt_read_remote_version_complete rp; - read_remote_version_cp cp; + evt_read_remote_ext_features_complete rp; + read_remote_ext_features_cp cp; struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = handle; + cp.handle = handle; + cp.page_num = page; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_LINK_CTL; - rq.ocf = OCF_READ_REMOTE_VERSION; - rq.event = EVT_READ_REMOTE_VERSION_COMPLETE; + rq.ocf = OCF_READ_REMOTE_EXT_FEATURES; + rq.event = EVT_READ_REMOTE_EXT_FEATURES_COMPLETE; rq.cparam = &cp; - rq.clen = READ_REMOTE_VERSION_CP_SIZE; + rq.clen = READ_REMOTE_EXT_FEATURES_CP_SIZE; rq.rparam = &rp; - rq.rlen = EVT_READ_REMOTE_VERSION_COMPLETE_SIZE; + rq.rlen = EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE; if (hci_send_req(dd, &rq, to) < 0) return -1; @@ -1025,9 +1058,8 @@ int hci_read_remote_version(int dd, uint16_t handle, struct hci_version *ver, in return -1; } - ver->manufacturer = btohs(rp.manufacturer); - ver->lmp_ver = rp.lmp_ver; - ver->lmp_subver = btohs(rp.lmp_subver); + *max_page = rp.max_page_num; + memcpy(features, rp.features, 8); return 0; } -- cgit From 8805ca9a84b178e5ae082c9a115ee55bbdae5263 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:08:58 +0000 Subject: Add definitions for hardware error and flush occurred events --- include/hci.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/hci.h b/include/hci.h index f20a64b3..aa0b7202 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1004,6 +1004,18 @@ typedef struct { } __attribute__ ((packed)) evt_cmd_status; #define EVT_CMD_STATUS_SIZE 4 +#define EVT_HARDWARE_ERROR 0x10 +typedef struct { + uint8_t code; +} __attribute__ ((packed)) evt_hardware_error; +#define EVT_HARDWARE_ERROR_SIZE 1 + +#define EVT_FLUSH_OCCURRED 0x11 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) evt_flush_occured; +#define EVT_FLUSH_OCCURRED_SIZE 2 + #define EVT_ROLE_CHANGE 0x12 typedef struct { uint8_t status; -- cgit From b68e3ca7a1e5f3215bfc4408c86059ed4f76f2fd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:13:33 +0000 Subject: Add definition for return link keys event --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hci.h b/include/hci.h index aa0b7202..9da3172f 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1040,6 +1040,13 @@ typedef struct { } __attribute__ ((packed)) evt_mode_change; #define EVT_MODE_CHANGE_SIZE 6 +#define EVT_RETURN_LINK_KEYS 0x15 +typedef struct { + uint8_t num_keys; + /* variable length part */ +} __attribute__ ((packed)) evt_return_link_keys; +#define EVT_RETURN_LINK_KEYS_SIZE 1 + #define EVT_PIN_CODE_REQ 0x16 typedef struct { bdaddr_t bdaddr; -- cgit From 845167a090206487c79d851d3989f5af188b708c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:31:11 +0000 Subject: Add definitions for loopback command and data overflow events --- include/hci.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/hci.h b/include/hci.h index 9da3172f..8c208303 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1067,6 +1067,14 @@ typedef struct { } __attribute__ ((packed)) evt_link_key_notify; #define EVT_LINK_KEY_NOTIFY_SIZE 23 +#define EVT_LOOPBACK_COMMAND 0x19 + +#define EVT_DATA_BUFFER_OVERFLOW 0x1A +typedef struct { + uint8_t link_type; +} __attribute__ ((packed)) evt_data_buffer_overflow; +#define EVT_DATA_BUFFER_OVERFLOW_SIZE 1 + #define EVT_MAX_SLOTS_CHANGE 0x1B typedef struct { uint16_t handle; -- cgit From 788fef63f4ab0f7948726bbc4e442f4ede573285 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 14:41:26 +0000 Subject: Add definition for flow specification complete event --- include/hci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hci.h b/include/hci.h index 8c208303..dfb866bd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1111,6 +1111,16 @@ typedef struct { } __attribute__ ((packed)) evt_pscan_rep_mode_change; #define EVT_PSCAN_REP_MODE_CHANGE_SIZE 7 +#define EVT_FLOW_SPEC_COMPLETE 0x21 +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t flags; + uint8_t direction; + hci_qos qos; +} __attribute__ ((packed)) evt_flow_spec_complete; +#define EVT_FLOW_SPEC_COMPLETE_SIZE (5 + HCI_QOS_CP_SIZE) + #define EVT_INQUIRY_RESULT_WITH_RSSI 0x22 typedef struct { bdaddr_t bdaddr; -- cgit From ddcf94ef9f9f154b8263932a3c372894a61a2bff Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 15:00:58 +0000 Subject: Add definitions for synchronous connection events --- include/hci.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/hci.h b/include/hci.h index dfb866bd..af2e0dd1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1152,6 +1152,31 @@ typedef struct { } __attribute__ ((packed)) evt_read_remote_ext_features_complete; #define EVT_READ_REMOTE_EXT_FEATURES_COMPLETE_SIZE 13 +#define EVT_SYNC_CONN_COMPLETE 0x2C +typedef struct { + uint8_t status; + uint16_t handle; + bdaddr_t bdaddr; + uint8_t link_type; + uint8_t trans_interval; + uint8_t retrans_window; + uint16_t rx_pkt_len; + uint16_t tx_pkt_len; + uint8_t air_mode; +} __attribute__ ((packed)) evt_sync_conn_complete; +#define EVT_SYNC_CONN_COMPLETE_SIZE 17 + +#define EVT_SYNC_CONN_CHANGED 0x2D +typedef struct { + uint8_t status; + uint16_t handle; + uint8_t trans_interval; + uint8_t retrans_window; + uint16_t rx_pkt_len; + uint16_t tx_pkt_len; +} __attribute__ ((packed)) evt_sync_conn_changed; +#define EVT_SYNC_CONN_CHANGED_SIZE 9 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From fc64a954aa13eba73b3c24d20aac597576b0e840 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 16:10:19 +0000 Subject: Add missing definitions for the link control commands --- include/hci.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/include/hci.h b/include/hci.h index af2e0dd1..e13989ca 100644 --- a/include/hci.h +++ b/include/hci.h @@ -327,6 +327,12 @@ typedef struct { } __attribute__ ((packed)) add_sco_cp; #define ADD_SCO_CP_SIZE 4 +#define OCF_CREATE_CONN_CANCEL 0x0008 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) create_conn_cancel_cp; +#define CREATE_CONN_CANCEL_CP_SIZE 6 + #define OCF_ACCEPT_CONN_REQ 0x0009 typedef struct { bdaddr_t bdaddr; @@ -432,6 +438,39 @@ typedef struct { } __attribute__ ((packed)) read_clock_offset_cp; #define READ_CLOCK_OFFSET_CP_SIZE 2 +#define OCF_READ_LMP_HANDLE 0x0020 + +#define OCF_SETUP_SYNC_CONN 0x0028 +typedef struct { + uint16_t handle; + uint32_t tx_bandwith; + uint32_t rx_bandwith; + uint16_t max_latency; + uint16_t voice_setting; + uint8_t retrans_effort; + uint16_t pkt_type; +} __attribute__ ((packed)) setup_sync_conn_cp; +#define SETUP_SYNC_CONN_CP_SIZE 17 + +#define OCF_ACCEPT_SYNC_CONN_REQ 0x0029 +typedef struct { + bdaddr_t bdaddr; + uint32_t tx_bandwith; + uint32_t rx_bandwith; + uint16_t max_latency; + uint16_t voice_setting; + uint8_t retrans_effort; + uint16_t pkt_type; +} __attribute__ ((packed)) accept_sync_conn_req_cp; +#define ACCEPT_SYNC_CONN_REQ_CP_SIZE 21 + +#define OCF_REJECT_SYNC_CONN_REQ 0x002A +typedef struct { + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) reject_sync_conn_req_cp; +#define REJECT_SYNC_CONN_REQ_CP_SIZE 7 + /* Link Policy */ #define OGF_LINK_POLICY 0x02 -- cgit From f1684dcb1badc1dfba7ad4133b8d6cac3e77c759 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 22:00:32 +0000 Subject: Support inquiry with unlimited number of responses --- src/hci.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hci.c b/src/hci.c index e04e55a8..6e7fa987 100644 --- a/src/hci.c +++ b/src/hci.c @@ -577,11 +577,14 @@ int hci_devba(int dev_id, bdaddr_t *bdaddr) int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info **ii, long flags) { struct hci_inquiry_req *ir; + uint8_t num_rsp = nrsp; void *buf; int s, err; - if (nrsp <= 0) - nrsp = 200; /* enough ? */ + if (nrsp <= 0) { + num_rsp = 0; + nrsp = 255; + } if (dev_id < 0 && (dev_id = hci_get_route(NULL)) < 0) { errno = ENODEV; @@ -600,7 +603,7 @@ int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info ir = buf; ir->dev_id = dev_id; - ir->num_rsp = nrsp; + ir->num_rsp = num_rsp; ir->length = len; ir->flags = flags; -- cgit From 137bc70b64b7b1d8280a6580532007e27e2c7e3f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 22:55:19 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 2724291a..2be03d47 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:15:0 +libbluetooth_la_LDFLAGS = -version-info 1:16:0 INCLUDES = -I$(top_builddir)/include -- cgit From a4b42bf7e70eaf50bfd7889ac2a3d67a91b5dd48 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 18 Apr 2005 22:56:34 +0000 Subject: Update changelog and bump version number --- ChangeLog | 10 ++++++++++ configure.in | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8f46894c..6559577e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +ver 2.16: + Fix buffer allocation for features to string conversion. + Add function for reading local supported commands. + Add function for reading local extended features. + Add function for reading remote extended features. + Add function for getting the remote name with a clock offset. + Add function for extracting the OUI from a BD_ADDR. + Add inquiry info structure with RSSI and page scan mode. + Support inquiry with unlimited number of responses. + ver 2.15: Use better way for unaligned access. Remove sdp_internal.h and its usage. diff --git a/configure.in b/configure.in index f9ab66e5..2b58fbad 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.15) +AM_INIT_AUTOMAKE(bluez-libs, 2.16) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 7bf5fa8168f2b3da602189b962caa6fa81bb57ba Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 20 Apr 2005 12:23:13 +0000 Subject: Include stdio.h within bluetooth.h --- include/bluetooth.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 276831ae..33d68a61 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -35,6 +35,7 @@ extern "C" { #endif +#include #include #include #include -- cgit From 0b7448998d6d60adfb99be292b80706666257750 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 21 Apr 2005 21:48:57 +0000 Subject: Remove depcomp file --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 4dbfb31a..0585ddd3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,4 +18,4 @@ DISTCLEANFILES = bluez.pc MAINTAINERCLEANFILES = Makefile.in \ aclocal.m4 configure config.h.in config.sub config.guess \ - ltmain.sh missing install-sh mkinstalldirs + ltmain.sh depcomp missing install-sh mkinstalldirs -- cgit From 18cd6ecb4eae48ffdcf6df2bbf5fd828459c6cec Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 27 Apr 2005 10:49:43 +0000 Subject: Include sys/socket.h in the header files --- include/hci.h | 2 ++ include/l2cap.h | 2 ++ include/rfcomm.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/include/hci.h b/include/hci.h index e13989ca..2a7fc786 100644 --- a/include/hci.h +++ b/include/hci.h @@ -35,6 +35,8 @@ extern "C" { #endif +#include + #define HCI_MAX_DEV 16 #define HCI_MAX_ACL_SIZE 1024 diff --git a/include/l2cap.h b/include/l2cap.h index 1425ab6a..ae88c7a0 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -35,6 +35,8 @@ extern "C" { #endif +#include + /* L2CAP defaults */ #define L2CAP_DEFAULT_MTU 672 #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF diff --git a/include/rfcomm.h b/include/rfcomm.h index 2a1263d6..8a1d56e9 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -34,6 +34,8 @@ extern "C" { #endif +#include + /* RFCOMM defaults */ #define RFCOMM_DEFAULT_MTU 127 -- cgit From f51d996c92192762463e69b5b68e497258588508 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 27 Apr 2005 12:01:19 +0000 Subject: Add definitions for stored link keys --- include/hci.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/hci.h b/include/hci.h index 2a7fc786..b797cae6 100644 --- a/include/hci.h +++ b/include/hci.h @@ -598,6 +598,43 @@ typedef struct { #define CONN_SETUP_AUTO_OFF 0x01 #define CONN_SETUP_AUTO_ON 0x02 +#define OCF_READ_STORED_LINK_KEY 0x000D +typedef struct { + bdaddr_t bdaddr; + uint8_t read_all; +} __attribute__ ((packed)) read_stored_link_key_cp; +#define READ_STORED_LINK_KEY_CP_SIZE 7 +typedef struct { + uint8_t status; + uint16_t max_keys; + uint16_t num_keys; +} __attribute__ ((packed)) read_stored_link_key_rp; +#define READ_STORED_LINK_KEY_RP_SIZE 5 + +#define OCF_WRITE_STORED_LINK_KEY 0x0011 +typedef struct { + uint8_t num_keys; + /* variable length part */ +} __attribute__ ((packed)) write_stored_link_key_cp; +#define WRITE_STORED_LINK_KEY_CP_SIZE 1 +typedef struct { + uint8_t status; + uint8_t num_keys; +} __attribute__ ((packed)) write_stored_link_key_rp; +#define READ_WRITE_LINK_KEY_RP_SIZE 2 + +#define OCF_DELETE_STORED_LINK_KEY 0x0012 +typedef struct { + bdaddr_t bdaddr; + uint8_t delete_all; +} __attribute__ ((packed)) delete_stored_link_key_cp; +#define DELETE_STORED_LINK_KEY_CP_SIZE 7 +typedef struct { + uint8_t status; + uint16_t num_keys; +} __attribute__ ((packed)) delete_stored_link_key_rp; +#define DELETE_STORED_LINK_KEY_RP_SIZE 3 + #define OCF_CHANGE_LOCAL_NAME 0x0013 typedef struct { uint8_t name[248]; -- cgit From 48954bd49fdd7189bb725038801f3ca0ff2f4d12 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 1 May 2005 14:52:53 +0000 Subject: Add functions for stored link keys --- include/hci_lib.h | 3 +++ src/hci.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 2ffdef78..7761bb99 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -86,6 +86,9 @@ int hci_read_voice_setting(int dd, uint16_t *vs, int to); int hci_write_voice_setting(int dd, uint16_t vs, int to); int hci_read_current_iac_lap(int dd, uint8_t *num_iac, uint8_t *lap, int to); int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to); +int hci_read_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to); +int hci_write_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t *key, int to); +int hci_delete_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to); int hci_authenticate_link(int dd, uint16_t handle, int to); int hci_encrypt_link(int dd, uint16_t handle, uint8_t encrypt, int to); int hci_change_link_key(int dd, uint16_t handle, int to); diff --git a/src/hci.c b/src/hci.c index 6e7fa987..60898e9b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1340,6 +1340,61 @@ int hci_write_current_iac_lap(int dd, uint8_t num_iac, uint8_t *lap, int to) return hci_send_req(dd, &rq, to); } +int hci_read_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to) +{ + read_stored_link_key_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.bdaddr, bdaddr); + cp.read_all = all; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_STORED_LINK_KEY; + rq.cparam = &cp; + rq.clen = READ_STORED_LINK_KEY_CP_SIZE; + + return hci_send_req(dd, &rq, to); +} + +int hci_write_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t *key, int to) +{ + unsigned char cp[WRITE_STORED_LINK_KEY_CP_SIZE + 6 + 16]; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp[0] = 1; + bacpy((bdaddr_t *) (cp + 1), bdaddr); + memcpy(cp + 7, key, 16); + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_STORED_LINK_KEY; + rq.cparam = &cp; + rq.clen = WRITE_STORED_LINK_KEY_CP_SIZE + 6 + 16; + + return hci_send_req(dd, &rq, to); +} + +int hci_delete_stored_link_key(int dd, bdaddr_t *bdaddr, uint8_t all, int to) +{ + delete_stored_link_key_cp cp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.bdaddr, bdaddr); + cp.delete_all = all; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_DELETE_STORED_LINK_KEY; + rq.cparam = &cp; + rq.clen = DELETE_STORED_LINK_KEY_CP_SIZE; + + return hci_send_req(dd, &rq, to); +} + int hci_authenticate_link(int dd, uint16_t handle, int to) { auth_requested_cp cp; -- cgit From a28f053fed22e73e57c701d146983e1fcd0dcac3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 8 May 2005 12:24:54 +0000 Subject: Add definitions for reading/writing the PIN type and creating the unit key --- include/hci.h | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/include/hci.h b/include/hci.h index b797cae6..86ffe8c9 100644 --- a/include/hci.h +++ b/include/hci.h @@ -576,6 +576,12 @@ typedef struct { /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 +#define OCF_SET_EVENT_MASK 0x0001 +typedef struct { + uint8_t mask[8]; +} __attribute__ ((packed)) set_event_mask_cp; +#define SET_EVENT_MASK_CP_SIZE 8 + #define OCF_RESET 0x0003 #define OCF_SET_EVENT_FLT 0x0005 @@ -587,16 +593,37 @@ typedef struct { #define SET_EVENT_FLT_CP_SIZE 2 /* Filter types */ -#define FLT_CLEAR_ALL 0x00 -#define FLT_INQ_RESULT 0x01 -#define FLT_CONN_SETUP 0x02 +#define FLT_CLEAR_ALL 0x00 +#define FLT_INQ_RESULT 0x01 +#define FLT_CONN_SETUP 0x02 +/* INQ_RESULT Condition types */ +#define INQ_RESULT_RETURN_ALL 0x00 +#define INQ_RESULT_RETURN_CLASS 0x01 +#define INQ_RESULT_RETURN_BDADDR 0x02 /* CONN_SETUP Condition types */ -#define CONN_SETUP_ALLOW_ALL 0x00 -#define CONN_SETUP_ALLOW_CLASS 0x01 -#define CONN_SETUP_ALLOW_BDADDR 0x02 +#define CONN_SETUP_ALLOW_ALL 0x00 +#define CONN_SETUP_ALLOW_CLASS 0x01 +#define CONN_SETUP_ALLOW_BDADDR 0x02 /* CONN_SETUP Conditions */ -#define CONN_SETUP_AUTO_OFF 0x01 -#define CONN_SETUP_AUTO_ON 0x02 +#define CONN_SETUP_AUTO_OFF 0x01 +#define CONN_SETUP_AUTO_ON 0x02 + +#define OCF_FLUSH 0x0008 + +#define OCF_READ_PIN_TYPE 0x0009 +typedef struct { + uint8_t status; + uint8_t pin_type; +} __attribute__ ((packed)) read_pin_type_rp; +#define READ_PIN_TYPE_RP_SIZE 2 + +#define OCF_WRITE_PIN_TYPE 0x000A +typedef struct { + uint8_t pin_type; +} __attribute__ ((packed)) write_pin_type_cp; +#define WRITE_PIN_TYPE_CP_SIZE 1 + +#define OCF_CREATE_NEW_UNIT_KEY 0x000B #define OCF_READ_STORED_LINK_KEY 0x000D typedef struct { -- cgit From 0a2a889c91f9b671b7c31bcb6e4e53daf306fb7e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 8 May 2005 17:18:18 +0000 Subject: Add SDP_WAIT_ON_CLOSE flag for sdp_connect() --- include/sdp.h | 1 + src/sdp.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 7f8ff538..640cac27 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -376,6 +376,7 @@ extern "C" { * Values of the flags parameter to sdp_connect */ #define SDP_RETRY_IF_BUSY 0x01 +#define SDP_WAIT_ON_CLOSE 0x02 /* * SDP Error codes diff --git a/src/sdp.c b/src/sdp.c index 1e474db4..93a518cb 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3167,13 +3167,17 @@ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t fl sa.l2_psm = 0; if (bacmp(src, BDADDR_ANY) != 0) { sa.l2_bdaddr = *src; - if (0 > bind(session->sock, (struct sockaddr *)&sa, sizeof(sa))) + if (bind(session->sock, (struct sockaddr *) &sa, sizeof(sa)) < 0) goto fail; } + if (flags & SDP_WAIT_ON_CLOSE) { + struct linger l = { .l_onoff = 1, .l_linger = 1 }; + setsockopt(session->sock, SOL_SOCKET, SO_LINGER, &l, sizeof(l)); + } sa.l2_psm = htobs(SDP_PSM); sa.l2_bdaddr = *dst; do - if (connect(session->sock, (struct sockaddr *)&sa, sizeof(sa)) == 0) + if (connect(session->sock, (struct sockaddr *) &sa, sizeof(sa)) == 0) return session; while (errno == EBUSY && (flags & SDP_RETRY_IF_BUSY)); } -- cgit From 4e2579e42570a214353809903f6c8bc59db7d5ef Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 9 May 2005 12:23:53 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 2be03d47..c52358f3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:16:0 +libbluetooth_la_LDFLAGS = -version-info 1:17:0 INCLUDES = -I$(top_builddir)/include -- cgit From 67c565bcf20f7293b70aaa15a9a0651ff61ff52b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 9 May 2005 12:27:49 +0000 Subject: Update changelog and bump version number --- ChangeLog | 7 +++++++ configure.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6559577e..1fa39ba5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +ver 2.17: + Include stdio.h in bluetooth.h header file. + Include sys/socket.h in the header files. + Add functions for stored link keys. + Add definitions for PIN type and unit key. + Add SDP_WAIT_ON_CLOSE flag for sdp_connect(). + ver 2.16: Fix buffer allocation for features to string conversion. Add function for reading local supported commands. diff --git a/configure.in b/configure.in index 2b58fbad..b09239bc 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.16) +AM_INIT_AUTOMAKE(bluez-libs, 2.17) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From e8c8131bc6c67b3592a5b5ec1882f2d8abf00608 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 19 May 2005 12:20:54 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 0f4c49e6..c54d63e3 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -364,6 +364,8 @@ char *bt_compidtostr(int compid) return "Research In Motion"; case 61: return "IPextreme, Inc."; + case 62: + return "Systems and Chips, Inc"; case 65535: return "internal use"; default: -- cgit From f38a7523b3e2ec2109cd5c5f65803da5a354da03 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 16 Jun 2005 13:53:08 +0000 Subject: Add support for reading and writing the inquiry scan type --- include/hci.h | 17 +++++++++++++++++ include/hci_lib.h | 2 ++ src/hci.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/include/hci.h b/include/hci.h index 86ffe8c9..b6275196 100644 --- a/include/hci.h +++ b/include/hci.h @@ -833,6 +833,23 @@ typedef struct { } __attribute__ ((packed)) set_afh_classification_rp; #define SET_AFH_CLASSIFICATION_RP_SIZE 1 +#define OCF_READ_INQUIRY_SCAN_TYPE 0x0042 +typedef struct { + uint8_t status; + uint8_t type; +} __attribute__ ((packed)) read_inquiry_scan_type_rp; +#define READ_INQUIRY_SCAN_TYPE_RP_SIZE 2 + +#define OCF_WRITE_INQUIRY_SCAN_TYPE 0x0043 +typedef struct { + uint8_t type; +} __attribute__ ((packed)) write_inquiry_scan_type_cp; +#define WRITE_INQUIRY_SCAN_TYPE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_inquiry_scan_type_rp; +#define WRITE_INQUIRY_SCAN_TYPE_RP_SIZE 1 + #define OCF_READ_INQUIRY_MODE 0x0044 typedef struct { uint8_t status; diff --git a/include/hci_lib.h b/include/hci_lib.h index 7761bb99..eac144e7 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -95,6 +95,8 @@ int hci_change_link_key(int dd, uint16_t handle, int to); int hci_switch_role(int dd, bdaddr_t *bdaddr, uint8_t role, int to); int hci_park_mode(int dd, uint16_t handle, uint16_t max_interval, uint16_t min_interval, int to); int hci_exit_park_mode(int dd, uint16_t handle, int to); +int hci_read_inquiry_scan_type(int dd, uint8_t *type, int to); +int hci_write_inquiry_scan_type(int dd, uint8_t type, int to); int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); diff --git a/src/hci.c b/src/hci.c index 60898e9b..b52b53fa 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1564,6 +1564,57 @@ int hci_exit_park_mode(int dd, uint16_t handle, int to) return 0; } +int hci_read_inquiry_scan_type(int dd, uint8_t *type, int to) +{ + read_inquiry_scan_type_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_INQUIRY_SCAN_TYPE; + rq.rparam = &rp; + rq.rlen = READ_INQUIRY_SCAN_TYPE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *type = rp.type; + return 0; +} + +int hci_write_inquiry_scan_type(int dd, uint8_t type, int to) +{ + write_inquiry_scan_type_cp cp; + write_inquiry_scan_type_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.type = type; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_INQUIRY_SCAN_TYPE; + rq.cparam = &cp; + rq.clen = WRITE_INQUIRY_SCAN_TYPE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_INQUIRY_SCAN_TYPE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} + int hci_read_inquiry_mode(int dd, uint8_t *mode, int to) { read_inquiry_mode_rp rp; -- cgit From ef13270022a9ac069ef907f36feee499c682356b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 17 Jun 2005 11:48:17 +0000 Subject: Add definitions for connection accept timeout and scan enable --- include/hci.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/include/hci.h b/include/hci.h index b6275196..29518dbb 100644 --- a/include/hci.h +++ b/include/hci.h @@ -675,8 +675,18 @@ typedef struct { } __attribute__ ((packed)) read_local_name_rp; #define READ_LOCAL_NAME_RP_SIZE 249 -#define OCF_WRITE_CA_TIMEOUT 0x0016 -#define OCF_WRITE_PG_TIMEOUT 0x0018 +#define OCF_READ_CONN_ACCEPT_TIMEOUT 0x0015 +typedef struct { + uint8_t status; + uint16_t timeout; +} __attribute__ ((packed)) read_conn_accept_timeout_rp; +#define READ_CONN_ACCEPT_TIMEOUT_RP_SIZE 3 + +#define OCF_WRITE_CONN_ACCEPT_TIMEOUT 0x0016 +typedef struct { + uint16_t timeout; +} __attribute__ ((packed)) write_conn_accept_timeout_cp; +#define WRITE_CONN_ACCEPT_TIMEOUT_CP_SIZE 2 #define OCF_READ_PAGE_TIMEOUT 0x0017 typedef struct { @@ -691,6 +701,13 @@ typedef struct { } __attribute__ ((packed)) write_page_timeout_cp; #define WRITE_PAGE_TIMEOUT_CP_SIZE 2 +#define OCF_READ_SCAN_ENABLE 0x0019 +typedef struct { + uint8_t status; + uint8_t enable; +} __attribute__ ((packed)) read_scan_enable_rp; +#define READ_SCAN_ENABLE_RP_SIZE 2 + #define OCF_WRITE_SCAN_ENABLE 0x001A #define SCAN_DISABLED 0x00 #define SCAN_INQUIRY 0x01 -- cgit From 631f20f4f87398b68b658acc3c374c6b36c1b7eb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 21 Jun 2005 16:40:29 +0000 Subject: Fix some errno usages --- include/hci_lib.h | 2 +- src/hci.c | 109 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 62 insertions(+), 49 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index eac144e7..4bfc5197 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -113,7 +113,7 @@ int hci_read_clock(int dd, uint16_t handle, uint8_t which, uint32_t *clock, uint int hci_local_name(int dd, int len, char *name, int to); int hci_remote_name(int dd, const bdaddr_t *bdaddr, int len, char *name, int to); -int hci_for_each_dev(int flag, int(*func)(int s, int dev_id, long arg), long arg); +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); char *hci_dtypetostr(int type); diff --git a/src/hci.c b/src/hci.c index b52b53fa..db6e6da1 100644 --- a/src/hci.c +++ b/src/hci.c @@ -33,18 +33,14 @@ #endif #include -#include -#include -#include -#include -#include -#include #include -#include #include +#include +#include +#include +#include #include -#include #include #include #include @@ -458,28 +454,26 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) /* HCI functions that do not require open device */ -int hci_for_each_dev(int flag, int (*func)(int s, int dev_id, long arg), long arg) +int hci_for_each_dev(int flag, int (*func)(int dd, int dev_id, long arg), long arg) { struct hci_dev_list_req *dl; struct hci_dev_req *dr; int dev_id = -1; - int i, sk; + int i, sk, err; sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (sk < 0) return -1; dl = malloc(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl)); - if (!dl) { - close(sk); - return -1; - } + if (!dl) + goto done; dl->dev_num = HCI_MAX_DEV; dr = dl->dev_req; if (ioctl(sk, HCIGETDEVLIST, (void *) dl)) - goto done; + goto free; for (i = 0; i < dl->dev_num; i++, dr++) { if (hci_test_bit(flag, &dr->dev_opt)) @@ -489,17 +483,25 @@ int hci_for_each_dev(int flag, int (*func)(int s, int dev_id, long arg), long ar } } + if (dev_id < 0) + errno = ENODEV; + +free: + free(dl); + done: + err = errno; close(sk); - free(dl); + errno = err; + return dev_id; } -static int __other_bdaddr(int sk, int dev_id, long arg) +static int __other_bdaddr(int dd, int dev_id, long arg) { struct hci_dev_info di = { dev_id: dev_id }; - if (ioctl(sk, HCIGETDEVINFO, (void *) &di)) + if (ioctl(dd, HCIGETDEVINFO, (void *) &di)) return 0; if (hci_test_bit(HCI_RAW, &di.flags)) @@ -508,11 +510,11 @@ static int __other_bdaddr(int sk, int dev_id, long arg) return bacmp((bdaddr_t *) arg, &di.bdaddr); } -static int __same_bdaddr(int sk, int dev_id, long arg) +static int __same_bdaddr(int dd, int dev_id, long arg) { struct hci_dev_info di = { dev_id: dev_id }; - if (ioctl(sk, HCIGETDEVINFO, (void *) &di)) + if (ioctl(dd, HCIGETDEVINFO, (void *) &di)) return 0; return !bacmp((bdaddr_t *) arg, &di.bdaddr); @@ -540,22 +542,26 @@ int hci_devid(const char *str) str2ba(str, &ba); id = hci_for_each_dev(HCI_UP, __same_bdaddr, (long) &ba); } + return id; } int hci_devinfo(int dev_id, struct hci_dev_info *di) { - int s, err; + int dd, err, ret; - s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); - if (s < 0) - return s; + dd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (dd < 0) + return dd; di->dev_id = dev_id; - err = ioctl(s, HCIGETDEVINFO, (void *) di); - close(s); + ret = ioctl(dd, HCIGETDEVINFO, (void *) di); + + err = errno; + close(dd); + errno = err; - return err; + return ret; } int hci_devba(int dev_id, bdaddr_t *bdaddr) @@ -571,6 +577,7 @@ int hci_devba(int dev_id, bdaddr_t *bdaddr) } bacpy(bdaddr, &di.bdaddr); + return 0; } @@ -579,7 +586,7 @@ int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info struct hci_inquiry_req *ir; uint8_t num_rsp = nrsp; void *buf; - int s, err; + int dd, size, err, ret = -1; if (nrsp <= 0) { num_rsp = 0; @@ -591,15 +598,13 @@ int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info return -1; } - s = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); - if (s < 0) - return -1; + dd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); + if (dd < 0) + return dd; buf = malloc(sizeof(*ir) + (sizeof(inquiry_info) * (nrsp))); - if (!buf) { - close(s); - return -1; - } + if (!buf) + goto done; ir = buf; ir->dev_id = dev_id; @@ -615,23 +620,30 @@ int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info ir->lap[2] = 0x9e; } - err = ioctl(s, HCIINQUIRY, (unsigned long) buf); - close(s); + ret = ioctl(dd, HCIINQUIRY, (unsigned long) buf); + if (ret < 0) + goto free; - if (!err) { - int size = sizeof(inquiry_info) * ir->num_rsp; + size = sizeof(inquiry_info) * ir->num_rsp; - if (!*ii) - *ii = (void *) malloc(size); + if (!*ii) + *ii = malloc(size); - if (*ii) { - memcpy((void *) *ii, buf + sizeof(*ir), size); - err = ir->num_rsp; - } else - err = -1; - } + if (*ii) { + memcpy((void *) *ii, buf + sizeof(*ir), size); + ret = ir->num_rsp; + } else + ret = -1; + +free: free(buf); - return err; + +done: + err = errno; + close(dd); + errno = err; + + return ret; } /* Open HCI device. @@ -658,6 +670,7 @@ failed: err = errno; close(dd); errno = err; + return -1; } -- cgit From ba65f7a41c24a3161cceec9a55ed363dc835365d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 21 Jun 2005 16:43:47 +0000 Subject: Remove hci_vhci.h header file --- include/Makefile.am | 4 ++-- include/hci_vhci.h | 44 -------------------------------------------- 2 files changed, 2 insertions(+), 46 deletions(-) delete mode 100644 include/hci_vhci.h diff --git a/include/Makefile.am b/include/Makefile.am index 5710846d..c8a4973e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,8 +5,8 @@ includedir = @includedir@/bluetooth include_HEADERS = \ - bluetooth.h hci.h hci_lib.h hci_uart.h hci_vhci.h \ - l2cap.h sco.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h + bluetooth.h hci.h hci_lib.h hci_uart.h sco.h \ + l2cap.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h MAINTAINERCLEANFILES = Makefile.in diff --git a/include/hci_vhci.h b/include/hci_vhci.h deleted file mode 100644 index 88f86562..00000000 --- a/include/hci_vhci.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. - * - * - * $Id$ - */ - -#ifndef __HCI_VHCI_H -#define __HCI_VHCI_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define VHCI_DEV "/dev/vhci" -#define VHCI_MINOR 250 - -#ifdef __cplusplus -} -#endif - -#endif /* __HCI_VHCI_H */ -- cgit From 654718757db545ba3e0317d1588595cd486c3436 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 21 Jun 2005 16:47:29 +0000 Subject: Remove hci_uart.h header file --- include/Makefile.am | 4 ++-- include/hci_uart.h | 55 ----------------------------------------------------- 2 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 include/hci_uart.h diff --git a/include/Makefile.am b/include/Makefile.am index c8a4973e..ab67cf59 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,8 +5,8 @@ includedir = @includedir@/bluetooth include_HEADERS = \ - bluetooth.h hci.h hci_lib.h hci_uart.h sco.h \ - l2cap.h rfcomm.h sdp.h sdp_lib.h bnep.h cmtp.h hidp.h + bluetooth.h hci.h hci_lib.h sco.h l2cap.h \ + sdp.h sdp_lib.h rfcomm.h bnep.h cmtp.h hidp.h MAINTAINERCLEANFILES = Makefile.in diff --git a/include/hci_uart.h b/include/hci_uart.h deleted file mode 100644 index c7575586..00000000 --- a/include/hci_uart.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; - * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. - * - * - * $Id$ - */ - -#ifndef __HCI_UART_H -#define __HCI_UART_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef N_HCI -#define N_HCI 15 -#endif - -/* Ioctls */ -#define HCIUARTSETPROTO _IOW('U', 200, int) -#define HCIUARTGETPROTO _IOR('U', 201, int) - -/* UART protocols */ -#define HCI_UART_H4 0 -#define HCI_UART_BCSP 1 -#define HCI_UART_3WIRE 2 -#define HCI_UART_H4DS 3 - -#ifdef __cplusplus -} -#endif - -#endif /* __HCI_UART_H */ -- cgit From b9b9f3700eefd8a32af2b68fb08c008b1fad650f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 3 Jul 2005 14:50:03 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index c52358f3..ee4510ca 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:17:0 +libbluetooth_la_LDFLAGS = -version-info 1:18:0 INCLUDES = -I$(top_builddir)/include -- cgit From 60197f2a9074b5ca0ba9a5711b695f65089f99ec Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 3 Jul 2005 14:52:15 +0000 Subject: Update changelog and bump version number --- ChangeLog | 6 ++++++ configure.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1fa39ba5..bb068d03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 2.18: + Add support for reading and writing the inquiry scan type. + Add definitions for connection accept timeout and scan enable. + Remove hci_vhci.h header file. + Remove hci_uart.h header file. + ver 2.17: Include stdio.h in bluetooth.h header file. Include sys/socket.h in the header files. diff --git a/configure.in b/configure.in index b09239bc..5b224079 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.17) +AM_INIT_AUTOMAKE(bluez-libs, 2.18) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From e27896801ac0514289f57def3a8b5c1491d316c6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Jul 2005 19:54:42 +0000 Subject: Fix some GCC 4.0 warnings --- src/hci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hci.c b/src/hci.c index db6e6da1..59f2afa7 100644 --- a/src/hci.c +++ b/src/hci.c @@ -717,8 +717,9 @@ int hci_send_req(int dd, struct hci_request *r, int to) unsigned char buf[HCI_MAX_EVENT_SIZE], *ptr; uint16_t opcode = htobs(cmd_opcode_pack(r->ogf, r->ocf)); struct hci_filter nf, of; + socklen_t len; hci_event_hdr *hdr; - int err, len, try; + int err, try; len = sizeof(of); if (getsockopt(dd, SOL_HCI, HCI_FILTER, &of, &len) < 0) @@ -903,7 +904,7 @@ int hci_read_local_name(int dd, int len, char *name, int to) } rp.name[247] = '\0'; - strncpy(name, rp.name, len); + strncpy(name, (char *) rp.name, len); return 0; } @@ -913,7 +914,7 @@ int hci_write_local_name(int dd, const char *name, int to) struct hci_request rq; memset(&cp, 0, sizeof(cp)); - strncpy(cp.name, name, sizeof(cp.name)); + strncpy((char *) cp.name, name, sizeof(cp.name)); memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; @@ -956,7 +957,7 @@ int hci_read_remote_name_with_clock_offset(int dd, const bdaddr_t *bdaddr, uint8 } rn.name[247] = '\0'; - strncpy(name, rn.name, len); + strncpy(name, (char *) rn.name, len); return 0; } -- cgit From cfa3a02e2593bd72ce4a83f521e1e89a5874ea7d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 Jul 2005 00:12:25 +0000 Subject: Fix more GCC 4.0 warnings --- include/sdp.h | 8 ++-- include/sdp_lib.h | 16 +++---- src/sdp.c | 123 ++++++++++++++++++++++++++---------------------------- 3 files changed, 72 insertions(+), 75 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 640cac27..f08a7ddb 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -401,7 +401,7 @@ typedef struct { * Should the type of any of these change, you need only make a change here. */ typedef struct { - char data[16]; + uint8_t data[16]; } uint128_t; typedef struct { @@ -454,9 +454,9 @@ typedef struct { } sdp_version_t; typedef struct { - char *data; - int data_size; - int buf_size; + uint8_t *data; + uint32_t data_size; + uint32_t buf_size; } sdp_buf_t; typedef struct { diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 7661d24e..b4e83fe3 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -424,7 +424,7 @@ uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid); void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16); int sdp_uuid128_to_uuid(uuid_t *uuid); int sdp_uuid_to_proto(uuid_t *uuid); -int sdp_uuid_extract(const char *buffer, uuid_t *uuid, int *scanned); +int sdp_uuid_extract(const uint8_t *buffer, uuid_t *uuid, int *scanned); void sdp_uuid_print(const uuid_t *uuid); #define MAX_LEN_UUID_STR 37 @@ -538,30 +538,30 @@ static inline uint16_t sdp_gen_tid(sdp_session_t *session) return session->tid++; } -sdp_record_t *sdp_extract_pdu(const char *pdata, int *scanned); -sdp_data_t *sdp_extract_string(char *, int *); +sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); +sdp_data_t *sdp_extract_string(uint8_t *, int *); void sdp_data_print(sdp_data_t *data); void sdp_print_service_attr(sdp_list_t *alist); int sdp_attrid_comp_func(const void *key1, const void *key2); -void sdp_set_seq_len(char *ptr, int length); +void sdp_set_seq_len(uint8_t *ptr, uint32_t length); void sdp_set_attrid(sdp_buf_t *pdu, uint16_t id); void sdp_append_to_pdu(sdp_buf_t *dst, sdp_data_t *d); -void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len); +void sdp_append_to_buf(sdp_buf_t *dst, uint8_t *data, uint32_t len); int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); -int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *seqlen); +int sdp_extract_seqtype(const uint8_t *buf, uint8_t *dtdp, int *seqlen); -sdp_data_t *sdp_extract_attr(const char *pdata, int *extractedLength, sdp_record_t *rec); +sdp_data_t *sdp_extract_attr(const uint8_t *pdata, int *extractedLength, sdp_record_t *rec); void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); -int sdp_send_req_w4_rsp(sdp_session_t *session, char *req, char *rsp, int reqsize, int *rspsize); +int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *req, uint8_t *rsp, uint32_t reqsize, uint32_t *rspsize); typedef struct { uint8_t length; diff --git a/src/sdp.c b/src/sdp.c index 93a518cb..84d0a016 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -534,7 +534,7 @@ void sdp_attr_remove(sdp_record_t *rec, uint16_t attr) rec->attrlist = sdp_list_remove(rec->attrlist, d); } -void sdp_set_seq_len(char *ptr, int length) +void sdp_set_seq_len(uint8_t *ptr, uint32_t length) { uint8_t dtd = *(uint8_t *) ptr++; @@ -614,14 +614,14 @@ static int get_data_size(sdp_buf_t *buf, sdp_data_t *sdpdata) int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) { - int pdu_size = 0, data_size = 0; + uint32_t pdu_size = 0, data_size = 0; unsigned char *src = NULL, is_seq = 0, is_alt = 0; uint8_t dtd = d->dtd; uint16_t u16; uint32_t u32; uint64_t u64; uint128_t u128; - char *seqp = buf->data + buf->data_size; + uint8_t *seqp = buf->data + buf->data_size; pdu_size = sdp_set_data_type(buf, dtd); switch (dtd) { @@ -735,7 +735,7 @@ static void sdp_attr_pdu(void *value, void *udata) int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *buf) { - buf->data = (char *)malloc(SDP_PDU_CHUNK_SIZE); + buf->data = malloc(SDP_PDU_CHUNK_SIZE); if (buf->data) { buf->buf_size = SDP_PDU_CHUNK_SIZE; buf->data_size = 0; @@ -845,7 +845,7 @@ static sdp_data_t *extract_int(const void *p, int *len) return d; } -static sdp_data_t *extract_uuid(const void *p, int *len, sdp_record_t *rec) +static sdp_data_t *extract_uuid(const uint8_t *p, int *len, sdp_record_t *rec) { sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); @@ -942,7 +942,7 @@ static sdp_data_t *extract_seq(const void *p, int *len, sdp_record_t *rec) return d; } -sdp_data_t *sdp_extract_attr(const char *p, int *size, sdp_record_t *rec) +sdp_data_t *sdp_extract_attr(const uint8_t *p, int *size, sdp_record_t *rec) { sdp_data_t *elem; int n = 0; @@ -1016,13 +1016,13 @@ void sdp_print_service_attr(sdp_list_t *svcAttrList) } #endif -sdp_record_t *sdp_extract_pdu(const char *buf, int *scanned) +sdp_record_t *sdp_extract_pdu(const uint8_t *buf, int *scanned) { int extracted = 0, seqlen = 0; uint8_t dtd; uint16_t attr; sdp_record_t *rec = sdp_record_alloc(); - const char *p = buf; + const uint8_t *p = buf; *scanned = sdp_extract_seqtype(buf, &dtd, &seqlen); p += *scanned; @@ -1155,7 +1155,7 @@ sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attrId) * Extract the sequence type and its length, and return offset into buf * or 0 on failure. */ -int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *size) +int sdp_extract_seqtype(const uint8_t *buf, uint8_t *dtdp, int *size) { uint8_t dtd = *(uint8_t *) buf; int scanned = sizeof(uint8_t); @@ -1185,9 +1185,9 @@ int sdp_extract_seqtype(const char *buf, uint8_t *dtdp, int *size) return scanned; } -int sdp_send_req(sdp_session_t *session, char *buf, int size) +int sdp_send_req(sdp_session_t *session, uint8_t *buf, uint32_t size) { - int sent = 0; + uint32_t sent = 0; while (sent < size) { int n = send(session->sock, buf + sent, size - sent, 0); @@ -1198,7 +1198,7 @@ int sdp_send_req(sdp_session_t *session, char *buf, int size) return 0; } -int sdp_read_rsp(sdp_session_t *session, char *buf, int size) +int sdp_read_rsp(sdp_session_t *session, uint8_t *buf, uint32_t size) { fd_set readFds; struct timeval timeout = { SDP_RESPONSE_TIMEOUT, 0 }; @@ -1216,7 +1216,7 @@ int sdp_read_rsp(sdp_session_t *session, char *buf, int size) /* * generic send request, wait for response method. */ -int sdp_send_req_w4_rsp(sdp_session_t *session, char *reqbuf, char *rspbuf, int reqsize, int *rspsize) +int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *reqbuf, uint8_t *rspbuf, uint32_t reqsize, uint32_t *rspsize) { int n; sdp_pdu_hdr_t *reqhdr = (sdp_pdu_hdr_t *)reqbuf; @@ -1952,7 +1952,7 @@ uint128_t *sdp_create_base_uuid(void) char *dataPtr; char temp[10]; int toBeCopied; - char *data; + uint8_t *data; if (bluetooth_base_uuid == NULL) { strcpy(baseStr, BASE_UUID); @@ -2182,7 +2182,7 @@ int sdp_uuid_to_proto(uuid_t *uuid) return 0; } -int sdp_uuid_extract(const char *p, uuid_t *uuid, int *scanned) +int sdp_uuid_extract(const uint8_t *p, uuid_t *uuid, int *scanned) { uint8_t type = *(const uint8_t *) p; @@ -2214,9 +2214,9 @@ int sdp_uuid_extract(const char *p, uuid_t *uuid, int *scanned) * Should the PDU length exceed 2^8, then sequence type is * set accordingly and the data is memmove()'d. */ -void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len) +void sdp_append_to_buf(sdp_buf_t *dst, uint8_t *data, uint32_t len) { - char *p = dst->data; + uint8_t *p = dst->data; uint8_t dtd = *(uint8_t *) p; SDPDBG("Append src size: %d\n", len); @@ -2224,7 +2224,7 @@ void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len) SDPDBG("Dst buffer size: %d\n", dst->buf_size); if (dst->data_size + len > dst->buf_size) { int need = SDP_PDU_CHUNK_SIZE * ((len / SDP_PDU_CHUNK_SIZE) + 1); - dst->data = (char *)realloc(dst->data, dst->buf_size + need); + dst->data = realloc(dst->data, dst->buf_size + need); SDPDBG("Realloc'ing : %d\n", need); @@ -2273,7 +2273,7 @@ void sdp_append_to_buf(sdp_buf_t *dst, char *data, int len) void sdp_append_to_pdu(sdp_buf_t *pdu, sdp_data_t *d) { - char buf[SDP_SEQ_PDUFORM_SIZE]; + uint8_t buf[SDP_SEQ_PDUFORM_SIZE]; sdp_buf_t append; append.data = buf; @@ -2294,10 +2294,9 @@ void sdp_append_to_pdu(sdp_buf_t *pdu, sdp_data_t *d) */ int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags) { - char *p; int status = 0; - char *req, *rsp; - int reqsize, rspsize; + uint8_t *req, *rsp, *p; + uint32_t reqsize, rspsize; sdp_pdu_hdr_t *reqhdr, *rsphdr; sdp_buf_t pdu; @@ -2307,8 +2306,8 @@ int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags errno = EREMOTE; return -1; } - req = (char *) malloc(SDP_REQ_BUFFER_SIZE); - rsp = (char *) malloc(SDP_RSP_BUFFER_SIZE); + req = malloc(SDP_REQ_BUFFER_SIZE); + rsp = malloc(SDP_RSP_BUFFER_SIZE); if (req == NULL || rsp == NULL) { status = -1; errno = ENOMEM; @@ -2354,10 +2353,9 @@ end: */ int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) { - char *p; int status = 0; - char *reqbuf, *rspbuf; - int reqsize = 0, rspsize = 0; + uint8_t *reqbuf, *rspbuf, *p; + uint32_t reqsize = 0, rspsize = 0; sdp_pdu_hdr_t *reqhdr, *rsphdr; uint32_t handle = 0; @@ -2372,8 +2370,8 @@ int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) errno = EREMOTE; return -1; } - reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; @@ -2412,10 +2410,9 @@ end: */ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) { - char *p; int status = 0; - char *reqbuf, *rspbuf; - int reqsize, rspsize; + uint8_t *reqbuf, *rspbuf, *p; + uint32_t reqsize, rspsize; sdp_pdu_hdr_t *reqhdr, *rsphdr; uint32_t handle; sdp_buf_t pdu; @@ -2431,8 +2428,8 @@ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) errno = EREMOTE; return -1; } - reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; @@ -2442,7 +2439,7 @@ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) reqhdr->pdu_id = SDP_SVC_UPDATE_REQ; reqhdr->tid = htons(sdp_gen_tid(session)); - p = (char *) (reqbuf + sizeof(sdp_pdu_hdr_t)); + p = reqbuf + sizeof(sdp_pdu_hdr_t); reqsize = sizeof(sdp_pdu_hdr_t); bt_put_unaligned(htonl(handle), (uint32_t *) p); @@ -2523,10 +2520,10 @@ void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq) * handles are not in "data element sequence" form, but just like * an array of service handles */ -static void extract_record_handle_seq(char *pdu, sdp_list_t **seq, int count, int *scanned) +static void extract_record_handle_seq(uint8_t *pdu, sdp_list_t **seq, int count, int *scanned) { sdp_list_t *pSeq = *seq; - char *pdata = pdu; + uint8_t *pdata = pdu; int n; for (n = 0; n < count; n++) { @@ -2542,7 +2539,7 @@ static void extract_record_handle_seq(char *pdu, sdp_list_t **seq, int count, in * Generate the attribute sequence pdu form * from sdp_list_t elements. Return length of attr seq */ -static int gen_dataseq_pdu(char *dst, const sdp_list_t *seq, uint8_t dtd) +static int gen_dataseq_pdu(uint8_t *dst, const sdp_list_t *seq, uint8_t dtd) { sdp_data_t *dataseq; void **types, **values; @@ -2553,7 +2550,7 @@ static int gen_dataseq_pdu(char *dst, const sdp_list_t *seq, uint8_t dtd) SDPDBG(""); memset(&buf, 0, sizeof(sdp_buf_t)); - buf.data = (char *)malloc(SDP_UUID_SEQ_SIZE); + buf.data = malloc(SDP_UUID_SEQ_SIZE); buf.buf_size = SDP_UUID_SEQ_SIZE; SDPDBG("Seq length : %d\n", seqlen); @@ -2583,18 +2580,18 @@ static int gen_dataseq_pdu(char *dst, const sdp_list_t *seq, uint8_t dtd) return seqlen; } -static int gen_searchseq_pdu(char *dst, const sdp_list_t *seq) +static int gen_searchseq_pdu(uint8_t *dst, const sdp_list_t *seq) { - uuid_t *uuid = (uuid_t *)seq->data; + uuid_t *uuid = (uuid_t *) seq->data; return gen_dataseq_pdu(dst, seq, uuid->type); } -static int gen_attridseq_pdu(char *dst, const sdp_list_t *seq, uint8_t dataType) +static int gen_attridseq_pdu(uint8_t *dst, const sdp_list_t *seq, uint8_t dataType) { return gen_dataseq_pdu(dst, seq, dataType); } -static int copy_cstate(char *pdata, const sdp_cstate_t *cstate) +static int copy_cstate(uint8_t *pdata, const sdp_cstate_t *cstate) { if (cstate) { *pdata++ = cstate->length; @@ -2638,12 +2635,12 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num, sdp_list_t **rsp) { int status = 0; - int reqsize = 0, _reqsize; - int rspsize = 0, rsplen; + uint32_t reqsize = 0, _reqsize; + uint32_t rspsize = 0, rsplen; int seqlen = 0; int scanned, total_rec_count, rec_count; - char *pdata, *_pdata; - char *reqbuf, *rspbuf; + uint8_t *pdata, *_pdata; + uint8_t *reqbuf, *rspbuf; sdp_pdu_hdr_t *reqhdr, *rsphdr; sdp_cstate_t *cstate = NULL; @@ -2782,12 +2779,12 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrids) { int status = 0; - int reqsize = 0, _reqsize; - int rspsize = 0, rsp_count; + uint32_t reqsize = 0, _reqsize; + uint32_t rspsize = 0, rsp_count; int attr_list_len = 0; int seqlen = 0; - char *pdata, *_pdata; - char *reqbuf, *rspbuf; + uint8_t *pdata, *_pdata; + uint8_t *reqbuf, *rspbuf; sdp_pdu_hdr_t *reqhdr, *rsphdr; sdp_cstate_t *cstate = NULL; uint8_t cstate_len = 0; @@ -2799,8 +2796,8 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, return 0; } - reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; @@ -2874,12 +2871,12 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, * and the last one (which has cstate_len == 0) */ if (cstate_len > 0 || rsp_concat_buf.data_size != 0) { - char *targetPtr = NULL; + uint8_t *targetPtr = NULL; cstate = cstate_len > 0 ? (sdp_cstate_t *) (pdata + rsp_count) : 0; // build concatenated response buffer - rsp_concat_buf.data = (char *) realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); + rsp_concat_buf.data = realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); rsp_concat_buf.buf_size = rsp_concat_buf.data_size + rsp_count; targetPtr = rsp_concat_buf.data + rsp_concat_buf.data_size; memcpy(targetPtr, pdata, rsp_count); @@ -2951,12 +2948,12 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrids, sdp_list_t **rsp) { int status = 0; - int reqsize = 0, _reqsize; - int rspsize = 0; + uint32_t reqsize = 0, _reqsize; + uint32_t rspsize = 0; int seqlen = 0, attr_list_len = 0; int rsp_count = 0, cstate_len = 0; - char *pdata, *_pdata; - char *reqbuf, *rspbuf; + uint8_t *pdata, *_pdata; + uint8_t *reqbuf, *rspbuf; sdp_pdu_hdr_t *reqhdr, *rsphdr; uint8_t dataType; sdp_list_t *rec_list = NULL; @@ -2967,8 +2964,8 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search errno = EINVAL; return -1; } - reqbuf = (char *) malloc(SDP_REQ_BUFFER_SIZE); - rspbuf = (char *) malloc(SDP_RSP_BUFFER_SIZE); + reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + rspbuf = malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { errno = ENOMEM; status = -1; @@ -3048,12 +3045,12 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search * responses and the last one which will have cstate_len == 0 */ if (cstate_len > 0 || rsp_concat_buf.data_size != 0) { - char *targetPtr = NULL; + uint8_t *targetPtr = NULL; cstate = cstate_len > 0 ? (sdp_cstate_t *) (pdata + rsp_count) : 0; // build concatenated response buffer - rsp_concat_buf.data = (char *)realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); + rsp_concat_buf.data = realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count); targetPtr = rsp_concat_buf.data + rsp_concat_buf.data_size; rsp_concat_buf.buf_size = rsp_concat_buf.data_size + rsp_count; memcpy(targetPtr, pdata, rsp_count); -- cgit From b809fb039119546a8b5b4fbb4bcbfbad6666cf24 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 9 Jul 2005 17:09:10 +0000 Subject: Fix the routing for dealing with raw devices --- src/hci.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/hci.c b/src/hci.c index 59f2afa7..0aca162f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -522,10 +522,8 @@ static int __same_bdaddr(int dd, int dev_id, long arg) int hci_get_route(bdaddr_t *bdaddr) { - if (bdaddr) - return hci_for_each_dev(HCI_UP, __other_bdaddr, (long) bdaddr); - else - return hci_for_each_dev(HCI_UP, NULL, 0); + return hci_for_each_dev(HCI_UP, __other_bdaddr, + (long) (bdaddr ? bdaddr : BDADDR_ANY)); } int hci_devid(const char *str) @@ -593,9 +591,12 @@ int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap, inquiry_info nrsp = 255; } - if (dev_id < 0 && (dev_id = hci_get_route(NULL)) < 0) { - errno = ENODEV; - return -1; + if (dev_id < 0) { + dev_id = hci_get_route(NULL); + if (dev_id < 0) { + errno = ENODEV; + return -1; + } } dd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); -- cgit From a1454c0f12421da1849ca347f8a30d084778d679 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 3 Aug 2005 07:18:31 +0000 Subject: Create per device SDP server functions --- include/sdp_lib.h | 3 +++ src/sdp.c | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index b4e83fe3..b9fbf6f3 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -397,11 +397,13 @@ void sdp_record_free(sdp_record_t *rec); * on success or -1 on failure (and sets errno). */ int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); +int sdp_device_record_register(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec, uint8_t flags); /* * Unregister a service record. */ int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); +int sdp_device_record_unregister(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec); /* * Update an existing service record. (Calling this function @@ -409,6 +411,7 @@ int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); * in an error.) */ int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec); +int sdp_device_record_update(sdp_session_t *sess, bdaddr_t *device, const sdp_record_t *rec); void sdp_record_print(const sdp_record_t *rec); diff --git a/src/sdp.c b/src/sdp.c index 84d0a016..4c1117e1 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2292,7 +2292,7 @@ void sdp_append_to_pdu(sdp_buf_t *pdu, sdp_data_t *d) * * Returns zero on success, otherwise -1 (and sets errno). */ -int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags) +int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec, uint8_t flags) { int status = 0; uint8_t *req, *rsp, *p; @@ -2348,10 +2348,15 @@ end: return status; } +int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags) +{ + return sdp_device_record_register(session, BDADDR_ANY, rec, flags); +} + /* * unregister a service record */ -int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) +int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec) { int status = 0; uint8_t *reqbuf, *rspbuf, *p; @@ -2405,10 +2410,15 @@ end: return status; } +int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) +{ + return sdp_device_record_unregister(session, BDADDR_ANY, rec); +} + /* * modify an existing service record */ -int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) +int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp_record_t *rec) { int status = 0; uint8_t *reqbuf, *rspbuf, *p; @@ -2472,6 +2482,11 @@ end: return status; } +int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) +{ + return sdp_device_record_update(session, BDADDR_ANY, rec); +} + sdp_record_t *sdp_record_alloc() { sdp_record_t *rec = (sdp_record_t *)malloc(sizeof(sdp_record_t)); -- cgit From fb1557c4111ca9993e4927af6f65bdbf9c2fa8ec Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 3 Aug 2005 07:41:21 +0000 Subject: Add device specific record register --- include/sdp.h | 1 + src/sdp.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index f08a7ddb..c2846242 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -371,6 +371,7 @@ extern "C" { * Values of the flags parameter to sdp_record_register */ #define SDP_RECORD_PERSIST 0x01 +#define SDP_DEVICE_RECORD 0x02 /* * Values of the flags parameter to sdp_connect diff --git a/src/sdp.c b/src/sdp.c index 4c1117e1..22fcd362 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2318,8 +2318,13 @@ int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_rec reqhdr->tid = htons(sdp_gen_tid(session)); reqsize = sizeof(sdp_pdu_hdr_t) + 1; p = req + sizeof(sdp_pdu_hdr_t); - *p++ = flags; - if (0 > sdp_gen_record_pdu(rec, &pdu)) { + if (bacmp(device, BDADDR_ANY)) { + *p++ = flags | SDP_DEVICE_RECORD; + bacpy((bdaddr_t *) p, device); + p += sizeof(bdaddr_t); + } else + *p++ = flags; + if (sdp_gen_record_pdu(rec, &pdu) < 0) { status = -1; errno = ENOMEM; goto end; -- cgit From 6db62cfa3a8de69270cc5e5689b633f43c02e041 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 3 Aug 2005 07:45:45 +0000 Subject: Fix request size calculation for device specific register --- src/sdp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdp.c b/src/sdp.c index 22fcd362..d920a753 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2322,6 +2322,7 @@ int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_rec *p++ = flags | SDP_DEVICE_RECORD; bacpy((bdaddr_t *) p, device); p += sizeof(bdaddr_t); + reqsize += sizeof(bdaddr_t); } else *p++ = flags; if (sdp_gen_record_pdu(rec, &pdu) < 0) { -- cgit From e602dbfade3e4ef56ef04a81489ba0374133a313 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Aug 2005 04:26:53 +0000 Subject: Cleanup --- src/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index 0aca162f..2447ae9b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -472,7 +472,7 @@ int hci_for_each_dev(int flag, int (*func)(int dd, int dev_id, long arg), long a dl->dev_num = HCI_MAX_DEV; dr = dl->dev_req; - if (ioctl(sk, HCIGETDEVLIST, (void *) dl)) + if (ioctl(sk, HCIGETDEVLIST, (void *) dl) < 0) goto free; for (i = 0; i < dl->dev_num; i++, dr++) { -- cgit From a73893381f0b7be98b8eb99d31ff834c7658d27c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Aug 2005 07:11:32 +0000 Subject: Introduce bt_malloc() and bt_free() functions --- include/bluetooth.h | 3 +++ src/bluetooth.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 33d68a61..b5d056df 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -136,6 +136,9 @@ int bafprintf(FILE *stream, const char *format, ...); int basprintf(char *str, const char *format, ...); int basnprintf(char *str, size_t size, const char *format, ...); +void *bt_malloc(size_t size); +void bt_free(void *ptr); + int bt_error(uint16_t code); char *bt_compidtostr(int id); diff --git a/src/bluetooth.c b/src/bluetooth.c index c54d63e3..1c01e2d9 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -162,6 +163,16 @@ int basnprintf(char *str, size_t size, const char *format, ...) return len; } +void *bt_malloc(size_t size) +{ + return malloc(size); +} + +void bt_free(void *ptr) +{ + free(ptr); +} + /* Bluetooth error codes to Unix errno mapping */ int bt_error(uint16_t code) { -- cgit From 9409e3e8e152290e253889df6922c56ef606b62b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Aug 2005 07:33:57 +0000 Subject: Update lmp_featurestostr() function --- src/hci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hci.c b/src/hci.c index 2447ae9b..c42d81c4 100644 --- a/src/hci.c +++ b/src/hci.c @@ -411,13 +411,13 @@ static hci_map lmp_features_map[8][9] = { char *lmp_featurestostr(uint8_t *features, char *pref, int width) { char *off, *ptr, *str; - int i, size = 0; + int i, size = 10; for (i = 0; i < 8; i++) { hci_map *m = lmp_features_map[i]; while (m->str) { - if ((unsigned int) m->val & (unsigned int) features[i]) + if (m->val & features[i]) size += strlen(m->str) + (pref ? strlen(pref) : 0) + 1; m++; } @@ -427,7 +427,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) if (!str) return NULL; - ptr = str; *ptr = 0; + ptr = str; *ptr = '\0'; if (pref) ptr += sprintf(ptr, "%s", pref); @@ -438,7 +438,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) hci_map *m = lmp_features_map[i]; while (m->str) { - if ((unsigned int) m->val & (unsigned int) features[i]) { + if (m->val & features[i]) { if (strlen(off) + strlen(m->str) > width - 1) { ptr += sprintf(ptr, "\n%s", pref ? pref : ""); off = ptr; -- cgit From 049d8b7167e88eb376a7173188eb09a5d6b19b41 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Aug 2005 08:08:42 +0000 Subject: Add HCI message header --- include/hci.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hci.h b/include/hci.h index 29518dbb..c9de094d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1370,6 +1370,13 @@ typedef struct { } __attribute__ ((packed)) hci_sco_hdr; #define HCI_SCO_HDR_SIZE 3 +typedef struct { + uint16_t device; + uint16_t type; + uint16_t plen; +} __attribute__ ((packed)) hci_msg_hdr; +#define HCI_MSG_HDR_SIZE 6 + /* Command opcode pack/unpack */ #define cmd_opcode_pack(ogf, ocf) (uint16_t)((ocf & 0x03ff)|(ogf << 10)) #define cmd_opcode_ogf(op) (op >> 10) -- cgit From e739d2ea50020d8bf8a470a0972ea80db6c3d563 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Aug 2005 08:09:03 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index ee4510ca..9855edc6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:18:0 +libbluetooth_la_LDFLAGS = -version-info 1:19:0 INCLUDES = -I$(top_builddir)/include -- cgit From 21afc09548463710e61451a2e37946a1b515bc6f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Aug 2005 08:13:06 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bb068d03..ff454ae4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 2.19: + Fix the GCC 4.0 warnings. + Fix the routing for dealing with raw devices. + Add per device service record functions. + ver 2.18: Add support for reading and writing the inquiry scan type. Add definitions for connection accept timeout and scan enable. diff --git a/configure.in b/configure.in index 5b224079..d1986280 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.18) +AM_INIT_AUTOMAKE(bluez-libs, 2.19) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 2fa38208982e7c7bb55ae97acd13dbf82dd24e88 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 6 Aug 2005 17:43:48 +0000 Subject: Add UUID for video distribution --- include/sdp.h | 2 ++ src/sdp.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index c2846242..6aeffc19 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -139,6 +139,7 @@ extern "C" { #define UPNP_L2CAP_SVCLASS_ID 0x1302 #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 +#define VIDEO_DISTRIBUTION_SVCLASS_ID 0x1305 /* * Standard profile descriptor identifiers; note these @@ -203,6 +204,7 @@ extern "C" { #define UPNP_L2CAP_PROFILE_ID UPNP_L2CAP_SVCLASS_ID #define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID #define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID +#define VIDEO_DISTRIBUTION_PROFILE_ID VIDEO_DISTRIBUTION_SVCLASS_ID /* * Attribute identifier codes diff --git a/src/sdp.c b/src/sdp.c index d920a753..c48d4ba7 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -192,6 +192,7 @@ static struct tupla ServiceClass[] = { { UPNP_L2CAP_SVCLASS_ID, "UPnP L2CAP" }, { VIDEO_SOURCE_SVCLASS_ID, "Video Source" }, { VIDEO_SINK_SVCLASS_ID, "Video Sink" }, + { VIDEO_DISTRIBUTION_SVCLASS_ID, "Video Distribution" }, { 0 } }; -- cgit From 8ce8108e712e40e1b9530c96f7ff6cbb32b5cb8b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 7 Aug 2005 11:19:57 +0000 Subject: Add UUIDs for phonebook access profile --- include/sdp.h | 4 ++++ src/sdp.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index 6aeffc19..c21cb979 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -127,6 +127,8 @@ extern "C" { #define UDI_TA_SVCLASS_ID 0x112b #define AV_SVCLASS_ID 0x112c #define SAP_SVCLASS_ID 0x112d +#define PBAP_PCE_SVCLASS_ID 0x112e +#define PBAP_PSE_SVCLASS_ID 0x112f #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 @@ -192,6 +194,8 @@ extern "C" { #define UDI_TA_PROFILE_ID UDI_TA_SVCLASS_ID #define AV_PROFILE_ID AV_SVCLASS_ID #define SAP_PROFILE_ID SAP_SVCLASS_ID +#define PBAP_PCE_PROFILE_ID PBAP_PCE_PROFILE_ID +#define PBAP_PSE_PROFILE_ID PBAP_PSE_PROFILE_ID #define PNP_INFO_PROFILE_ID PNP_INFO_SVCLASS_ID #define GENERIC_NETWORKING_PROFILE_ID GENERIC_NETWORKING_SVCLASS_ID #define GENERIC_FILETRANS_PROFILE_ID GENERIC_FILETRANS_SVCLASS_ID diff --git a/src/sdp.c b/src/sdp.c index c48d4ba7..0198f9ec 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -180,6 +180,8 @@ static struct tupla ServiceClass[] = { { UDI_TA_SVCLASS_ID, "UDI TA" }, { AV_SVCLASS_ID, "Audio/Video" }, { SAP_SVCLASS_ID, "SIM Access" }, + { PBAP_PCE_SVCLASS_ID, "Phonebook Access - PCE" }, + { PBAP_PSE_SVCLASS_ID, "Phonebook Access - PSE" }, { PNP_INFO_SVCLASS_ID, "PnP Information" }, { GENERIC_NETWORKING_SVCLASS_ID, "Generic Networking" }, { GENERIC_FILETRANS_SVCLASS_ID, "Generic File Transfer" }, -- cgit From 44f113d701858c5c502b30873b5a0375140eb211 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 16 Aug 2005 21:22:47 +0000 Subject: Add extended inquiry definitions --- include/hci.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/hci.h b/include/hci.h index c9de094d..3b977033 100644 --- a/include/hci.h +++ b/include/hci.h @@ -901,6 +901,25 @@ typedef struct { } __attribute__ ((packed)) write_afh_mode_rp; #define WRITE_AFH_MODE_RP_SIZE 1 +#define OCF_READ_EXT_INQUIRY_RESPONSE 0x0051 +typedef struct { + uint8_t status; + uint8_t fec; + uint8_t data[240]; +} __attribute__ ((packed)) read_ext_inquiry_response_rp; +#define READ_EXT_INQUIRY_RESPONSE_RP_SIZE 242 + +#define OCF_WRITE_EXT_INQUIRY_RESPONSE 0x0052 +typedef struct { + uint8_t fec; + uint8_t data[240]; +} __attribute__ ((packed)) write_ext_inquiry_response_cp; +#define WRITE_EXT_INQUIRY_RESPONSE_CP_SIZE 241 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_ext_inquiry_response_rp; +#define WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -1316,6 +1335,18 @@ typedef struct { } __attribute__ ((packed)) evt_sync_conn_changed; #define EVT_SYNC_CONN_CHANGED_SIZE 9 +#define EVT_EXTENDED_INQUIRY_RESULT 0x2F +typedef struct { + bdaddr_t bdaddr; + uint8_t pscan_rep_mode; + uint8_t pscan_period_mode; + uint8_t dev_class[3]; + uint16_t clock_offset; + int8_t rssi; + uint8_t data[240]; +} __attribute__ ((packed)) extended_inquiry_info; +#define EXTENDED_INQUIRY_INFO 254 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF -- cgit From b91cf84c987b8cc4bdfa9c0fb0daf88089c5687a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 22 Aug 2005 10:44:04 +0000 Subject: Add attribute identifier for supported repositories --- include/sdp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sdp.h b/include/sdp.h index c21cb979..c622e177 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -261,6 +261,7 @@ extern "C" { #define SDP_ATTR_SUPPORTED_FEATURES 0x0311 #define SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312 #define SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313 +#define SDP_ATTR_SUPPORTED_REPOSITORIES 0x0314 #define SDP_ATTR_SPECIFICATION_ID 0x0200 #define SDP_ATTR_VENDOR_ID 0x0201 -- cgit From 250f3d42abeb25d8b08638130d5f4674af6168c6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 24 Aug 2005 23:08:00 +0000 Subject: Fix extended inquiry info structure size --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 3b977033..b7df747a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1345,7 +1345,7 @@ typedef struct { int8_t rssi; uint8_t data[240]; } __attribute__ ((packed)) extended_inquiry_info; -#define EXTENDED_INQUIRY_INFO 254 +#define EXTENDED_INQUIRY_INFO_SIZE 254 #define EVT_TESTING 0xFE -- cgit From f544b5e43cc3c64d43e73a3fbfc5fd045b6de00c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Aug 2005 00:54:48 +0000 Subject: Add functions for the extended inquiry response --- include/hci_lib.h | 2 ++ src/hci.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 4bfc5197..b27980ad 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -101,6 +101,8 @@ int hci_read_inquiry_mode(int dd, uint8_t *mode, int to); int hci_write_inquiry_mode(int dd, uint8_t mode, int to); int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); +int hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to); +int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); diff --git a/src/hci.c b/src/hci.c index c42d81c4..f92aa4f2 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1732,6 +1732,60 @@ int hci_write_afh_mode(int dd, uint8_t mode, int to) return 0; } +int hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to) +{ + read_ext_inquiry_response_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_EXT_INQUIRY_RESPONSE; + rq.rparam = &rp; + rq.rlen = READ_EXT_INQUIRY_RESPONSE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *fec = rp.fec; + memcpy(data, rp.data, 240); + + return 0; +} + +int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to) +{ + write_ext_inquiry_response_cp cp; + write_ext_inquiry_response_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.fec = fec; + memcpy(cp.data, data, 240); + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_EXT_INQUIRY_RESPONSE; + rq.cparam = &cp; + rq.clen = WRITE_EXT_INQUIRY_RESPONSE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} + int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to) { read_transmit_power_level_cp cp; -- cgit From 652785638e4bf41e1a60827005d1253a0af7b3e8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 26 Aug 2005 22:26:49 +0000 Subject: Use bt_malloc() for address translation functions --- src/bluetooth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bluetooth.c b/src/bluetooth.c index 1c01e2d9..9ba19c50 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -54,7 +54,7 @@ void baswap(bdaddr_t *dst, const bdaddr_t *src) char *batostr(const bdaddr_t *ba) { - char *str = malloc(18); + char *str = bt_malloc(18); if (!str) return NULL; @@ -69,7 +69,7 @@ bdaddr_t *strtoba(const char *str) const char *ptr = str; int i; - uint8_t *ba = malloc(sizeof(bdaddr_t)); + uint8_t *ba = bt_malloc(sizeof(bdaddr_t)); if (!ba) return NULL; -- cgit From f50545eae585ba4b3eac5d8764827342ae214843 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 27 Aug 2005 10:53:49 +0000 Subject: Add extended inquiry features bit --- include/hci.h | 2 ++ src/hci.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/hci.h b/include/hci.h index b7df747a..243889d3 100644 --- a/include/hci.h +++ b/include/hci.h @@ -254,6 +254,8 @@ enum { #define LMP_EDR_ESCO_3M 0x40 #define LMP_EDR_3S_ESCO 0x80 +#define LMP_EXT_INQ 0x01 + #define LMP_EXT_FEAT 0x80 /* Link policies */ diff --git a/src/hci.c b/src/hci.c index f92aa4f2..dd3d0d74 100644 --- a/src/hci.c +++ b/src/hci.c @@ -400,6 +400,7 @@ static hci_map lmp_features_map[8][9] = { { NULL } }, { /* Byte 6 */ + { "", LMP_EXT_INQ }, /* Bit 0 */ { NULL } }, { /* Byte 7 */ -- cgit From 0945829c8c01d162cdabfe96ba8d6f432769947a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 27 Aug 2005 13:18:21 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 9855edc6..3e5af5b2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:19:0 +libbluetooth_la_LDFLAGS = -version-info 1:20:0 INCLUDES = -I$(top_builddir)/include -- cgit From 364f4856732744dce0b99182a3b1f8f557fb2a7a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 27 Aug 2005 13:22:50 +0000 Subject: Update changelog and bump version number --- ChangeLog | 7 +++++++ configure.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ff454ae4..87442430 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +ver 2.20: + Add UUIDs for video distribution profile. + Add UUIDs for phonebook access profile. + Add attribute identifier for supported repositories. + Add definitions for extended inquiry response. + Add functions for extended inquiry response. + ver 2.19: Fix the GCC 4.0 warnings. Fix the routing for dealing with raw devices. diff --git a/configure.in b/configure.in index d1986280..c88ae69d 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.19) +AM_INIT_AUTOMAKE(bluez-libs, 2.20) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 7e5d794489e6dacb2e37553495af61c98cb78fbc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 4 Sep 2005 22:01:16 +0000 Subject: Add two new company identifiers --- src/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 9ba19c50..36f186c5 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -377,6 +377,10 @@ char *bt_compidtostr(int compid) return "IPextreme, Inc."; case 62: return "Systems and Chips, Inc"; + case 63: + return "Bluetooth SIG, Inc"; + case 64: + return "Seiko Epson Corporation"; case 65535: return "internal use"; default: -- cgit From b48bccaf6c89da2af3a20617f4a496be4a633c5b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 7 Sep 2005 16:14:55 +0000 Subject: Add support for identification of supported commands --- include/hci_lib.h | 3 + src/hci.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 196 insertions(+), 6 deletions(-) diff --git a/include/hci_lib.h b/include/hci_lib.h index b27980ad..03305547 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -129,6 +129,9 @@ int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); int hci_strtolm(char *str, unsigned int *val); +char *hci_cmdtostr(unsigned int cmd); +char *hci_commandstostr(uint8_t *commands, char *pref, int width); + char *hci_vertostr(unsigned int ver); int hci_strtover(char *str, unsigned int *ver); char *lmp_vertostr(unsigned int ver); diff --git a/src/hci.c b/src/hci.c index dd3d0d74..a9c482a2 100644 --- a/src/hci.c +++ b/src/hci.c @@ -98,7 +98,7 @@ static int hci_str2bit(hci_map *map, char *str, unsigned int *val) static char *hci_uint2str(hci_map *m, unsigned int val) { - char *str = malloc(50); + char *str = bt_malloc(50); char *ptr = str; if (!str) @@ -309,6 +309,195 @@ int hci_strtolm(char *str, unsigned int *val) return hci_str2bit(link_mode_map, str, val); } +/* Command mapping */ +static hci_map commands_map[] = { + { "Inquiry", 0 }, + { "Inquiry Cancel", 1 }, + { "Periodic Inquiry Mode", 2 }, + { "Exit Periodic Inquiry Mode", 3 }, + { "Create Connection", 4 }, + { "Disconnect", 5 }, + { "Add SCO Connection", 6 }, + { "Cancel Create Connection", 7 }, + { "Accept Connection Request", 8 }, + { "Reject Connection Request", 9 }, + { "Link Key Request Reply", 10 }, + { "Link Key Request Negative Reply", 11 }, + { "PIN Code Request Reply", 12 }, + { "PIN Code Request Negative Reply", 13 }, + { "Change Connection Packet Type", 14 }, + { "Authentication Requested", 15 }, + { "Set Connection Encryption", 16 }, + { "Change Connection Link Key", 17 }, + { "Master Link Key", 18 }, + { "Remote Name Request", 19 }, + { "Cancel Remote Name Request", 20 }, + { "Read Remote Supported Features", 21 }, + { "Read Remote Extended Features", 22 }, + { "Read Remote Version Information", 23 }, + { "Read Clock Offset", 24 }, + { "Read LMP Handle", 25 }, + { "Reserved", 26 }, + { "Reserved", 27 }, + { "Reserved", 28 }, + { "Reserved", 29 }, + { "Reserved", 30 }, + { "Reserved", 31 }, + { "Reserved", 32 }, + { "Hold Mode", 33 }, + { "Sniff Mode", 34 }, + { "Exit Sniff Mode", 35 }, + { "Park State", 36 }, + { "Exit Park State", 37 }, + { "QoS Setup", 38 }, + { "Role Discovery", 39 }, + { "Switch Role", 40 }, + { "Read Link Policy Settings", 41 }, + { "Write Link Policy Settings", 42 }, + { "Read Default Link Policy Settings", 43 }, + { "Write Default Link Policy Settings", 44 }, + { "Flow Specification", 45 }, + { "Set Event Mask", 46 }, + { "Reset", 47 }, + { "Set Event Filter", 48 }, + { "Flush", 49 }, + { "Read PIN Type", 50 }, + { "Write PIN Type", 51 }, + { "Create New Unit Key", 52 }, + { "Read Stored Link Key", 53 }, + { "Write Stored Link Key", 54 }, + { "Delete Stored Link Key", 55 }, + { "Write Local Name", 56 }, + { "Read Local Name", 57 }, + { "Read Connection Accept Timeout", 58 }, + { "Write Connection Accept Timeout", 59 }, + { "Read Page Timeout", 60 }, + { "Write Page Timeout", 61 }, + { "Read Scan Enable", 62 }, + { "Write Scan Enable", 63 }, + { "Read Page Scan Activity", 64 }, + { "Write Page Scan Activity", 65 }, + { "Read Inquiry Scan Activity", 66 }, + { "Write Inquiry Scan Activity", 67 }, + { "Read Authentication Enable", 68 }, + { "Write Authentication Enable", 69 }, + { "Read Encryption Mode", 70 }, + { "Write Encryption Mode", 71 }, + { "Read Class Of Device", 72 }, + { "Write Class Of Device", 73 }, + { "Read Voice Setting", 74 }, + { "Write Voice Setting", 75 }, + { "Read Automatic Flush Timeout", 76 }, + { "Write Automatic Flush Timeout", 77 }, + { "Read Num Broadcast Retransmissions", 78 }, + { "Write Num Broadcast Retransmissions", 79 }, + { "Read Hold Mode Activity", 80 }, + { "Write Hold Mode Activity", 81 }, + { "Read Transmit Power Level", 82 }, + { "Read Synchronous Flow Control Enable", 83 }, + { "Write Synchronous Flow Control Enable", 84 }, + { "Set Host Controller To Host Flow Control", 85 }, + { "Host Buffer Size", 86 }, + { "Host Number Of Completed Packets", 87 }, + { "Read Link Supervision Timeout", 88 }, + { "Write Link Supervision Timeout", 89 }, + { "Read Number of Supported IAC", 90 }, + { "Read Current IAC LAP", 91 }, + { "Write Current IAC LAP", 92 }, + { "Reserved", 93 }, + { "Reserved", 94 }, + { "Read Page Scan Mode", 95 }, + { "Write Page Scan Mode", 96 }, + { "Set AFH Channel Classification", 97 }, + { "reserved", 98 }, + { "reserved", 99 }, + { "Read Inquiry Scan Type", 100 }, + { "Write Inquiry Scan Type", 101 }, + { "Read Inquiry Mode", 102 }, + { "Write Inquiry Mode", 103 }, + { "Read Page Scan Type", 104 }, + { "Write Page Scan Type", 105 }, + { "Read AFH Channel Assessment Mode", 106 }, + { "Write AFH Channel Assessment Mode", 107 }, + { "Reserved", 108 }, + { "Reserved", 109 }, + { "Reserved", 110 }, + { "Reserved", 111 }, + { "Reserved", 112 }, + { "Reserved", 113 }, + { "Reserved", 114 }, + { "Read Loacal Version Information", 115 }, + { "Reserved", 116 }, + { "Read Local Supported Features", 117 }, + { "Read Local Extended Features", 118 }, + { "Read Buffer Sizer", 119 }, + { "Read Country Code", 120 }, + { "Read BD ADDR", 121 }, + { "Read Failed Contact Counter", 122 }, + { "Reset Failed Contact Counter", 123 }, + { "Get Link Quality", 124 }, + { "Read RSSI", 125 }, + { "Read AFH Channel Map", 126 }, + { "Read BD Clock", 127 }, + { "Read Loopback Mode", 128 }, + { "Write Loopback Mode", 129 }, + { "Enable Device Under Test Mode", 130 }, + { "Setup Synchronous Connection", 131 }, + { "Accept Synchronous Connection", 132 }, + { "Reject Synchronous Connection", 133 }, + { "Reserved", 134 }, + { "Reserved", 135 }, + { "Read Extended Inquiry Response", 136 }, + { "Write Extended Inquiry Response", 137 }, + { NULL } +}; + +char *hci_cmdtostr(unsigned int cmd) +{ + return hci_uint2str(commands_map, cmd); +} + +char *hci_commandstostr(uint8_t *commands, char *pref, int width) +{ + hci_map *m; + char *off, *ptr, *str; + int size = 10; + + m = commands_map; + + while (m->str) { + if (hci_test_bit(m->val, commands)) + size += strlen(m->str) + (pref ? strlen(pref) : 0) + 3; + m++; + } + + str = bt_malloc(size); + if (!str) + return NULL; + + ptr = str; *ptr = '\0'; + + if (pref) + ptr += sprintf(ptr, "%s", pref); + + off = ptr; + + m = commands_map; + + while (m->str) { + if (hci_test_bit(m->val, commands)) { + if (strlen(off) + strlen(m->str) > width - 3) { + ptr += sprintf(ptr, "\n%s", pref ? pref : ""); + off = ptr; + } + ptr += sprintf(ptr, "'%s' ", m->str); + } + m++; + } + + return str; +} + /* Version mapping */ static hci_map ver_map[] = { { "1.0b", 0x00 }, @@ -320,8 +509,7 @@ static hci_map ver_map[] = { char *hci_vertostr(unsigned int ver) { - char *str = hci_uint2str(ver_map, ver); - return *str ? str : "n/a"; + return hci_uint2str(ver_map, ver); } int hci_strtover(char *str, unsigned int *ver) @@ -331,8 +519,7 @@ int hci_strtover(char *str, unsigned int *ver) char *lmp_vertostr(unsigned int ver) { - char *str = hci_uint2str(ver_map, ver); - return *str ? str : "n/a"; + return hci_uint2str(ver_map, ver); } int lmp_strtover(char *str, unsigned int *ver) @@ -424,7 +611,7 @@ char *lmp_featurestostr(uint8_t *features, char *pref, int width) } } - str = malloc(size); + str = bt_malloc(size); if (!str) return NULL; -- cgit From 19f7dc5517f6c598d9e351ec28fad811e0f0ee59 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 8 Sep 2005 11:50:20 +0000 Subject: Add missing OCF declarations for the security filter --- include/hci.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/hci.h b/include/hci.h index 243889d3..d12232d8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -575,6 +575,10 @@ typedef struct { } __attribute__ ((packed)) write_link_policy_rp; #define WRITE_LINK_POLICY_RP_SIZE 3 +#define OCF_READ_DEFAULT_LINK_POLICY 0x000E + +#define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F + /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 @@ -784,6 +788,18 @@ typedef struct { } __attribute__ ((packed)) write_voice_setting_cp; #define WRITE_VOICE_SETTING_CP_SIZE 2 +#define OCF_READ_AUTOMATIC_FLUSH_TIMEOUT 0x0027 + +#define OCF_WRITE_AUTOMATIC_FLUSH_TIMEOUT 0x0028 + +#define OCF_READ_NUM_BROADCAST_RETRANS 0x0029 + +#define OCF_WRITE_NUM_BROADCAST_RETRANS 0x002A + +#define OCF_READ_HOLD_MODE_ACTIVITY 0x002B + +#define OCF_WRITE_HOLD_MODE_ACTIVITY 0x002C + #define OCF_READ_TRANSMIT_POWER_LEVEL 0x002D typedef struct { uint16_t handle; @@ -826,6 +842,8 @@ typedef struct { } __attribute__ ((packed)) write_link_supervision_timeout_rp; #define WRITE_LINK_SUPERVISION_TIMEOUT_RP_SIZE 3 +#define OCF_READ_NUM_SUPPORTED_IAC 0x0038 + #define MAX_IAC_LAP 0x40 #define OCF_READ_CURRENT_IAC_LAP 0x0039 typedef struct { @@ -842,6 +860,14 @@ typedef struct { } __attribute__ ((packed)) write_current_iac_lap_cp; #define WRITE_CURRENT_IAC_LAP_CP_SIZE 1+3*MAX_IAC_LAP +#define OCF_READ_PAGE_SCAN_PERIOD_MODE 0x003B + +#define OCF_WRITE_PAGE_SCAN_PERIOD_MODE 0x003C + +#define OCF_READ_PAGE_SCAN_MODE 0x003D + +#define OCF_WRITE_PAGE_SCAN_MODE 0x003E + #define OCF_SET_AFH_CLASSIFICATION 0x003F typedef struct { uint8_t map[10]; @@ -886,6 +912,10 @@ typedef struct { } __attribute__ ((packed)) write_inquiry_mode_rp; #define WRITE_INQUIRY_MODE_RP_SIZE 1 +#define OCF_READ_PAGE_SCAN_TYPE 0x0046 + +#define OCF_WRITE_PAGE_SCAN_TYPE 0x0047 + #define OCF_READ_AFH_MODE 0x0048 typedef struct { uint8_t status; @@ -973,6 +1003,8 @@ typedef struct { } __attribute__ ((packed)) read_buffer_size_rp; #define READ_BUFFER_SIZE_RP_SIZE 8 +#define OCF_READ_COUNTRY_CODE 0x0007 + #define OCF_READ_BD_ADDR 0x0009 typedef struct { uint8_t status; -- cgit From 4537f4ccc98218a2f716294ad957981118a20d8b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 10 Sep 2005 10:50:07 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3e5af5b2..8da234ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:20:0 +libbluetooth_la_LDFLAGS = -version-info 1:21:0 INCLUDES = -I$(top_builddir)/include -- cgit From c15d73bdb64196dee440476b5c3c031ee52c2373 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 10 Sep 2005 10:51:47 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 87442430..fe45974c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 2.21: + Add support for identification of supported commands. + Add missing OCF declarations for the security filter. + Add two new company identifiers. + ver 2.20: Add UUIDs for video distribution profile. Add UUIDs for phonebook access profile. diff --git a/configure.in b/configure.in index c88ae69d..cfad2c1b 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.20) +AM_INIT_AUTOMAKE(bluez-libs, 2.21) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 12862715c961bf6dabce2ed4e58da58e5dfe8c6b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 22 Sep 2005 23:10:48 +0000 Subject: Fix errno overwrite problems --- src/hci.c | 13 ++++++++----- src/sdp.c | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hci.c b/src/hci.c index a9c482a2..05974432 100644 --- a/src/hci.c +++ b/src/hci.c @@ -647,21 +647,25 @@ int hci_for_each_dev(int flag, int (*func)(int dd, int dev_id, long arg), long a struct hci_dev_list_req *dl; struct hci_dev_req *dr; int dev_id = -1; - int i, sk, err; + int i, sk, err = 0; sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); if (sk < 0) return -1; dl = malloc(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl)); - if (!dl) + if (!dl) { + err = errno; goto done; + } dl->dev_num = HCI_MAX_DEV; dr = dl->dev_req; - if (ioctl(sk, HCIGETDEVLIST, (void *) dl) < 0) + if (ioctl(sk, HCIGETDEVLIST, (void *) dl) < 0) { + err = errno; goto free; + } for (i = 0; i < dl->dev_num; i++, dr++) { if (hci_test_bit(flag, &dr->dev_opt)) @@ -672,13 +676,12 @@ int hci_for_each_dev(int flag, int (*func)(int dd, int dev_id, long arg), long a } if (dev_id < 0) - errno = ENODEV; + err = ENODEV; free: free(dl); done: - err = errno; close(sk); errno = err; diff --git a/src/sdp.c b/src/sdp.c index 0198f9ec..56c74d49 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3160,6 +3160,7 @@ static inline int sdp_is_local(const bdaddr_t *device) sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags) { + int err; sdp_session_t *session = malloc(sizeof(sdp_session_t)); if (!session) return session; @@ -3204,8 +3205,10 @@ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t fl } } fail: + err = errno; if (session->sock >= 0) close(session->sock); free(session); + errno = err; return 0; } -- cgit From 0f5a5a9580084a3c4e0644ef5cd75689aeb5ff40 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 30 Sep 2005 14:43:37 +0000 Subject: Fix profile descriptor problem with Samsung phones --- src/sdp.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 56c74d49..e0df7582 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1529,12 +1529,24 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq) return -1; } for (seq = sdpdata->val.dataseq; seq && seq->val.dataseq; seq = seq->next) { - sdp_data_t *uuid = seq->val.dataseq; - sdp_data_t *pVnum = seq->val.dataseq->next; - if (uuid && pVnum) { + uuid_t *uuid = NULL; + uint16_t version = 0x100; + + if (SDP_IS_UUID(seq->dtd)) { + uuid = &seq->val.uuid; + } else { + sdp_data_t *puuid = seq->val.dataseq; + sdp_data_t *pVnum = seq->val.dataseq->next; + if (puuid && pVnum) { + uuid = &puuid->val.uuid; + version = pVnum->val.uint16; + } + } + + if (uuid != NULL) { profDesc = (sdp_profile_desc_t *)malloc(sizeof(sdp_profile_desc_t)); - profDesc->uuid = uuid->val.uuid; - profDesc->version = pVnum->val.uint16; + profDesc->uuid = *uuid; + profDesc->version = version; #ifdef SDP_DEBUG sdp_uuid_print(&profDesc->uuid); SDPDBG("Vnum : 0x%04x\n", profDesc->version); -- cgit From 0fccefa9c8f3299917f72f9afc37f8fc64c08f00 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 9 Oct 2005 22:45:07 +0000 Subject: Add compile time buffer checks (FORTIFY SOURCE) --- acinclude.m4 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 2f1077ea..92cde650 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -49,12 +49,21 @@ AC_DEFUN([AC_INIT_BLUEZ], [ ]) AC_DEFUN([AC_ARG_BLUEZ], [ + fortify_enable=yes debug_enable=no + AC_ARG_ENABLE(fortify, AC_HELP_STRING([--disable-fortify], [disable compile time buffer checks]), [ + fortify_enable=${enableval} + ]) + AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable compiling with debugging information]), [ debug_enable=${enableval} ]) + if (test "${fortify_enable}" = "yes"); then + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" + fi + if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then CFLAGS="$CFLAGS -g" fi -- cgit From a11814589084bb8afbb150177159039f396508a8 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 9 Oct 2005 23:16:17 +0000 Subject: Add compile script --- compile | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 compile diff --git a/compile b/compile new file mode 100755 index 00000000..22442a82 --- /dev/null +++ b/compile @@ -0,0 +1,2 @@ +#! /bin/sh +./configure --enable-maintainer-mode && make && sudo make install -- cgit From b60f09936298f7115d5387398d5eeb0156b08892 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 20 Oct 2005 08:55:11 +0000 Subject: Make EVT_CMD_STATUS as rp->event work --- src/hci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index 05974432..c4bb3cd3 100644 --- a/src/hci.c +++ b/src/hci.c @@ -976,7 +976,13 @@ int hci_send_req(int dd, struct hci_request *r, int to) errno = EIO; goto failed; } - break; + + if (r->event != EVT_CMD_STATUS) + break; + + r->rlen = MIN(len, r->rlen); + memcpy(r->rparam, ptr, r->rlen); + goto done; case EVT_CMD_COMPLETE: cc = (void *) ptr; -- cgit From 4fb6514cdebdeb4317ee3a5ef59abcdaf3697d2b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 22 Oct 2005 14:27:14 +0000 Subject: Add deprecated command names from the Bluetooth 1.2 specification --- src/hci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hci.c b/src/hci.c index c4bb3cd3..c1aa9b28 100644 --- a/src/hci.c +++ b/src/hci.c @@ -404,8 +404,8 @@ static hci_map commands_map[] = { { "Read Number of Supported IAC", 90 }, { "Read Current IAC LAP", 91 }, { "Write Current IAC LAP", 92 }, - { "Reserved", 93 }, - { "Reserved", 94 }, + { "Read Page Scan Period Mode", 93 }, + { "Write Page Scan Period Mode", 94 }, { "Read Page Scan Mode", 95 }, { "Write Page Scan Mode", 96 }, { "Set AFH Channel Classification", 97 }, @@ -426,8 +426,8 @@ static hci_map commands_map[] = { { "Reserved", 112 }, { "Reserved", 113 }, { "Reserved", 114 }, - { "Read Loacal Version Information", 115 }, - { "Reserved", 116 }, + { "Read Local Version Information", 115 }, + { "Read Local Supported Commands", 116 }, { "Read Local Supported Features", 117 }, { "Read Local Extended Features", 118 }, { "Read Buffer Sizer", 119 }, -- cgit From 555ac3f21cb5f6099755d43c3c1e89a1a554b435 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 22 Oct 2005 15:51:12 +0000 Subject: Fix typo --- src/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index c1aa9b28..b286d46f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -430,7 +430,7 @@ static hci_map commands_map[] = { { "Read Local Supported Commands", 116 }, { "Read Local Supported Features", 117 }, { "Read Local Extended Features", 118 }, - { "Read Buffer Sizer", 119 }, + { "Read Buffer Size", 119 }, { "Read Country Code", 120 }, { "Read BD ADDR", 121 }, { "Read Failed Contact Counter", 122 }, -- cgit From 1364c63b9eea39b40ab07e0045ef26e76d1ade1a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 22 Oct 2005 17:32:35 +0000 Subject: Decode reserved LMP feature bits --- src/hci.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hci.c b/src/hci.c index b286d46f..80813ad6 100644 --- a/src/hci.c +++ b/src/hci.c @@ -556,10 +556,14 @@ static hci_map lmp_features_map[8][9] = { { "", LMP_PSCHEME }, /* Bit 1 */ { "", LMP_PCONTROL }, /* Bit 2 */ { "", LMP_TRSP_SCO }, /* Bit 3 */ + { "",LMP_BCAST_ENC }, /* Bit 7 */ { NULL } }, { /* Byte 3 */ + { "", 0x01 }, /* Bit 0 */ { "", LMP_EDR_ACL_2M }, /* Bit 1 */ { "", LMP_EDR_ACL_3M }, /* Bit 2 */ { "", LMP_ENH_ISCAN }, /* Bit 3 */ @@ -572,13 +576,18 @@ static hci_map lmp_features_map[8][9] = { { /* Byte 4 */ { "", LMP_EV4 }, /* Bit 0 */ { "", LMP_EV5 }, /* Bit 1 */ + { "", 0x04 }, /* Bit 2 */ { "", LMP_AFH_CAP_SLV }, /* Bit 3 */ { "", LMP_AFH_CLS_SLV }, /* Bit 4 */ + { "", 0x20 }, /* Bit 5 */ + { "", 0x40 }, /* Bit 6 */ { "<3-slot EDR ACL>", LMP_EDR_3SLOT }, /* Bit 7 */ { NULL } }, { /* Byte 5 */ { "<5-slot EDR ACL>", LMP_EDR_5SLOT }, /* Bit 0 */ + { "", 0x02 }, /* Bit 1 */ + { "", 0x04 }, /* Bit 2 */ { "", LMP_AFH_CAP_MST }, /* Bit 3 */ { "",LMP_AFH_CLS_MST }, /* Bit 4 */ { "", LMP_EDR_ESCO_2M }, /* Bit 5 */ -- cgit From fbe418e8c919e8063c86ea9f26cdebbe69acdb86 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 26 Oct 2005 22:40:53 +0000 Subject: Update bootstrap stuff --- bootstrap | 9 +++++++-- bootstrap-configure | 6 ++++++ compile | 2 -- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100755 bootstrap-configure delete mode 100755 compile diff --git a/bootstrap b/bootstrap index 199053bb..c838d5e2 100755 --- a/bootstrap +++ b/bootstrap @@ -1,2 +1,7 @@ -#! /bin/sh -aclocal && autoheader && libtoolize --copy --force && automake --add-missing --copy --ignore-deps && autoconf +#!/bin/sh + +aclocal && \ + autoheader && \ + libtoolize --copy --force && \ + automake --add-missing --copy && \ + autoconf diff --git a/bootstrap-configure b/bootstrap-configure new file mode 100755 index 00000000..2545c770 --- /dev/null +++ b/bootstrap-configure @@ -0,0 +1,6 @@ +#!/bin/sh + +./bootstrap && \ + ./configure --enable-maintainer-mode \ + --enable-debug \ + --prefix=/usr diff --git a/compile b/compile deleted file mode 100755 index 22442a82..00000000 --- a/compile +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -./configure --enable-maintainer-mode && make && sudo make install -- cgit From c0d524486a50e8366c12c5ebea1a4441e9db46aa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Oct 2005 19:25:42 +0000 Subject: Big cleanup of CVS relics --- AUTHORS | 7 ------ COPYING | 6 +++--- INSTALL | 61 +++++++++++++++++++++++++++++------------------------ Makefile.am | 3 --- README | 9 +++++--- acinclude.m4 | 6 +----- bluez.m4 | 4 ---- bootstrap-configure | 4 ++++ configure.in | 4 ---- include/Makefile.am | 3 --- include/bluetooth.h | 25 +++++++++------------- include/bnep.h | 25 +++++++++------------- include/cmtp.h | 25 +++++++++------------- include/hci.h | 25 +++++++++------------- include/hci_lib.h | 25 +++++++++------------- include/hidp.h | 25 +++++++++------------- include/l2cap.h | 25 +++++++++------------- include/rfcomm.h | 25 +++++++++------------- include/sco.h | 25 +++++++++------------- include/sdp.h | 25 +++++++++------------- include/sdp_lib.h | 25 +++++++++------------- src/Makefile.am | 3 --- src/bluetooth.c | 25 +++++++++------------- src/hci.c | 25 +++++++++------------- src/sdp.c | 25 +++++++++------------- 25 files changed, 188 insertions(+), 272 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7c0abf7a..2c545128 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,10 +1,3 @@ Maxim Krasnyansky - Original author. - Marcel Holtmann - Primary maintainer. - Various patches, fixes and other contributions. - Stephen Crane - Support for many HCI functions. - Memory leak fixes and SDP API cleanups. diff --git a/COPYING b/COPYING index d60c31a9..3912109b 100644 --- a/COPYING +++ b/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. @@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/INSTALL b/INSTALL index 54caf7c1..56b077d6 100644 --- a/INSTALL +++ b/INSTALL @@ -1,13 +1,16 @@ -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. +Installation Instructions +************************* - This file is free documentation; the Free Software Foundation gives +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== - These are generic installation instructions. +These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -67,9 +70,9 @@ The simplest way to compile this package is: Compilers and Options ===================== - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here @@ -82,7 +85,7 @@ is an example: Compiling For Multiple Architectures ==================================== - You can compile the package for more than one kind of computer at the +You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the @@ -99,19 +102,19 @@ for another architecture. Installation Names ================== - By default, `make install' will install the package's files in +By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. +option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. +give `configure' the option `--exec-prefix=PREFIX', the package will +use PREFIX as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular +options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. @@ -122,7 +125,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= - Some packages pay attention to `--enable-FEATURE' options to +Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The @@ -137,11 +140,11 @@ you can use the `configure' options `--x-includes=DIR' and Specifying the System Type ========================== - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: @@ -167,9 +170,9 @@ eventually be run) with `--host=TYPE'. Sharing Defaults ================ - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. @@ -178,7 +181,7 @@ A warning: not all `configure' scripts look for a site script. Defining Variables ================== - Variables not defined in a site shell script can be set in the +Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set @@ -186,14 +189,18 @@ them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== - `configure' recognizes the following options to control how it -operates. +`configure' recognizes the following options to control how it operates. `--help' `-h' diff --git a/Makefile.am b/Makefile.am index 0585ddd3..0010ae58 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,3 @@ -# -# $Id$ -# SUBDIRS = include src diff --git a/README b/README index 4acffe33..4a4ca420 100644 --- a/README +++ b/README @@ -1,4 +1,5 @@ BlueZ - Bluetooth protocol stack for Linux +****************************************** Copyright (C) 2000-2001 Qualcomm Incorporated Copyright (C) 2002-2003 Maxim Krasnyansky @@ -7,7 +8,8 @@ Copyright (C) 2002-2005 Marcel Holtmann Bluetooth libraries -1. Compilation and installation +Compilation and installation +============================ In order to compile Bluetooth libraries you need following software packages: - Linux Bluetooth protocol stack (BlueZ) @@ -19,10 +21,11 @@ To configure run: Configure automatically searches for all required components and packages. To compile and install run: - make install + make && make install -2. Information +Information +=========== Mailing lists: bluez-users@lists.sf.net - BlueZ general questions and discussions diff --git a/acinclude.m4 b/acinclude.m4 index 92cde650..f450f9ad 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,7 +1,3 @@ -dnl -dnl $Id$ -dnl - AC_DEFUN([AC_PROG_CC_PIE], [ AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [ echo 'void f(){}' > conftest.c @@ -15,7 +11,7 @@ AC_DEFUN([AC_PROG_CC_PIE], [ ]) AC_DEFUN([AC_INIT_BLUEZ], [ - AC_PREFIX_DEFAULT(/usr) + AC_PREFIX_DEFAULT(/usr/local) if (test "${CFLAGS}" = ""); then CFLAGS="-Wall -O2" diff --git a/bluez.m4 b/bluez.m4 index c432a2fa..0257a3f6 100644 --- a/bluez.m4 +++ b/bluez.m4 @@ -1,7 +1,3 @@ -dnl -dnl $Id$ -dnl - AC_DEFUN([AM_PATH_BLUEZ], [ if (test "${prefix}" = "NONE"); then bluez_prefix=${ac_default_prefix} diff --git a/bootstrap-configure b/bootstrap-configure index 2545c770..b10a98e0 100755 --- a/bootstrap-configure +++ b/bootstrap-configure @@ -1,5 +1,9 @@ #!/bin/sh +if [ -f config.status ]; then + make maintainer-clean +fi + ./bootstrap && \ ./configure --enable-maintainer-mode \ --enable-debug \ diff --git a/configure.in b/configure.in index cfad2c1b..b7e0787c 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,3 @@ -dnl -dnl $Id$ -dnl - AC_PREREQ(2.50) AC_INIT() diff --git a/include/Makefile.am b/include/Makefile.am index ab67cf59..992e987b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,6 +1,3 @@ -# -# $Id$ -# includedir = @includedir@/bluetooth diff --git a/include/bluetooth.h b/include/bluetooth.h index b5d056df..8ced1024 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __BLUETOOTH_H diff --git a/include/bnep.h b/include/bnep.h index 88b922bc..612d127d 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -7,24 +7,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __BNEP_H diff --git a/include/cmtp.h b/include/cmtp.h index ae987da0..0dbce775 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -6,24 +6,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __CMTP_H diff --git a/include/hci.h b/include/hci.h index d12232d8..0ddebd82 100644 --- a/include/hci.h +++ b/include/hci.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __HCI_H diff --git a/include/hci_lib.h b/include/hci_lib.h index 03305547..66a22e7e 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __HCI_LIB_H diff --git a/include/hidp.h b/include/hidp.h index e485eeea..d040d6d5 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -6,24 +6,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __HIDP_H diff --git a/include/l2cap.h b/include/l2cap.h index ae88c7a0..616ae75e 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __L2CAP_H diff --git a/include/rfcomm.h b/include/rfcomm.h index 8a1d56e9..3c9e0eb2 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -7,24 +7,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __RFCOMM_H diff --git a/include/sco.h b/include/sco.h index d07b0153..dfcbe54c 100644 --- a/include/sco.h +++ b/include/sco.h @@ -7,24 +7,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __SCO_H diff --git a/include/sdp.h b/include/sdp.h index c622e177..bd8e065c 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -9,24 +9,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __SDP_H diff --git a/include/sdp_lib.h b/include/sdp_lib.h index b9fbf6f3..57b5b15f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -9,24 +9,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifndef __SDP_LIB_H diff --git a/src/Makefile.am b/src/Makefile.am index 8da234ae..09544baf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,3 @@ -# -# $Id$ -# lib_LTLIBRARIES = libbluetooth.la diff --git a/src/bluetooth.c b/src/bluetooth.c index 36f186c5..5b468285 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifdef HAVE_CONFIG_H diff --git a/src/hci.c b/src/hci.c index 80813ad6..eeb171a1 100644 --- a/src/hci.c +++ b/src/hci.c @@ -8,24 +8,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifdef HAVE_CONFIG_H diff --git a/src/sdp.c b/src/sdp.c index e0df7582..57da1df9 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -9,24 +9,19 @@ * * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation; + * 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. * - * 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 OF THIRD PARTY RIGHTS. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY - * CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * 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. * - * ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, - * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS - * SOFTWARE IS DISCLAIMED. + * 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 * - * - * $Id$ */ #ifdef HAVE_CONFIG_H -- cgit From e36da2e02f410298e5ecc0238c439e659b861c2a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Oct 2005 16:27:56 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 09544baf..dcb2cb91 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:21:0 +libbluetooth_la_LDFLAGS = -version-info 1:22:0 INCLUDES = -I$(top_builddir)/include -- cgit From 96d225b71e83cf4f958afa56e87312d67f5a1118 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Oct 2005 16:30:17 +0000 Subject: Update changelog and bump version number --- ChangeLog | 6 ++++++ configure.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fe45974c..6a01d60c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 2.22: + Decode reserved LMP feature bits. + Fix errno overwrite problems. + Fix profile descriptor problem with Samsung phones. + Add compile time buffer checks (FORTIFY SOURCE). + ver 2.21: Add support for identification of supported commands. Add missing OCF declarations for the security filter. diff --git a/configure.in b/configure.in index b7e0787c..4b58dbf9 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.21) +AM_INIT_AUTOMAKE(bluez-libs, 2.22) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From a097798c889cef47144b3cce2118c5d9e914864c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 2 Nov 2005 13:19:55 +0000 Subject: Remove decoding of flow control feature bits --- src/hci.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/hci.c b/src/hci.c index eeb171a1..d21ef274 100644 --- a/src/hci.c +++ b/src/hci.c @@ -551,9 +551,6 @@ static hci_map lmp_features_map[8][9] = { { "", LMP_PSCHEME }, /* Bit 1 */ { "", LMP_PCONTROL }, /* Bit 2 */ { "", LMP_TRSP_SCO }, /* Bit 3 */ - { "",LMP_BCAST_ENC }, /* Bit 7 */ { NULL } }, -- cgit From 7575a227c3ad282247c288fa8def69d9dcd7603f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Nov 2005 10:26:56 +0000 Subject: Add constants for sniff subrating --- include/hci.h | 1 + src/hci.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 0ddebd82..e1790cce 100644 --- a/include/hci.h +++ b/include/hci.h @@ -243,6 +243,7 @@ enum { #define LMP_EDR_3SLOT 0x80 #define LMP_EDR_5SLOT 0x01 +#define LMP_SNIFF_SUBR 0x02 #define LMP_AFH_CAP_MST 0x08 #define LMP_AFH_CLS_MST 0x10 #define LMP_EDR_ESCO_2M 0x20 diff --git a/src/hci.c b/src/hci.c index d21ef274..a70fba9b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -444,6 +444,9 @@ static hci_map commands_map[] = { { "Reserved", 135 }, { "Read Extended Inquiry Response", 136 }, { "Write Extended Inquiry Response", 137 }, + { "Unknown", 138 }, + { "Unknown", 139 }, + { "Sniff Subrate", 140 }, { NULL } }; @@ -578,7 +581,7 @@ static hci_map lmp_features_map[8][9] = { }, { /* Byte 5 */ { "<5-slot EDR ACL>", LMP_EDR_5SLOT }, /* Bit 0 */ - { "", 0x02 }, /* Bit 1 */ + { "", LMP_SNIFF_SUBR }, /* Bit 1 */ { "", 0x04 }, /* Bit 2 */ { "", LMP_AFH_CAP_MST }, /* Bit 3 */ { "",LMP_AFH_CLS_MST }, /* Bit 4 */ -- cgit From 232851e1acd3dddc763f1661d67a3c0256363366 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 Nov 2005 21:26:03 +0000 Subject: Add definitions for sniff subrate --- include/hci.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/hci.h b/include/hci.h index e1790cce..ec79bf3b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -575,6 +575,16 @@ typedef struct { #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F +#define OCF_SNIFF_SUBRATE 0x0011 +typedef struct { + uint16_t handle; + uint16_t max_remote_latency; + uint16_t max_local_latency; + uint16_t min_remote_timeout; + uint16_t min_local_timeout; +} __attribute__ ((packed)) sniff_subrate_cp; +#define SNIFF_SUBRATE_CP_SIZE 10 + /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 @@ -1365,6 +1375,17 @@ typedef struct { } __attribute__ ((packed)) evt_sync_conn_changed; #define EVT_SYNC_CONN_CHANGED_SIZE 9 +#define EVT_SNIFF_SUBRATE 0x2E +typedef struct { + uint8_t status; + uint16_t handle; + uint16_t max_remote_latency; + uint16_t max_local_latency; + uint16_t min_remote_timeout; + uint16_t min_local_timeout; +} __attribute__ ((packed)) evt_sniff_subrate; +#define EVT_SNIFF_SUBRATE_SIZE 11 + #define EVT_EXTENDED_INQUIRY_RESULT 0x2F typedef struct { bdaddr_t bdaddr; -- cgit From 8db4e616c0107df21e3cacd981d073a64414de77 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 24 Nov 2005 04:19:49 +0000 Subject: Fix service discovery deadlocks with Samsung D600 phones --- src/sdp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdp.c b/src/sdp.c index 57da1df9..67a20008 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3115,6 +3115,10 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search status = -1; goto end; } + if (!recsize) { + sdp_record_free(rec); + break; + } scanned += recsize; pdata += recsize; -- cgit From 641d636fb24fb0dea567388a4f0d0f135d4ea48c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Dec 2005 09:12:44 +0000 Subject: Add support for allocation of binary text elements --- include/sdp_lib.h | 2 + src/sdp.c | 110 +++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 91 insertions(+), 21 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 57b5b15f..a45f36ef 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -102,10 +102,12 @@ int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attr, char *value, int * Basic sdp data functions */ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value); +sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t length); void sdp_data_free(sdp_data_t *data); sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attr_id); sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len); +sdp_data_t *sdp_seq_alloc_with_length(void **dtds, void **values, int *length, int len); sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *data); int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *data); diff --git a/src/sdp.c b/src/sdp.c index 67a20008..9f3f79e1 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -344,10 +344,9 @@ void sdp_uuid_print(const uuid_t *uuid) } #endif -sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) +sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t length) { sdp_data_t *seq; - int len = 0; sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); if (!d) @@ -414,21 +413,25 @@ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) d->unitSize += sizeof(uint128_t); break; case SDP_URL_STR8: - case SDP_TEXT_STR8: case SDP_URL_STR16: + case SDP_TEXT_STR8: case SDP_TEXT_STR16: - if (!value) - goto out_error; + if (!value) { + free(d); + return NULL; + } + + d->unitSize += length; + if (length <= USHRT_MAX) { + d->val.str = malloc(length); + if (!d->val.str) { + free(d); + return NULL; + } - len = strlen(value); - d->unitSize += len; - if (len <= USHRT_MAX) { - d->val.str = (char *) malloc(len + 1); - if (!d->val.str) - goto out_error; + memcpy(d->val.str, value, length); - strcpy(d->val.str, value); - if (len <= UCHAR_MAX) { + if (length <= UCHAR_MAX) { d->unitSize += sizeof(uint8_t); if (dtd != SDP_URL_STR8 && dtd != SDP_TEXT_STR8) { if (dtd == SDP_URL_STR16) @@ -445,7 +448,8 @@ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) } } else { SDPERR("Strings of size > USHRT_MAX not supported\n"); - goto out_error; + free(d); + d = NULL; } break; case SDP_URL_STR32: @@ -470,13 +474,33 @@ sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) d->unitSize += seq->unitSize; break; default: - goto out_error; + free(d); + d = NULL; } + return d; +} -out_error: - free(d); - return NULL; +sdp_data_t *sdp_data_alloc(uint8_t dtd, const void *value) +{ + uint32_t length; + + switch (dtd) { + case SDP_URL_STR8: + case SDP_URL_STR16: + case SDP_TEXT_STR8: + case SDP_TEXT_STR16: + if (!value) + return NULL; + + length = strlen((char *) value); + break; + default: + length = 0; + break; + } + + return sdp_data_alloc_with_length(dtd, value, length); } sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *d) @@ -491,6 +515,34 @@ sdp_data_t *sdp_seq_append(sdp_data_t *seq, sdp_data_t *d) return seq; } +sdp_data_t *sdp_seq_alloc_with_length(void **dtds, void **values, int *length, int len) +{ + sdp_data_t *curr = NULL, *seq = NULL; + int i; + + for (i = 0; i < len; i++) { + sdp_data_t *data; + int8_t dtd = *(uint8_t *) dtds[i]; + + if (dtd >= SDP_SEQ8 && dtd <= SDP_ALT32) + data = (sdp_data_t *) values[i]; + else + data = sdp_data_alloc_with_length(dtd, values[i], length[i]); + + if (!data) + return NULL; + + if (curr) + curr->next = data; + else + seq = data; + + curr = data; + } + + return sdp_data_alloc_with_length(SDP_SEQ8, seq, length[i]); +} + sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len) { sdp_data_t *curr = NULL, *seq = NULL; @@ -498,19 +550,24 @@ sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len) for (i = 0; i < len; i++) { sdp_data_t *data; - uint8_t dtd = *(uint8_t *)dtds[i]; + uint8_t dtd = *(uint8_t *) dtds[i]; + if (dtd >= SDP_SEQ8 && dtd <= SDP_ALT32) - data = (sdp_data_t *)values[i]; + data = (sdp_data_t *) values[i]; else data = sdp_data_alloc(dtd, values[i]); + if (!data) return NULL; + if (curr) curr->next = data; else seq = data; + curr = data; } + return sdp_data_alloc(SDP_SEQ8, seq); } @@ -565,6 +622,7 @@ int sdp_set_data_type(sdp_buf_t *buf, uint8_t dtd) *p++ = dtd; buf->data_size += sizeof(uint8_t); + switch (dtd) { case SDP_SEQ8: case SDP_TEXT_STR8: @@ -585,6 +643,7 @@ int sdp_set_data_type(sdp_buf_t *buf, uint8_t dtd) buf->data_size += sizeof(uint32_t); break; } + return buf->data_size - orig; } @@ -607,6 +666,7 @@ static int get_data_size(sdp_buf_t *buf, sdp_data_t *sdpdata) for (d = sdpdata->val.dataseq; d; d = d->next) n += sdp_gen_pdu(buf, d); + return n; } @@ -622,6 +682,7 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) uint8_t *seqp = buf->data + buf->data_size; pdu_size = sdp_set_data_type(buf, dtd); + switch (dtd) { case SDP_DATA_NIL: break; @@ -675,9 +736,13 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) data_size = sizeof(uint128_t); break; case SDP_TEXT_STR8: - case SDP_URL_STR8: case SDP_TEXT_STR16: case SDP_TEXT_STR32: + src = (unsigned char *)d->val.str; + data_size = d->unitSize - sizeof(uint8_t); + sdp_set_seq_len(seqp, data_size); + break; + case SDP_URL_STR8: case SDP_URL_STR16: case SDP_URL_STR32: src = (unsigned char *)d->val.str; @@ -715,6 +780,7 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) default: break; } + if (!is_seq && !is_alt) { if (src && buf) { memcpy(buf->data + buf->data_size, src, data_size); @@ -722,7 +788,9 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) } else if (dtd != SDP_DATA_NIL) SDPDBG("Gen PDU : Cant copy from NULL source or dest\n"); } + pdu_size += data_size; + return pdu_size; } -- cgit From 73fa16fccbb85592973068a25949d4c331f7f475 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Dec 2005 09:39:16 +0000 Subject: Add FD_ZERO() before usage of FD_SET() --- src/sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 9f3f79e1..90bc447e 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1269,9 +1269,10 @@ int sdp_read_rsp(sdp_session_t *session, uint8_t *buf, uint32_t size) fd_set readFds; struct timeval timeout = { SDP_RESPONSE_TIMEOUT, 0 }; + FD_ZERO(&readFds); FD_SET(session->sock, &readFds); SDPDBG("Waiting for response\n"); - if (0 == select(session->sock + 1, &readFds, NULL, NULL, &timeout)) { + if (select(session->sock + 1, &readFds, NULL, NULL, &timeout) == 0) { SDPERR("Client timed out\n"); errno = ETIMEDOUT; return -1; -- cgit From 72c29d4475b8b5f06eb0e518797e014837101cb5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 10 Dec 2005 13:55:34 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index dcb2cb91..c6df14f6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:22:0 +libbluetooth_la_LDFLAGS = -version-info 1:23:0 INCLUDES = -I$(top_builddir)/include -- cgit From e23d63311f8cbbb2fb978f7a70598d785de2d83f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 10 Dec 2005 13:58:02 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6a01d60c..f1131bcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 2.23: + Add constants and definitions for sniff subrating. + Add support for allocation of binary text elements. + Fix service discovery deadlocks with Samsung D600 phones. + ver 2.22: Decode reserved LMP feature bits. Fix errno overwrite problems. diff --git a/configure.in b/configure.in index 4b58dbf9..d89714b6 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.22) +AM_INIT_AUTOMAKE(bluez-libs, 2.23) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From aa8d087a052ab9c54dde1b0ddaf3a47494ef899a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 14 Dec 2005 10:11:26 +0000 Subject: Add support for additional access protocols --- include/sdp_lib.h | 7 ++++++- src/sdp.c | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index a45f36ef..7f22451e 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -175,6 +175,11 @@ static inline int sdp_set_browse_groups(sdp_record_t *rec, sdp_list_t *seq) */ int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *proto); +/* + * Set the additional access protocols of the record to those specified in proto + */ +int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *proto); + /* * Get protocol port (i.e. PSM for L2CAP, Channel for RFCOMM) */ @@ -457,7 +462,7 @@ int sdp_get_access_protos(const sdp_record_t *rec, sdp_list_t **protos); /* * Get the additional access protocols from the service record */ -int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **pap); +int sdp_get_add_access_protos(const sdp_record_t *rec, sdp_list_t **protos); /* * Extract the list of browse groups to which the service belongs. diff --git a/src/sdp.c b/src/sdp.c index 90bc447e..28c08679 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1812,13 +1812,31 @@ static sdp_data_t *access_proto_to_dataseq(sdp_record_t *rec, sdp_list_t *proto) int sdp_set_access_protos(sdp_record_t *rec, const sdp_list_t *ap) { const sdp_list_t *p; - sdp_data_t *protos = 0; + sdp_data_t *protos = NULL; for (p = ap; p; p = p->next) { - sdp_data_t *seq = access_proto_to_dataseq(rec, (sdp_list_t *)p->data); + sdp_data_t *seq = access_proto_to_dataseq(rec, (sdp_list_t *) p->data); protos = sdp_seq_append(protos, seq); } + sdp_attr_add(rec, SDP_ATTR_PROTO_DESC_LIST, protos); + + return 0; +} + +int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *ap) +{ + const sdp_list_t *p; + sdp_data_t *protos = NULL; + + for (p = ap; p; p = p->next) { + sdp_data_t *seq = access_proto_to_dataseq(rec, (sdp_list_t *) p->data); + protos = sdp_seq_append(protos, seq); + } + + sdp_attr_add(rec, SDP_ATTR_ADD_PROTO_DESC_LIST, + protos ? sdp_data_alloc(SDP_SEQ8, protos) : NULL); + return 0; } -- cgit From 5ccf1c4a96dfde5dc04c136644448483b648c186 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 24 Dec 2005 16:46:53 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index c6df14f6..8bfc37d8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:23:0 +libbluetooth_la_LDFLAGS = -version-info 1:24:0 INCLUDES = -I$(top_builddir)/include -- cgit From 743f3be8a09b86cd5797b426c7ffb69957bc2337 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 24 Dec 2005 16:55:15 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f1131bcb..81ba61ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 2.24: + Add support for additional access protocols. + ver 2.23: Add constants and definitions for sniff subrating. Add support for allocation of binary text elements. diff --git a/configure.in b/configure.in index d89714b6..23f3c22e 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.23) +AM_INIT_AUTOMAKE(bluez-libs, 2.24) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From a1b96c15eb685081c9329531906d18fce8405af7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 3 Jan 2006 09:56:12 +0000 Subject: Include sys/uio.h for writev() function --- src/hci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hci.c b/src/hci.c index a70fba9b..8dd3e1c6 100644 --- a/src/hci.c +++ b/src/hci.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include -- cgit From 197a2aee34d9a1643cd474f8f167552ca6395d01 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 3 Jan 2006 12:56:09 +0000 Subject: Update copyright information --- README | 2 +- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- src/bluetooth.c | 2 +- src/hci.c | 2 +- src/sdp.c | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README b/README index 4a4ca420..ad1b80b8 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated Copyright (C) 2002-2003 Maxim Krasnyansky -Copyright (C) 2002-2005 Marcel Holtmann +Copyright (C) 2002-2006 Marcel Holtmann Bluetooth libraries diff --git a/include/bluetooth.h b/include/bluetooth.h index 8ced1024..2ad82a7d 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 612d127d..13f10015 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index 0dbce775..72bd7e13 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index ec79bf3b..0547f568 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index 66a22e7e..20af8bdb 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index d040d6d5..71d0150a 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2005 Marcel Holtmann + * Copyright (C) 2003-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index 616ae75e..d2320f46 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index 3c9e0eb2..7537f958 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index dfcbe54c..4777640c 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index bd8e065c..c0e468d3 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 7f22451e..dc074c6a 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/src/bluetooth.c b/src/bluetooth.c index 5b468285..1482a56e 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/hci.c b/src/hci.c index 8dd3e1c6..6a33d3c4 100644 --- a/src/hci.c +++ b/src/hci.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/sdp.c b/src/sdp.c index 28c08679..da83c23e 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2005 Marcel Holtmann + * Copyright (C) 2002-2006 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From 42e0ce5b430ac5e36c0d21bdddcaf1fe83e025f5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 4 Jan 2006 00:04:30 +0000 Subject: Add definitions for Apple Agent --- include/sdp.h | 2 ++ src/sdp.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index c0e468d3..7ff74979 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -137,6 +137,7 @@ extern "C" { #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 #define VIDEO_DISTRIBUTION_SVCLASS_ID 0x1305 +#define APPLE_AGENT_SVCLASS_ID 0x2112 /* * Standard profile descriptor identifiers; note these @@ -204,6 +205,7 @@ extern "C" { #define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID #define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID #define VIDEO_DISTRIBUTION_PROFILE_ID VIDEO_DISTRIBUTION_SVCLASS_ID +#define APPLE_AGENT_PROFILE_ID APPLE_AGENT_SVCLASS_ID /* * Attribute identifier codes diff --git a/src/sdp.c b/src/sdp.c index da83c23e..0421e699 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -190,6 +190,7 @@ static struct tupla ServiceClass[] = { { VIDEO_SOURCE_SVCLASS_ID, "Video Source" }, { VIDEO_SINK_SVCLASS_ID, "Video Sink" }, { VIDEO_DISTRIBUTION_SVCLASS_ID, "Video Distribution" }, + { APPLE_AGENT_SVCLASS_ID, "Apple Agent" }, { 0 } }; -- cgit From 49fe626b5c153e4bc6a174982a89e9b3b2e4baf2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 17 Jan 2006 10:39:37 +0000 Subject: Add support for setting the record handle on service registration --- src/sdp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sdp.c b/src/sdp.c index 0421e699..2510ccf3 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2411,6 +2411,11 @@ int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_rec errno = ENOMEM; goto end; } + if (rec->handle && rec->handle != 0xffffffff) { + uint32_t handle = rec->handle; + sdp_data_t *data = sdp_data_alloc(SDP_UINT32, &handle); + sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, data); + } reqhdr = (sdp_pdu_hdr_t *)req; reqhdr->pdu_id = SDP_SVC_REGISTER_REQ; reqhdr->tid = htons(sdp_gen_tid(session)); -- cgit From 12ee1dcf6933f6096f9763aee5dafeccf71ff2de Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 17 Jan 2006 23:10:01 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 8bfc37d8..61ef2fb1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:24:0 +libbluetooth_la_LDFLAGS = -version-info 1:25:0 INCLUDES = -I$(top_builddir)/include -- cgit From 1ea821775112f99d57680e9d96930ea100131b24 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 17 Jan 2006 23:11:51 +0000 Subject: Update changelog and bump version number --- ChangeLog | 4 ++++ configure.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 81ba61ca..fc5d2785 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +ver 2.25: + Add definitions for Apple Agent. + Add support for record handle on service registration. + ver 2.24: Add support for additional access protocols. diff --git a/configure.in b/configure.in index 23f3c22e..13780777 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.24) +AM_INIT_AUTOMAKE(bluez-libs, 2.25) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 1ba3b0978c73153513cfe016435e1e930038fbd4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Feb 2006 07:48:11 +0000 Subject: Add features bit for pause encryption --- include/hci.h | 1 + src/hci.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 0547f568..312fa27d 100644 --- a/include/hci.h +++ b/include/hci.h @@ -244,6 +244,7 @@ enum { #define LMP_EDR_5SLOT 0x01 #define LMP_SNIFF_SUBR 0x02 +#define LMP_PAUSE_ENC 0x04 #define LMP_AFH_CAP_MST 0x08 #define LMP_AFH_CLS_MST 0x10 #define LMP_EDR_ESCO_2M 0x20 diff --git a/src/hci.c b/src/hci.c index 6a33d3c4..9e81653c 100644 --- a/src/hci.c +++ b/src/hci.c @@ -583,7 +583,7 @@ static hci_map lmp_features_map[8][9] = { { /* Byte 5 */ { "<5-slot EDR ACL>", LMP_EDR_5SLOT }, /* Bit 0 */ { "", LMP_SNIFF_SUBR }, /* Bit 1 */ - { "", 0x04 }, /* Bit 2 */ + { "", LMP_PAUSE_ENC }, /* Bit 2 */ { "", LMP_AFH_CAP_MST }, /* Bit 3 */ { "",LMP_AFH_CLS_MST }, /* Bit 4 */ { "", LMP_EDR_ESCO_2M }, /* Bit 5 */ -- cgit From 93048c3a1a3f8a86d8f5be1bd3409f77e9802d6e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 14 Mar 2006 18:25:35 +0000 Subject: Fix broken behavior with EVT_CMD_STATUS --- src/hci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hci.c b/src/hci.c index 9e81653c..d0c2394c 100644 --- a/src/hci.c +++ b/src/hci.c @@ -977,13 +977,13 @@ int hci_send_req(int dd, struct hci_request *r, int to) if (cs->opcode != opcode) continue; - if (cs->status) { - errno = EIO; - goto failed; - } - - if (r->event != EVT_CMD_STATUS) + if (r->event != EVT_CMD_STATUS) { + if (cs->status) { + errno = EIO; + goto failed; + } break; + } r->rlen = MIN(len, r->rlen); memcpy(r->rparam, ptr, r->rlen); -- cgit From 630e9b79dee2c26759fb8650444cb113714bba0d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 12 Apr 2006 09:23:00 +0000 Subject: Add additional EIR error code --- include/hci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hci.h b/include/hci.h index 312fa27d..435ea6a1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -192,6 +192,7 @@ enum { #define HCI_ROLE_SWITCH_PENDING 0x32 #define HCI_SLOT_VIOLATION 0x34 #define HCI_ROLE_SWITCH_FAILED 0x35 +#define HCI_EIR_TOO_LARGE 0x36 /* ACL flags */ #define ACL_CONT 0x01 -- cgit From fd920beb236c034c779de5ccf4a5d050897d40bc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 16 Apr 2006 19:32:38 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 1482a56e..75888730 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -376,6 +376,8 @@ char *bt_compidtostr(int compid) return "Bluetooth SIG, Inc"; case 64: return "Seiko Epson Corporation"; + case 65: + return "Integrated Silicon Solution Taiwain, Inc."; case 65535: return "internal use"; default: -- cgit From 07e291d7269885187586106e059f29abb336cb27 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 25 Apr 2006 15:55:51 +0000 Subject: Add missing memset() for socket address --- src/hci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hci.c b/src/hci.c index d0c2394c..35aa9059 100644 --- a/src/hci.c +++ b/src/hci.c @@ -856,6 +856,7 @@ int hci_open_dev(int dev_id) return dd; /* Bind socket to the HCI device */ + memset(&a, 0, sizeof(a)); a.hci_family = AF_BLUETOOTH; a.hci_dev = dev_id; if (bind(dd, (struct sockaddr *) &a, sizeof(a)) < 0) -- cgit From 1b64c76ef66c10500f575240bd214c7b38b68a1f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 30 May 2006 10:51:54 +0000 Subject: Add two new company identifiers --- src/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 75888730..9df142a0 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -378,6 +378,10 @@ char *bt_compidtostr(int compid) return "Seiko Epson Corporation"; case 65: return "Integrated Silicon Solution Taiwain, Inc."; + case 66: + return "CONWISE Technology Corporation Ltd"; + case 67: + return "PARROT SA"; case 65535: return "internal use"; default: -- cgit From 73f2fe893f6801358ea4fb88dc8d24050c7d0ca5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 30 May 2006 10:58:30 +0000 Subject: Add another Phonebook Access identifier --- include/sdp.h | 6 ++++-- src/sdp.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 7ff74979..200a6b0e 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -124,6 +124,7 @@ extern "C" { #define SAP_SVCLASS_ID 0x112d #define PBAP_PCE_SVCLASS_ID 0x112e #define PBAP_PSE_SVCLASS_ID 0x112f +#define PBAP_SVCLASS_ID 0x1130 #define PNP_INFO_SVCLASS_ID 0x1200 #define GENERIC_NETWORKING_SVCLASS_ID 0x1201 #define GENERIC_FILETRANS_SVCLASS_ID 0x1202 @@ -190,8 +191,9 @@ extern "C" { #define UDI_TA_PROFILE_ID UDI_TA_SVCLASS_ID #define AV_PROFILE_ID AV_SVCLASS_ID #define SAP_PROFILE_ID SAP_SVCLASS_ID -#define PBAP_PCE_PROFILE_ID PBAP_PCE_PROFILE_ID -#define PBAP_PSE_PROFILE_ID PBAP_PSE_PROFILE_ID +#define PBAP_PCE_PROFILE_ID PBAP_PCE_SVCLASS_ID +#define PBAP_PSE_PROFILE_ID PBAP_PSE_SVCLASS_ID +#define PBAP_PROFILE_ID PBAP_SVCLASS_ID #define PNP_INFO_PROFILE_ID PNP_INFO_SVCLASS_ID #define GENERIC_NETWORKING_PROFILE_ID GENERIC_NETWORKING_SVCLASS_ID #define GENERIC_FILETRANS_PROFILE_ID GENERIC_FILETRANS_SVCLASS_ID diff --git a/src/sdp.c b/src/sdp.c index 2510ccf3..58f7b269 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -177,6 +177,7 @@ static struct tupla ServiceClass[] = { { SAP_SVCLASS_ID, "SIM Access" }, { PBAP_PCE_SVCLASS_ID, "Phonebook Access - PCE" }, { PBAP_PSE_SVCLASS_ID, "Phonebook Access - PSE" }, + { PBAP_SVCLASS_ID, "Phonebook Access" }, { PNP_INFO_SVCLASS_ID, "PnP Information" }, { GENERIC_NETWORKING_SVCLASS_ID, "Generic Networking" }, { GENERIC_FILETRANS_SVCLASS_ID, "Generic File Transfer" }, -- cgit From 26167e5ea69ab1707a94e1c262ac58711cbd6a9a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 May 2006 15:17:07 +0000 Subject: Update sniff subrating data structures --- include/hci.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/hci.h b/include/hci.h index 435ea6a1..117328d8 100644 --- a/include/hci.h +++ b/include/hci.h @@ -580,8 +580,7 @@ typedef struct { #define OCF_SNIFF_SUBRATE 0x0011 typedef struct { uint16_t handle; - uint16_t max_remote_latency; - uint16_t max_local_latency; + uint16_t max_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; } __attribute__ ((packed)) sniff_subrate_cp; @@ -1381,8 +1380,8 @@ typedef struct { typedef struct { uint8_t status; uint16_t handle; - uint16_t max_remote_latency; - uint16_t max_local_latency; + uint16_t max_tx_latency; + uint16_t max_rx_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; } __attribute__ ((packed)) evt_sniff_subrate; -- cgit From 3fcf56f2a27bcd08dfecbdbe65820e385491ed42 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 May 2006 15:42:39 +0000 Subject: Fix sniff subrate command size --- include/hci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 117328d8..becbbb06 100644 --- a/include/hci.h +++ b/include/hci.h @@ -584,7 +584,7 @@ typedef struct { uint16_t min_remote_timeout; uint16_t min_local_timeout; } __attribute__ ((packed)) sniff_subrate_cp; -#define SNIFF_SUBRATE_CP_SIZE 10 +#define SNIFF_SUBRATE_CP_SIZE 8 /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 -- cgit From 31530898cb8cba0952a1af0bfe8fd26806c7b075 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jun 2006 15:41:44 +0000 Subject: Fix uninitialised value error --- src/hci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hci.c b/src/hci.c index 35aa9059..d5d7124f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -762,6 +762,8 @@ int hci_devba(int dev_id, bdaddr_t *bdaddr) { struct hci_dev_info di; + memset(&di, 0, sizeof(di)); + if (hci_devinfo(dev_id, &di)) return -1; -- cgit From 1b9e5873f730b50987c494c7397b40ac614ba62d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jun 2006 15:45:08 +0000 Subject: Fix sdp_gen_pdu data_size computation --- src/sdp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sdp.c b/src/sdp.c index 58f7b269..abefca98 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -742,6 +742,10 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) case SDP_TEXT_STR32: src = (unsigned char *)d->val.str; data_size = d->unitSize - sizeof(uint8_t); + if (data_size - sizeof(uint8_t) <= UCHAR_MAX) + data_size -= sizeof(uint8_t); + else + data_size -= sizeof(uint16_t); sdp_set_seq_len(seqp, data_size); break; case SDP_URL_STR8: -- cgit From dcd9814735324f08d91a6a3d1eb7b2b31d2915a6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jun 2006 15:57:21 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 61ef2fb1..5f6b7129 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 1:25:0 +libbluetooth_la_LDFLAGS = -version-info 2:0:0 INCLUDES = -I$(top_builddir)/include -- cgit From be9f5bb2d5ec08fbc07d95a72b9c11b0ed51ead7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 9 Jun 2006 15:59:31 +0000 Subject: Update changelog and bump version number --- ChangeLog | 8 ++++++++ configure.in | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fc5d2785..a16ce3ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +ver 3.0: + Fix broken behavior with EVT_CMD_STATUS. + Add features bit for pause encryption. + Add additional EIR error code. + Add more company identifiers. + Add another Phonebook Access identifier. + Update sniff subrating data structures. + ver 2.25: Add definitions for Apple Agent. Add support for record handle on service registration. diff --git a/configure.in b/configure.in index 13780777..a92bff6f 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 2.25) +AM_INIT_AUTOMAKE(bluez-libs, 3.0) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 5ed11d784fcfa59254246bd401d4d1142bb5b9cb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 16 Jun 2006 09:00:30 +0000 Subject: Add missing placeholders for feature bits --- src/hci.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/hci.c b/src/hci.c index d5d7124f..977c60eb 100644 --- a/src/hci.c +++ b/src/hci.c @@ -593,9 +593,23 @@ static hci_map lmp_features_map[8][9] = { }, { /* Byte 6 */ { "", LMP_EXT_INQ }, /* Bit 0 */ + { "", 0x02 }, /* Bit 1 */ + { "", 0x04 }, /* Bit 2 */ + { "", 0x08 }, /* Bit 3 */ + { "", 0x10 }, /* Bit 4 */ + { "", 0x20 }, /* Bit 5 */ + { "", 0x40 }, /* Bit 6 */ + { "", 0x80 }, /* Bit 7 */ { NULL } }, { /* Byte 7 */ + { "", 0x01 }, /* Bit 1 */ + { "", 0x02 }, /* Bit 1 */ + { "", 0x04 }, /* Bit 2 */ + { "", 0x08 }, /* Bit 3 */ + { "", 0x10 }, /* Bit 4 */ + { "", 0x20 }, /* Bit 5 */ + { "", 0x40 }, /* Bit 6 */ { "",LMP_EXT_FEAT }, /* Bit 7 */ { NULL } }, -- cgit From bf73a154826860245f6af3f82c336c53e6286f20 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 17 Jun 2006 12:22:19 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a16ce3ec..22b192fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.1: + Add missing placeholders for feature bits. + ver 3.0: Fix broken behavior with EVT_CMD_STATUS. Add features bit for pause encryption. diff --git a/configure.in b/configure.in index a92bff6f..c4582c19 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.0) +AM_INIT_AUTOMAKE(bluez-libs, 3.1) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 5f6b7129..707bfd98 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 2:0:0 +libbluetooth_la_LDFLAGS = -version-info 2:1:0 INCLUDES = -I$(top_builddir)/include -- cgit From 0ed4f8572e1b32b4dd57304db14351f0e0c59119 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 26 Jun 2006 12:44:31 +0000 Subject: Fix handling of strings --- src/sdp.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index abefca98..fd743b60 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -432,22 +432,6 @@ sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t } memcpy(d->val.str, value, length); - - if (length <= UCHAR_MAX) { - d->unitSize += sizeof(uint8_t); - if (dtd != SDP_URL_STR8 && dtd != SDP_TEXT_STR8) { - if (dtd == SDP_URL_STR16) - dtd = SDP_URL_STR8; - else - dtd = SDP_TEXT_STR8; - } - } else { - d->unitSize += sizeof(uint16_t); - if (dtd == SDP_TEXT_STR8) - dtd = SDP_TEXT_STR16; - else - dtd = SDP_URL_STR16; - } } else { SDPERR("Strings of size > USHRT_MAX not supported\n"); free(d); @@ -742,10 +726,6 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) case SDP_TEXT_STR32: src = (unsigned char *)d->val.str; data_size = d->unitSize - sizeof(uint8_t); - if (data_size - sizeof(uint8_t) <= UCHAR_MAX) - data_size -= sizeof(uint8_t); - else - data_size -= sizeof(uint16_t); sdp_set_seq_len(seqp, data_size); break; case SDP_URL_STR8: @@ -973,7 +953,7 @@ static sdp_data_t *extract_str(const void *p, int *len) SDPDBG("Str : %s\n", s); d->val.str = s; - d->unitSize = n; + d->unitSize = n + sizeof(uint8_t); return d; } -- cgit From 39519245f25c517424d1f2ccbed07777c8e060fa Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 Jul 2006 11:45:21 +0000 Subject: Add adapter type for SDIO --- include/hci.h | 3 ++- src/hci.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/hci.h b/include/hci.h index becbbb06..4cd8c7d9 100644 --- a/include/hci.h +++ b/include/hci.h @@ -48,12 +48,13 @@ extern "C" { #define HCI_DEV_RESUME 6 /* HCI device types */ -#define HCI_VHCI 0 +#define HCI_VIRTUAL 0 #define HCI_USB 1 #define HCI_PCCARD 2 #define HCI_UART 3 #define HCI_RS232 4 #define HCI_PCI 5 +#define HCI_SDIO 6 /* HCI device flags */ enum { diff --git a/src/hci.c b/src/hci.c index 977c60eb..6fa61831 100644 --- a/src/hci.c +++ b/src/hci.c @@ -138,8 +138,8 @@ static int hci_str2uint(hci_map *map, char *str, unsigned int *val) char *hci_dtypetostr(int type) { switch (type) { - case HCI_VHCI: - return "VHCI"; + case HCI_VIRTUAL: + return "VIRTUAL"; case HCI_USB: return "USB"; case HCI_PCCARD: @@ -150,8 +150,10 @@ char *hci_dtypetostr(int type) return "RS232"; case HCI_PCI: return "PCI"; + case HCI_SDIO: + return "SDIO"; default: - return "UKNW"; + return "UNKNOWN"; } } -- cgit From 57834785d5445439c2abbc19903566f050bc98a2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 27 Jul 2006 01:23:04 +0000 Subject: Add features bit for link supervision timeout --- include/hci.h | 1 + src/hci.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hci.h b/include/hci.h index 4cd8c7d9..65480140 100644 --- a/include/hci.h +++ b/include/hci.h @@ -255,6 +255,7 @@ enum { #define LMP_EXT_INQ 0x01 +#define LMP_LSTO 0x01 #define LMP_EXT_FEAT 0x80 /* Link policies */ diff --git a/src/hci.c b/src/hci.c index 6fa61831..48989aae 100644 --- a/src/hci.c +++ b/src/hci.c @@ -605,7 +605,7 @@ static hci_map lmp_features_map[8][9] = { { NULL } }, { /* Byte 7 */ - { "", 0x01 }, /* Bit 1 */ + { "", LMP_LSTO }, /* Bit 1 */ { "", 0x02 }, /* Bit 1 */ { "", 0x04 }, /* Bit 2 */ { "", 0x08 }, /* Bit 3 */ -- cgit From 05909adb9c4d36adb8d95c14ab5d4aa6514edbe5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 27 Jul 2006 02:16:43 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22b192fa..2c562281 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 3.2 + Fix handling of SDP strings. + Add adapter type for SDIO cards. + Add features bit for link supervision timeout. + ver 3.1: Add missing placeholders for feature bits. diff --git a/configure.in b/configure.in index c4582c19..803a92e3 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.1) +AM_INIT_AUTOMAKE(bluez-libs, 3.2) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 707bfd98..8c4d613e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 2:1:0 +libbluetooth_la_LDFLAGS = -version-info 3:0:1 INCLUDES = -I$(top_builddir)/include -- cgit From 646fda930139720d7d9c45cc085ae4eb7018d8bb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Jul 2006 09:56:18 +0000 Subject: Add link supervision timeout change event --- include/hci.h | 11 +++++++++-- src/hci.c | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/hci.h b/include/hci.h index 65480140..329f2b3a 100644 --- a/include/hci.h +++ b/include/hci.h @@ -835,14 +835,14 @@ typedef struct { typedef struct { uint8_t status; uint16_t handle; - uint16_t link_sup_to; + uint16_t timeout; } __attribute__ ((packed)) read_link_supervision_timeout_rp; #define READ_LINK_SUPERVISION_TIMEOUT_RP_SIZE 5 #define OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037 typedef struct { uint16_t handle; - uint16_t link_sup_to; + uint16_t timeout; } __attribute__ ((packed)) write_link_supervision_timeout_cp; #define WRITE_LINK_SUPERVISION_TIMEOUT_CP_SIZE 4 typedef struct { @@ -1401,6 +1401,13 @@ typedef struct { } __attribute__ ((packed)) extended_inquiry_info; #define EXTENDED_INQUIRY_INFO_SIZE 254 +#define EVT_LINK_SUPERVISION_TIMEOUT 0x38 +typedef struct { + uint16_t handle; + uint16_t timeout; +} __attribute__ ((packed)) evt_link_supervision_timeout; +#define EVT_LINK_SUPERVISION_TIMEOUT_SIZE 4 + #define EVT_TESTING 0xFE #define EVT_VENDOR 0xFF diff --git a/src/hci.c b/src/hci.c index 48989aae..7135501b 100644 --- a/src/hci.c +++ b/src/hci.c @@ -2058,7 +2058,7 @@ int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout return -1; } - *timeout = rp.link_sup_to; + *timeout = rp.timeout; return 0; } @@ -2069,8 +2069,8 @@ int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout struct hci_request rq; memset(&cp, 0, sizeof(cp)); - cp.handle = handle; - cp.link_sup_to = timeout; + cp.handle = handle; + cp.timeout = timeout; memset(&rq, 0, sizeof(rq)); rq.ogf = OGF_HOST_CTL; -- cgit From 914617b58d2b68d1e3792a77fc5dd37f78d2037b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 31 Jul 2006 10:00:10 +0000 Subject: Remove kernel specific timeouts --- include/hci.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/hci.h b/include/hci.h index 329f2b3a..bccaf918 100644 --- a/include/hci.h +++ b/include/hci.h @@ -98,12 +98,6 @@ enum { #define HCIINQUIRY _IOR('H', 240, int) -/* HCI timeouts */ - -#define HCI_CONN_TIMEOUT (HZ * 40) -#define HCI_DISCONN_TIMEOUT (HZ * 2) -#define HCI_CONN_IDLE_TIMEOUT (HZ * 60) - #ifndef __NO_HCI_DEFS /* HCI Packet types */ -- cgit From 8f6ea7c3d24dc21f120b6d29fc975936b4d4f3b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 17 Aug 2006 21:59:25 +0000 Subject: Add additional private data field --- include/sdp.h | 23 ----------------------- include/sdp_lib.h | 38 ++++++++++++++++++++++++++------------ src/sdp.c | 10 ++++++++++ 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 200a6b0e..f6af1261 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -373,18 +373,6 @@ extern "C" { #define SDP_SVC_REMOVE_REQ 0x79 #define SDP_SVC_REMOVE_RSP 0x80 -/* - * Values of the flags parameter to sdp_record_register - */ -#define SDP_RECORD_PERSIST 0x01 -#define SDP_DEVICE_RECORD 0x02 - -/* - * Values of the flags parameter to sdp_connect - */ -#define SDP_RETRY_IF_BUSY 0x01 -#define SDP_WAIT_ON_CLOSE 0x02 - /* * SDP Error codes */ @@ -499,17 +487,6 @@ struct sdp_data_struct { int unitSize; }; -/* - * a session with an SDP server - */ -typedef struct { - int sock; - int state; - int local; - int flags; - uint16_t tid; // Current transaction ID -} sdp_session_t; - #ifdef __cplusplus } #endif diff --git a/include/sdp_lib.h b/include/sdp_lib.h index dc074c6a..8a89ab6e 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -69,6 +69,30 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u f(list->data, u); } +/* + * Values of the flags parameter to sdp_record_register + */ +#define SDP_RECORD_PERSIST 0x01 +#define SDP_DEVICE_RECORD 0x02 + +/* + * Values of the flags parameter to sdp_connect + */ +#define SDP_RETRY_IF_BUSY 0x01 +#define SDP_WAIT_ON_CLOSE 0x02 + +/* + * a session with an SDP server + */ +typedef struct { + int sock; + int state; + int local; + int flags; + uint16_t tid; // Current transaction ID + void *priv; +} sdp_session_t; + /* * create an L2CAP connection to a Bluetooth device * @@ -83,11 +107,9 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u */ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags); int sdp_close(sdp_session_t *session); +int sdp_get_socket(const sdp_session_t *session); -static inline int sdp_get_socket(const sdp_session_t *s) -{ - return s->sock; -} +uint16_t sdp_gen_tid(sdp_session_t *session); /* * find all devices in the piconet @@ -535,14 +557,6 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } -/* - * Generate unique transaction identifiers - */ -static inline uint16_t sdp_gen_tid(sdp_session_t *session) -{ - return session->tid++; -} - sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); sdp_data_t *sdp_extract_string(uint8_t *, int *); diff --git a/src/sdp.c b/src/sdp.c index fd743b60..edde4dbf 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3301,3 +3301,13 @@ fail: errno = err; return 0; } + +int sdp_get_socket(const sdp_session_t *session) +{ + return session->sock; +} + +uint16_t sdp_gen_tid(sdp_session_t *session) +{ + return session->tid++; +} -- cgit From 970449277631cd45ab369b64aa726e1ab7e3791d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 18 Aug 2006 19:41:53 +0000 Subject: Add --automake option --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index c838d5e2..91756f94 100755 --- a/bootstrap +++ b/bootstrap @@ -2,6 +2,6 @@ aclocal && \ autoheader && \ - libtoolize --copy --force && \ + libtoolize --automake --copy --force && \ automake --add-missing --copy && \ autoconf -- cgit From d57d189c75ba7ee813d943d228f6311fca00c5ce Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 20 Aug 2006 22:33:07 +0000 Subject: Rename link supervision timeout event --- include/hci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hci.h b/include/hci.h index bccaf918..6f67bbdf 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1395,11 +1395,11 @@ typedef struct { } __attribute__ ((packed)) extended_inquiry_info; #define EXTENDED_INQUIRY_INFO_SIZE 254 -#define EVT_LINK_SUPERVISION_TIMEOUT 0x38 +#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGE 0x38 typedef struct { uint16_t handle; uint16_t timeout; -} __attribute__ ((packed)) evt_link_supervision_timeout; +} __attribute__ ((packed)) evt_link_supervision_timeout_change; #define EVT_LINK_SUPERVISION_TIMEOUT_SIZE 4 #define EVT_TESTING 0xFE -- cgit From 99b4c49f0afb4bb3bc92bded8ed8ab59e67a440a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 21 Aug 2006 10:32:10 +0000 Subject: Initialize hci_dev_info memory to zero before calling ioctl --- src/hci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hci.c b/src/hci.c index 7135501b..caed69bf 100644 --- a/src/hci.c +++ b/src/hci.c @@ -764,6 +764,8 @@ int hci_devinfo(int dev_id, struct hci_dev_info *di) if (dd < 0) return dd; + memset(di, 0, sizeof(struct hci_dev_info)); + di->dev_id = dev_id; ret = ioctl(dd, HCIGETDEVINFO, (void *) di); -- cgit From 9b3d6f5cd180f037789e0b2af4656f55d6df2c0c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 21 Aug 2006 11:26:43 +0000 Subject: Initialize memory to zero in hci_for_each_dev --- src/hci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hci.c b/src/hci.c index caed69bf..dca4c096 100644 --- a/src/hci.c +++ b/src/hci.c @@ -680,6 +680,8 @@ int hci_for_each_dev(int flag, int (*func)(int dd, int dev_id, long arg), long a goto done; } + memset(dl, 0, HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl)); + dl->dev_num = HCI_MAX_DEV; dr = dl->dev_req; -- cgit From 99d09d338d4ab207b2d559d3516d9a642d1a5d30 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Aug 2006 12:36:49 +0000 Subject: Add OCF for setting host controller to host flow control --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hci.h b/include/hci.h index 6f67bbdf..ee25858e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -816,6 +816,8 @@ typedef struct { } __attribute__ ((packed)) read_transmit_power_level_rp; #define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 +#define OCF_SET_CONTROLLER_TO_HOST_FC 0x0031 + #define OCF_HOST_BUFFER_SIZE 0x0033 typedef struct { uint16_t acl_mtu; -- cgit From 0f9595e9d94cc878d159f1f63b377b839aaa1dca Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Aug 2006 12:46:43 +0000 Subject: Add OCF for host number of completed packets --- include/hci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hci.h b/include/hci.h index ee25858e..6cfef5c1 100644 --- a/include/hci.h +++ b/include/hci.h @@ -827,6 +827,8 @@ typedef struct { } __attribute__ ((packed)) host_buffer_size_cp; #define HOST_BUFFER_SIZE_CP_SIZE 7 +#define OCF_HOST_NUM_COMP_PKTS 0x0035 + #define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 typedef struct { uint8_t status; -- cgit From 6789dbbbe34d1c66b0338da061fa5cb877d04163 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Aug 2006 12:56:10 +0000 Subject: Add structure for host number of completed packets --- include/hci.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/hci.h b/include/hci.h index 6cfef5c1..0454f96e 100644 --- a/include/hci.h +++ b/include/hci.h @@ -828,6 +828,11 @@ typedef struct { #define HOST_BUFFER_SIZE_CP_SIZE 7 #define OCF_HOST_NUM_COMP_PKTS 0x0035 +typedef struct { + uint8_t num_hndl; + /* variable length part */ +} __attribute__ ((packed)) host_num_comp_pkts_cp; +#define HOST_NUM_COMP_PKTS_CP_SIZE 1 #define OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036 typedef struct { -- cgit From c1f630feca4f3fa9d172f27d00a68a2453d223b6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Aug 2006 04:03:00 +0000 Subject: Update library version --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 8c4d613e..74aca994 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 3:0:1 +libbluetooth_la_LDFLAGS = -version-info 4:0:2 INCLUDES = -I$(top_builddir)/include -- cgit From 1e5d92c257fb56ba0ade1ba010b875e816913c56 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 Aug 2006 04:08:22 +0000 Subject: Update changelog and bump version number --- ChangeLog | 9 ++++++++- configure.in | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c562281..be778865 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -ver 3.2 +ver 3.3: + Remove kernel specific timeouts. + Add additional private data field for SDP sessions. + Add host controller to host flow control defines. + Add host number of completed packets defines. + Initialize various memory to zero before usage. + +ver 3.2: Fix handling of SDP strings. Add adapter type for SDIO cards. Add features bit for link supervision timeout. diff --git a/configure.in b/configure.in index 803a92e3..c1cb853b 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.2) +AM_INIT_AUTOMAKE(bluez-libs, 3.3) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 21f2a5244f0c6195e17ff71868328bc71d77f4d9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 23 Aug 2006 15:05:30 +0000 Subject: Fix malloc() versus bt_malloc() usage --- src/hci.c | 8 ++++---- src/sdp.c | 32 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/hci.c b/src/hci.c index dca4c096..f7235f74 100644 --- a/src/hci.c +++ b/src/hci.c @@ -94,7 +94,7 @@ static int hci_str2bit(hci_map *map, char *str, unsigned int *val) static char *hci_uint2str(hci_map *m, unsigned int val) { - char *str = bt_malloc(50); + char *str = malloc(50); char *ptr = str; if (!str) @@ -174,7 +174,7 @@ static hci_map dev_flags_map[] = { char *hci_dflagstostr(uint32_t flags) { - char *str = malloc(50); + char *str = bt_malloc(50); char *ptr = str; hci_map *m = dev_flags_map; @@ -283,7 +283,7 @@ static hci_map link_mode_map[] = { char *hci_lmtostr(unsigned int lm) { - char *s, *str = malloc(50); + char *s, *str = bt_malloc(50); if (!str) return NULL; @@ -293,7 +293,7 @@ char *hci_lmtostr(unsigned int lm) s = hci_bit2str(link_mode_map, lm); if (!s) { - free(str); + bt_free(str); return NULL; } diff --git a/src/sdp.c b/src/sdp.c index edde4dbf..86caa15c 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -349,7 +349,7 @@ void sdp_uuid_print(const uuid_t *uuid) sdp_data_t *sdp_data_alloc_with_length(uint8_t dtd, const void *value, uint32_t length) { sdp_data_t *seq; - sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); + sdp_data_t *d = malloc(sizeof(sdp_data_t)); if (!d) return NULL; @@ -853,7 +853,7 @@ void sdp_data_free(sdp_data_t *d) static sdp_data_t *extract_int(const void *p, int *len) { - sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); + sdp_data_t *d = malloc(sizeof(sdp_data_t)); SDPDBG("Extracting integer\n"); memset(d, 0, sizeof(sdp_data_t)); @@ -899,11 +899,11 @@ static sdp_data_t *extract_int(const void *p, int *len) static sdp_data_t *extract_uuid(const uint8_t *p, int *len, sdp_record_t *rec) { - sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); + sdp_data_t *d = malloc(sizeof(sdp_data_t)); SDPDBG("Extracting UUID"); memset(d, 0, sizeof(sdp_data_t)); - if (0 > sdp_uuid_extract(p, &d->val.uuid, len)) { + if (sdp_uuid_extract(p, &d->val.uuid, len) < 0) { free(d); return NULL; } @@ -919,7 +919,7 @@ static sdp_data_t *extract_str(const void *p, int *len) { char *s; int n; - sdp_data_t *d = (sdp_data_t *) malloc(sizeof(sdp_data_t)); + sdp_data_t *d = malloc(sizeof(sdp_data_t)); memset(d, 0, sizeof(sdp_data_t)); d->dtd = *(uint8_t *) p; @@ -961,7 +961,7 @@ static sdp_data_t *extract_seq(const void *p, int *len, sdp_record_t *rec) { int seqlen, n = 0; sdp_data_t *curr, *prev; - sdp_data_t *d = (sdp_data_t *)malloc(sizeof(sdp_data_t)); + sdp_data_t *d = malloc(sizeof(sdp_data_t)); SDPDBG("Extracting SEQ"); memset(d, 0, sizeof(sdp_data_t)); @@ -1297,7 +1297,7 @@ int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *reqbuf, uint8_t *rspbuf */ sdp_list_t *sdp_list_append(sdp_list_t *p, void *d) { - sdp_list_t *q, *n = (sdp_list_t *)malloc(sizeof(sdp_list_t)); + sdp_list_t *q, *n = malloc(sizeof(sdp_list_t)); if (!n) return 0; @@ -1335,7 +1335,7 @@ sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *d, sdp_comp_func_t f) { sdp_list_t *q, *p, *n; - n = (sdp_list_t *)malloc(sizeof(sdp_list_t)); + n = malloc(sizeof(sdp_list_t)); if (!n) return 0; n->data = d; @@ -1471,7 +1471,7 @@ int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **se if (sdpdata && sdpdata->dtd >= SDP_SEQ8 && sdpdata->dtd <= SDP_SEQ32) { sdp_data_t *d; for (d = sdpdata->val.dataseq; d; d = d->next) { - uuid_t *u = (uuid_t *)malloc(sizeof(uuid_t)); + uuid_t *u = malloc(sizeof(uuid_t)); memset((char *)u, 0, sizeof(uuid_t)); if (d->dtd >= SDP_UUID16 && d->dtd <= SDP_UUID128) { *u = d->val.uuid; @@ -1553,7 +1553,7 @@ int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq) sdp_data_t *pEncoding = pCode->next; sdp_data_t *pOffset = pEncoding->next; if (pCode && pEncoding && pOffset) { - lang = (sdp_lang_attr_t *)malloc(sizeof(sdp_lang_attr_t)); + lang = malloc(sizeof(sdp_lang_attr_t)); lang->code_ISO639 = pCode->val.uint16; lang->encoding = pEncoding->val.uint16; lang->base_offset = pOffset->val.uint16; @@ -1594,7 +1594,7 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq) } if (uuid != NULL) { - profDesc = (sdp_profile_desc_t *)malloc(sizeof(sdp_profile_desc_t)); + profDesc = malloc(sizeof(sdp_profile_desc_t)); profDesc->uuid = *uuid; profDesc->version = version; #ifdef SDP_DEBUG @@ -2039,7 +2039,7 @@ uint128_t *sdp_create_base_uuid(void) if (bluetooth_base_uuid == NULL) { strcpy(baseStr, BASE_UUID); - bluetooth_base_uuid = (uint128_t *)malloc(sizeof(uint128_t)); + bluetooth_base_uuid = malloc(sizeof(uint128_t)); data = bluetooth_base_uuid->data; memset(data, '\0', sizeof(uint128_t)); memset(temp, '\0', 10); @@ -2201,7 +2201,7 @@ void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32) uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid) { - uuid_t *uuid128 = (uuid_t *)malloc(sizeof(uuid_t)); + uuid_t *uuid128 = bt_malloc(sizeof(uuid_t)); memset(uuid128, 0, sizeof(uuid_t)); switch (uuid->type) { case SDP_UUID128: @@ -2583,7 +2583,7 @@ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec) sdp_record_t *sdp_record_alloc() { - sdp_record_t *rec = (sdp_record_t *)malloc(sizeof(sdp_record_t)); + sdp_record_t *rec = malloc(sizeof(sdp_record_t)); memset((void *)rec, 0, sizeof(sdp_record_t)); rec->handle = 0xffffffff; return rec; @@ -2610,7 +2610,7 @@ void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid) if (sdp_list_find(rec->pattern, uuid128, sdp_uuid128_cmp) == NULL) rec->pattern = sdp_list_insert_sorted(rec->pattern, uuid128, sdp_uuid128_cmp); else - free(uuid128); + bt_free(uuid128); SDPDBG("Elements in target pattern : %d\n", sdp_list_len(rec->pattern)); } @@ -2636,7 +2636,7 @@ static void extract_record_handle_seq(uint8_t *pdu, sdp_list_t **seq, int count, int n; for (n = 0; n < count; n++) { - uint32_t *pSvcRec = (uint32_t *) malloc(sizeof(uint32_t)); + uint32_t *pSvcRec = malloc(sizeof(uint32_t)); *pSvcRec = ntohl(bt_get_unaligned((uint32_t *) pdata)); pSeq = sdp_list_append(pSeq, pSvcRec); pdata += sizeof(uint32_t); -- cgit From 3df8390f8e7be37d0adfac2192c425219941d844 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 24 Aug 2006 14:51:05 +0000 Subject: Fix UUID128 string lookup handling --- src/sdp.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 86caa15c..b1ef47ea 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -208,6 +208,24 @@ static char *string_lookup(struct tupla *pt0, int index) return ""; } +static char *string_lookup_uuid(struct tupla *pt0, const uuid_t* uuid) +{ + uuid_t tmp_uuid; + + memcpy(&tmp_uuid, uuid, sizeof(tmp_uuid)); + + if (sdp_uuid128_to_uuid(&tmp_uuid)) { + switch (tmp_uuid.type) { + case SDP_UUID16: + return string_lookup(pt0, tmp_uuid.value.uuid16); + case SDP_UUID32: + return string_lookup(pt0, tmp_uuid.value.uuid32); + } + } + + return ""; +} + /* * Prints into a string the Protocol UUID * coping a maximum of n characters. @@ -231,8 +249,9 @@ static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t snprintf(str, n, str2); break; case SDP_UUID128: - snprintf(str, n, "Error: This is UUID-128"); - return -4; + str2 = string_lookup_uuid(message, uuid); + snprintf(str, n, str2); + break; default: snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type); return -1; -- cgit From 2b3d5cfe013c2abf259b86e8dc73bda3d36429c1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 24 Aug 2006 22:56:35 +0000 Subject: Update changelog and bump version number --- ChangeLog | 4 ++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index be778865..c12f479b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +ver 3.4: + Fix UUID128 string lookup handling. + Fix malloc() versus bt_malloc() usage. + ver 3.3: Remove kernel specific timeouts. Add additional private data field for SDP sessions. diff --git a/configure.in b/configure.in index c1cb853b..2a863382 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.3) +AM_INIT_AUTOMAKE(bluez-libs, 3.4) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 74aca994..7fc9da99 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 4:0:2 +libbluetooth_la_LDFLAGS = -version-info 4:1:2 INCLUDES = -I$(top_builddir)/include -- cgit From 8be090b298a02108146d3bf48271f8408ac31917 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 25 Aug 2006 19:12:38 +0000 Subject: Added sdp_create for async searches --- include/sdp_lib.h | 6 +++++ src/sdp.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 8a89ab6e..a4b2cb4b 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -111,6 +111,12 @@ int sdp_get_socket(const sdp_session_t *session); uint16_t sdp_gen_tid(sdp_session_t *session); +/* + * SDP transaction: functions for asynchronous search. + */ +typedef void sdp_callback_t(uint8_t type, sdp_list_t *rsp, void *udata, int err); +sdp_session_t *sdp_create(int sk, uint32_t flags); + /* * find all devices in the piconet */ diff --git a/src/sdp.c b/src/sdp.c index b1ef47ea..f535ad48 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3032,6 +3032,59 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, return rec; } +/* + * SDP transaction structure for asynchronous search + */ +struct sdp_transaction { + sdp_callback_t *cb; + void *udata; + sdp_cstate_t *cstate; + uint8_t *reqbuf; + sdp_buf_t rsp_concat_buf; + uint32_t reqsize; + int cstate_len; + int attr_list_len; +}; + +/* + * Creates a new sdp session for asynchronous search + * INPUT: + * int sk + * non-blocking L2CAP socket + * + * RETURN: + * sdp_session_t * + * NULL - On memory allocation failure + */ +sdp_session_t *sdp_create(int sk, uint32_t flags) +{ + + struct sdp_transaction *t; + sdp_session_t *session = malloc(sizeof(sdp_session_t)); + if (!session) { + errno = ENOMEM; + return NULL; + } + + memset(session, 0, sizeof(*session)); + + session->flags = flags; + session->sock = sk; + + t = malloc(sizeof(struct sdp_transaction)); + if (!t) { + errno = ENOMEM; + free(session); + return NULL; + } + + memset(t, 0, sizeof(*t)); + + session->priv = t; + + return session; +} + /* * This is a service search request combined with the service * attribute request. First a service class match is done and @@ -3256,7 +3309,25 @@ int sdp_general_inquiry(inquiry_info *ii, int num_dev, int duration, uint8_t *fo int sdp_close(sdp_session_t *session) { - int ret = close(session->sock); + struct sdp_transaction *t; + int ret; + + if (!session) + return -1; + + ret = close(session->sock); + + t = session->priv; + + if (t) { + if (t->reqbuf) + free(t->reqbuf); + + if (t->rsp_concat_buf.data) + free(t->rsp_concat_buf.data); + + free(t); + } free(session); return ret; } -- cgit From dd610a12694a42aeb67417c95d87384f2eef8e70 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 25 Aug 2006 22:22:01 +0000 Subject: Add sdp_set_notify function --- include/sdp_lib.h | 3 ++- src/sdp.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index a4b2cb4b..eaf4cdb0 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,8 +114,9 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, sdp_list_t *rsp, void *udata, int err); +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t *size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); +int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); /* * find all devices in the piconet diff --git a/src/sdp.c b/src/sdp.c index f535ad48..5bbc8ec8 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3085,6 +3085,34 @@ sdp_session_t *sdp_create(int sk, uint32_t flags) return session; } +/* + * Set the callback function to called when the transaction finishes + * + * INPUT: + * sdp_session_t *session + * Current sdp session to be handled + * sdp_callback_t *cb + * callback to be called when the transaction finishes + * void *udata + * user data passed to callback + * RETURN: + * 0 - Success + * -1 - Failure + */ +int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) +{ + struct sdp_transaction *t; + + if (!session || !session->priv) + return -1; + + t = session->priv; + t->cb = func; + t->udata = udata; + + return 0; +} + /* * This is a service search request combined with the service * attribute request. First a service class match is done and -- cgit From f9264e21a9e0c97e6a4d970c0b31cf01fc18781d Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 28 Aug 2006 19:49:18 +0000 Subject: Added sdp_process and sdp_service_search_async functions --- include/sdp_lib.h | 4 +- src/sdp.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+), 1 deletion(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index eaf4cdb0..64fe5b52 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,9 +114,11 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t *size, void *udata); +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); +int sdp_process(sdp_session_t *session); /* * find all devices in the piconet diff --git a/src/sdp.c b/src/sdp.c index 5bbc8ec8..601985d6 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3113,6 +3113,220 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) return 0; } +/* + * Set the callback function to called when the transaction finishes and send the + * service search attribute request PDU. + * + * INPUT: + * sdp_session_t *session + * Current sdp session to be handled + * sdp_list_t *search + * UUID pattern to search + * RETURN: + * 0 - if the request has been sent properly + * -1 - On any failure + */ +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search) +{ + struct sdp_transaction *t; + sdp_pdu_hdr_t *reqhdr; + sdp_list_t *attrids; + uint8_t *pdata; + int seqlen = 0; + uint32_t range = 0x0000ffff; + + if (!session || !session->priv) { + errno = EINVAL; + return -1; + } + + t = session->priv; + t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + if (!t->reqbuf) { + errno = ENOMEM; + goto end; + } + + memset(t->reqbuf, 0, SDP_REQ_BUFFER_SIZE); + memset((char *)&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); + + reqhdr = (sdp_pdu_hdr_t *) t->reqbuf; + reqhdr->tid = htons(sdp_gen_tid(session)); + reqhdr->pdu_id = SDP_SVC_SEARCH_ATTR_REQ; + + // generate PDU + pdata = t->reqbuf + sizeof(sdp_pdu_hdr_t); + t->reqsize = sizeof(sdp_pdu_hdr_t); + + // add service class IDs for search + seqlen = gen_searchseq_pdu(pdata, search); + + SDPDBG("Data seq added : %d\n", seqlen); + + // now set the length and increment the pointer + t->reqsize += seqlen; + pdata += seqlen; + + bt_put_unaligned(htons(SDP_MAX_ATTR_LEN), (uint16_t *) pdata); + t->reqsize += sizeof(uint16_t); + pdata += sizeof(uint16_t); + + SDPDBG("Max attr byte count : %d\n", SDP_MAX_ATTR_LEN); + + // get attr seq PDU form + attrids = sdp_list_append(0, &range); + seqlen = gen_attridseq_pdu(pdata, attrids, SDP_UINT32); + sdp_list_free(attrids, 0); + + if (seqlen == -1) { + errno = EINVAL; + goto end; + } + + pdata += seqlen; + SDPDBG("Attr list length : %d\n", seqlen); + t->reqsize += seqlen; + + // set the request header's param length + t->cstate_len = copy_cstate(pdata, t->cstate); + + reqhdr->plen = htons((t->reqsize + t->cstate_len) - sizeof(sdp_pdu_hdr_t)); + + if (sdp_send_req(session, t->reqbuf, t->reqsize + t->cstate_len) < 0) { + SDPERR("Error sendind data:%s", strerror(errno)); + goto end; + } + + session->priv = t; + + return 0; +end: + + if (t) { + if (t->reqbuf) + free(t->reqbuf); + free(t); + } + + return -1; +} + +/* + * Receive the incomming SDP PDU. This function must be called when there is data + * available to be read. On continuation state, the original request (with a new + * transaction ID) and the continuation state data will be appended in the initial PDU. + * If an error happens or the transaction finishes the callback function will be called. + * + * INPUT: + * sdp_session_t *session + * Current sdp session to be handled + * RETURN: + * 0 - if the transaction is on continuation state + * -1 - On any failure or the transaction finished + */ +int sdp_process(sdp_session_t *session) +{ + struct sdp_transaction *t = NULL; + sdp_pdu_hdr_t *reqhdr = NULL; + sdp_pdu_hdr_t *rsphdr = NULL; + uint8_t *pdata = NULL, *rspbuf = NULL; + int n, err = 0, rsp_count = 0, status = -1; + + if (!session || !session->priv) { + err= EINVAL; + goto end; + } + + rspbuf = malloc(SDP_RSP_BUFFER_SIZE); + if (!rspbuf) { + err = ENOMEM; + goto end; + } + + t = session->priv; + reqhdr = (sdp_pdu_hdr_t *)t->reqbuf; + rsphdr = (sdp_pdu_hdr_t *)rspbuf; + + n = sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE); + if (n < 0) { + err = errno; + goto end; + } + + if (n == 0 || reqhdr->tid != rsphdr->tid || rsphdr->pdu_id == SDP_ERROR_RSP) { + err = EPROTO; + goto end; + } + + pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); + t->attr_list_len += rsp_count; + pdata += sizeof(uint16_t); // pdata points to attribute list + + t->cstate_len = *(uint8_t *) (pdata + rsp_count); + + SDPDBG("Attrlist byte count : %d\n", t->attr_list_len); + SDPDBG("Response byte count : %d\n", rsp_count); + SDPDBG("Cstate length : %d\n", t->cstate_len); + /* + * This is a split response, need to concatenate intermediate + * responses and the last one which will have cstate_len == 0 + */ + if (t->cstate_len > 0 || t->rsp_concat_buf.data_size != 0) { + uint8_t *targetPtr = NULL; + + t->cstate = t->cstate_len > 0 ? (sdp_cstate_t *) (pdata + rsp_count) : 0; + + // build concatenated response buffer + t->rsp_concat_buf.data = realloc(t->rsp_concat_buf.data, t->rsp_concat_buf.data_size + rsp_count); + targetPtr = t->rsp_concat_buf.data + t->rsp_concat_buf.data_size; + t->rsp_concat_buf.buf_size = t->rsp_concat_buf.data_size + rsp_count; + memcpy(targetPtr, pdata, rsp_count); + t->rsp_concat_buf.data_size += rsp_count; + } + + if (t->cstate) { + int reqsize; + reqhdr->tid = htons(sdp_gen_tid(session)); + + // add continuation state (can be null) + t->cstate_len = copy_cstate(t->reqbuf + t->reqsize, t->cstate); + + reqsize = t->reqsize + t->cstate_len; + + // set the request header's param length + reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); + + if (sdp_send_req(session, t->reqbuf, reqsize) < 0) { + err = errno; + goto end; + } + status = 0; + } else { + if (t->attr_list_len == 0) { + err = ENODATA; + goto end; + } + } + +end: + + /* error detected or transaction finished */ + if (err || !t->cstate) { + if (t->rsp_concat_buf.data_size != 0) + pdata = t->rsp_concat_buf.data; + + if (t->cb) + t->cb(rsphdr->pdu_id, err, pdata, + t->attr_list_len, t->udata); + } + + if (rspbuf) + free(rspbuf); + + return status; +} + /* * This is a service search request combined with the service * attribute request. First a service class match is done and -- cgit From 343f72ba28deaf9ddc68043567baad76e0325e5d Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 28 Aug 2006 21:26:50 +0000 Subject: Added SDP error response parsing --- include/sdp_lib.h | 2 +- src/sdp.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 64fe5b52..23157c6f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,7 +114,7 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); +typedef void sdp_callback_t(uint8_t type, int status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); diff --git a/src/sdp.c b/src/sdp.c index 601985d6..53c7196b 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3253,12 +3253,18 @@ int sdp_process(sdp_session_t *session) goto end; } - if (n == 0 || reqhdr->tid != rsphdr->tid || rsphdr->pdu_id == SDP_ERROR_RSP) { + if (n == 0 || reqhdr->tid != rsphdr->tid) err = EPROTO; goto end; } pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + + if (rsphdr->pdu_id == SDP_ERROR_RSP) { + err = ntohs(bt_get_unaligned((uint16_t *) pdata)); + goto end; + } + rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); t->attr_list_len += rsp_count; pdata += sizeof(uint16_t); // pdata points to attribute list -- cgit From 3f7d61cbeff52ce209a75cec97ba29507ed764bc Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 28 Aug 2006 21:32:20 +0000 Subject: fixed syntax error --- src/sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 53c7196b..63a9ba1c 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3253,7 +3253,7 @@ int sdp_process(sdp_session_t *session) goto end; } - if (n == 0 || reqhdr->tid != rsphdr->tid) + if (n == 0 || reqhdr->tid != rsphdr->tid) { err = EPROTO; goto end; } -- cgit From c8e5a1464ff8edb068e7361a257ef4ae34674cf8 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 29 Aug 2006 16:29:00 +0000 Subject: changed error handling in sdp_process function --- include/sdp_lib.h | 2 +- src/sdp.c | 43 ++++++++++++++++--------------------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 23157c6f..64fe5b52 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -114,7 +114,7 @@ uint16_t sdp_gen_tid(sdp_session_t *session); /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, int status, uint8_t *rsp, size_t size, void *udata); +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); diff --git a/src/sdp.c b/src/sdp.c index 63a9ba1c..bc69551a 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3230,38 +3230,34 @@ int sdp_process(sdp_session_t *session) sdp_pdu_hdr_t *reqhdr = NULL; sdp_pdu_hdr_t *rsphdr = NULL; uint8_t *pdata = NULL, *rspbuf = NULL; - int n, err = 0, rsp_count = 0, status = -1; + int rsp_count = 0, err = -1; + uint16_t status = 0; if (!session || !session->priv) { - err= EINVAL; - goto end; + SDPERR("Invalid session"); + return -1; } rspbuf = malloc(SDP_RSP_BUFFER_SIZE); - if (!rspbuf) { - err = ENOMEM; - goto end; - } + if (!rspbuf) + return -1; + + memset(rspbuf, 0, SDP_RSP_BUFFER_SIZE); t = session->priv; reqhdr = (sdp_pdu_hdr_t *)t->reqbuf; rsphdr = (sdp_pdu_hdr_t *)rspbuf; - n = sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE); - if (n < 0) { - err = errno; + if (sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE) <= 0) goto end; - } - if (n == 0 || reqhdr->tid != rsphdr->tid) { - err = EPROTO; + if (reqhdr->tid != rsphdr->tid) goto end; - } pdata = rspbuf + sizeof(sdp_pdu_hdr_t); if (rsphdr->pdu_id == SDP_ERROR_RSP) { - err = ntohs(bt_get_unaligned((uint16_t *) pdata)); + status = ntohs(bt_get_unaligned((uint16_t *) pdata)); goto end; } @@ -3304,33 +3300,26 @@ int sdp_process(sdp_session_t *session) reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); if (sdp_send_req(session, t->reqbuf, reqsize) < 0) { - err = errno; - goto end; - } - status = 0; - } else { - if (t->attr_list_len == 0) { - err = ENODATA; + SDPERR("Error sendind data:%s", strerror(errno)); goto end; } + err = 0; } end: - - /* error detected or transaction finished */ - if (err || !t->cstate) { + if (err) { if (t->rsp_concat_buf.data_size != 0) pdata = t->rsp_concat_buf.data; if (t->cb) - t->cb(rsphdr->pdu_id, err, pdata, + t->cb(rsphdr->pdu_id, status, pdata, t->attr_list_len, t->udata); } if (rspbuf) free(rspbuf); - return status; + return err; } /* -- cgit From 453a0cedb6c909047553ffc7145bcef26a3ae94c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 29 Aug 2006 21:39:07 +0000 Subject: Correct prototypes for async functions --- include/sdp_lib.h | 27 ++++++++++++++------------- src/sdp.c | 49 +++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 64fe5b52..b1f839bc 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -111,13 +111,26 @@ int sdp_get_socket(const sdp_session_t *session); uint16_t sdp_gen_tid(sdp_session_t *session); +typedef enum { + /* + * Attributes are specified as individual elements + */ + SDP_ATTR_REQ_INDIVIDUAL = 1, + /* + * Attributes are specified as a range + */ + SDP_ATTR_REQ_RANGE +} sdp_attrreq_type_t; /* * SDP transaction: functions for asynchronous search. */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); -int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search); +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num); +int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); +int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); +int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_process(sdp_session_t *session); /* @@ -356,18 +369,6 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list * -1 * The request completed unsuccessfully due to a timeout */ - -typedef enum { - /* - * Attributes are specified as individual elements - */ - SDP_ATTR_REQ_INDIVIDUAL = 1, - /* - * Attributes are specified as a range - */ - SDP_ATTR_REQ_RANGE -} sdp_attrreq_type_t; - sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); /* diff --git a/src/sdp.c b/src/sdp.c index bc69551a..1d6d65fe 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3113,6 +3113,18 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) return 0; } +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num) +{ + /* FIXME: implement! */ + return 0; +} + +int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list) +{ + /* FIXME: implement! */ + return 0; +} + /* * Set the callback function to called when the transaction finishes and send the * service search attribute request PDU. @@ -3120,20 +3132,39 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) * INPUT: * sdp_session_t *session * Current sdp session to be handled - * sdp_list_t *search - * UUID pattern to search + * + * sdp_list_t *search + * Singly linked list containing elements of the search + * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16) + * of the service to be searched + * + * AttributeSpecification attrSpec + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrids + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * RETURN: * 0 - if the request has been sent properly * -1 - On any failure */ -int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search) +int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list) { struct sdp_transaction *t; sdp_pdu_hdr_t *reqhdr; - sdp_list_t *attrids; uint8_t *pdata; int seqlen = 0; - uint32_t range = 0x0000ffff; if (!session || !session->priv) { errno = EINVAL; @@ -3159,7 +3190,7 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search) t->reqsize = sizeof(sdp_pdu_hdr_t); // add service class IDs for search - seqlen = gen_searchseq_pdu(pdata, search); + seqlen = gen_searchseq_pdu(pdata, search_list); SDPDBG("Data seq added : %d\n", seqlen); @@ -3174,10 +3205,8 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search) SDPDBG("Max attr byte count : %d\n", SDP_MAX_ATTR_LEN); // get attr seq PDU form - attrids = sdp_list_append(0, &range); - seqlen = gen_attridseq_pdu(pdata, attrids, SDP_UINT32); - sdp_list_free(attrids, 0); - + seqlen = gen_attridseq_pdu(pdata, attrid_list, + reqtype == SDP_ATTR_REQ_INDIVIDUAL ? SDP_UINT16 : SDP_UINT32); if (seqlen == -1) { errno = EINVAL; goto end; -- cgit From a76dc65489dd8959547a97a391e405b2025bbd79 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 29 Aug 2006 22:03:13 +0000 Subject: Make sdp_connect() async aware --- src/sdp.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 1d6d65fe..d694fd24 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3059,8 +3059,10 @@ struct sdp_transaction { sdp_session_t *sdp_create(int sk, uint32_t flags) { + sdp_session_t *session; struct sdp_transaction *t; - sdp_session_t *session = malloc(sizeof(sdp_session_t)); + + session = malloc(sizeof(sdp_session_t)); if (!session) { errno = ENOMEM; return NULL; @@ -3605,12 +3607,30 @@ static inline int sdp_is_local(const bdaddr_t *device) sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags) { + sdp_session_t *session; + struct sdp_transaction *t; int err; - sdp_session_t *session = malloc(sizeof(sdp_session_t)); + + session = malloc(sizeof(sdp_session_t)); if (!session) return session; + memset(session, 0, sizeof(*session)); + session->flags = flags; + session->sock = -1; + + t = malloc(sizeof(struct sdp_transaction)); + if (!t) { + errno = ENOMEM; + free(session); + return NULL; + } + + memset(t, 0, sizeof(*t)); + + session->priv = t; + if (sdp_is_local(dst)) { struct sockaddr_un sa; @@ -3649,10 +3669,13 @@ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t fl while (errno == EBUSY && (flags & SDP_RETRY_IF_BUSY)); } } + fail: err = errno; if (session->sock >= 0) close(session->sock); + if (session->priv) + free(session->priv); free(session); errno = err; return 0; -- cgit From adff4cad15e4e13bb9847a0ff62b355caddf89e3 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 30 Aug 2006 12:52:34 +0000 Subject: added/updated async functions comments --- src/sdp.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index d694fd24..27a895f4 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3088,7 +3088,9 @@ sdp_session_t *sdp_create(int sk, uint32_t flags) } /* - * Set the callback function to called when the transaction finishes + * Sets the callback function/user data used to notify the application + * that the asynchronous transaction finished. This function must be + * called before request an asynchronous search. * * INPUT: * sdp_session_t *session @@ -3098,7 +3100,7 @@ sdp_session_t *sdp_create(int sk, uint32_t flags) * void *udata * user data passed to callback * RETURN: - * 0 - Success + * 0 - Success * -1 - Failure */ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) @@ -3115,12 +3117,75 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) return 0; } +/* + * This function starts an asynchronous service search request. + * The incomming and outgoing data are stored in the transaction structure + * buffers. When there is incomming data the sdp_process function must be + * called to get the data and handle the continuation state. + * + * INPUT : + * sdp_session_t *session + * Current sdp session to be handled + * + * sdp_list_t *search_list + * Singly linked list containing elements of the search + * pattern. Each entry in the list is a UUID (DataTypeSDP_UUID16) + * of the service to be searched + * + * uint16_t max_rec_num + * A 16 bit integer which tells the service, the maximum + * entries that the client can handle in the response. The + * server is obliged not to return > max_rec_num entries + * + * OUTPUT : + * + * int return value + * 0 - if the request has been sent properly + * -1 - On any failure and sets errno + */ + int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num) { /* FIXME: implement! */ return 0; } +/* + * This function starts an asynchronous service attribute request. + * The incomming and outgoing data are stored in the transaction structure + * buffers. When there is incomming data the sdp_process function must be + * called to get the data and handle the continuation state. + * + * INPUT : + * sdp_session_t *session + * Current sdp session to be handled + * + * uint32_t handle + * The handle of the service for which the attribute(s) are + * requested + * + * sdp_attrreq_type_t reqtype + * Attribute identifiers are 16 bit unsigned integers specified + * in one of 2 ways described below : + * SDP_ATTR_REQ_INDIVIDUAL - 16bit individual identifiers + * They are the actual attribute identifiers in ascending order + * + * SDP_ATTR_REQ_RANGE - 32bit identifier range + * The high-order 16bits is the start of range + * the low-order 16bits are the end of range + * 0x0000 to 0xFFFF gets all attributes + * + * sdp_list_t *attrid_list + * Singly linked list containing attribute identifiers desired. + * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) + * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) + * + * OUTPUT : + * int return value + * 0 - if the request has been sent properly + * -1 - On any failure and sets errno + */ + int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list) { /* FIXME: implement! */ @@ -3128,8 +3193,11 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ } /* - * Set the callback function to called when the transaction finishes and send the - * service search attribute request PDU. + * This function starts an asynchronous service search attributes. + * It is a service search request combined with attribute request. The incomming + * and outgoing data are stored in the transaction structure buffers. When there + * is incomming data the sdp_process function must be called to get the data + * and handle the continuation state. * * INPUT: * sdp_session_t *session @@ -3151,14 +3219,14 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ * the low-order 16bits are the end of range * 0x0000 to 0xFFFF gets all attributes * - * sdp_list_t *attrids + * sdp_list_t *attrid_list * Singly linked list containing attribute identifiers desired. * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL) * or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE) * * RETURN: - * 0 - if the request has been sent properly + * 0 - if the request has been sent properly * -1 - On any failure */ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list) -- cgit From ef1fe5feaa0dde16562723bcb36343c7bc4c31be Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 30 Aug 2006 21:34:20 +0000 Subject: added sdp_service_attr_async function --- src/sdp.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 27a895f4..014fc4c8 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3188,8 +3188,77 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_li int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list) { - /* FIXME: implement! */ + struct sdp_transaction *t; + sdp_pdu_hdr_t *reqhdr; + uint8_t *pdata; + int seqlen = 0; + + if (!session || !session->priv) { + errno = EINVAL; + return -1; + } + + t = session->priv; + t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + if (!t->reqbuf) { + errno = ENOMEM; + goto end; + } + + memset(t->reqbuf, 0, SDP_REQ_BUFFER_SIZE); + memset((char *)&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); + + reqhdr = (sdp_pdu_hdr_t *) t->reqbuf; + reqhdr->tid = htons(sdp_gen_tid(session)); + reqhdr->pdu_id = SDP_SVC_ATTR_REQ; + + // generate PDU + pdata = t->reqbuf + sizeof(sdp_pdu_hdr_t); + t->reqsize = sizeof(sdp_pdu_hdr_t); + + // add the service record handle + bt_put_unaligned(htonl(handle), (uint32_t *) pdata); + t->reqsize += sizeof(uint32_t); + pdata += sizeof(uint32_t); + + // specify the response limit + bt_put_unaligned(htons(65535), (uint16_t *) pdata); + t->reqsize += sizeof(uint16_t); + pdata += sizeof(uint16_t); + + // get attr seq PDU form + seqlen = gen_attridseq_pdu(pdata, attrid_list, + reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32); + if (seqlen == -1) { + errno = EINVAL; + goto end; + } + + // now set the length and increment the pointer + t->reqsize += seqlen; + pdata += seqlen; + SDPDBG("Attr list length : %d\n", seqlen); + + // set the request header's param length + t->cstate_len = copy_cstate(pdata, t->cstate); + + reqhdr->plen = htons((t->reqsize + t->cstate_len) - sizeof(sdp_pdu_hdr_t)); + + if (sdp_send_req(session, t->reqbuf, t->reqsize + t->cstate_len) < 0) { + SDPERR("Error sendind data:%s", strerror(errno)); + goto end; + } + return 0; +end: + + if (t) { + if (t->reqbuf) + free(t->reqbuf); + free(t); + } + + return -1; } /* @@ -3296,8 +3365,6 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear goto end; } - session->priv = t; - return 0; end: -- cgit From e9527af7533e35a59580cda37ff58152cb356103 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 30 Aug 2006 22:02:14 +0000 Subject: added sdp_service_search_async function --- src/sdp.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 014fc4c8..c10737a5 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3146,8 +3146,67 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num) { - /* FIXME: implement! */ + struct sdp_transaction *t; + sdp_pdu_hdr_t *reqhdr; + uint8_t *pdata; + int seqlen = 0; + + if (!session || !session->priv) { + errno = EINVAL; + return -1; + } + + t = session->priv; + t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + if (!t->reqbuf) { + errno = ENOMEM; + goto end; + } + + memset(t->reqbuf, 0, SDP_REQ_BUFFER_SIZE); + memset((char *)&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); + + reqhdr = (sdp_pdu_hdr_t *) t->reqbuf; + reqhdr->tid = htons(sdp_gen_tid(session)); + reqhdr->pdu_id = SDP_SVC_SEARCH_REQ; + + // generate PDU + pdata = t->reqbuf + sizeof(sdp_pdu_hdr_t); + t->reqsize = sizeof(sdp_pdu_hdr_t); + + // add service class IDs for search + seqlen = gen_searchseq_pdu(pdata, search_list); + + SDPDBG("Data seq added : %d\n", seqlen); + + // now set the length and increment the pointer + t->reqsize += seqlen; + pdata += seqlen; + + bt_put_unaligned(htons(max_rec_num), (uint16_t *) pdata); + t->reqsize += sizeof(uint16_t); + pdata += sizeof(uint16_t); + + // set the request header's param length + t->cstate_len = copy_cstate(pdata, t->cstate); + + reqhdr->plen = htons((t->reqsize + t->cstate_len) - sizeof(sdp_pdu_hdr_t)); + + if (sdp_send_req(session, t->reqbuf, t->reqsize + t->cstate_len) < 0) { + SDPERR("Error sendind data:%s", strerror(errno)); + goto end; + } + return 0; +end: + + if (t) { + if (t->reqbuf) + free(t->reqbuf); + free(t); + } + + return -1; } /* -- cgit From 41064d605ba2f88f967c8388c9b20b92a7868a87 Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Wed, 30 Aug 2006 22:44:49 +0000 Subject: fix prototypes for sdp sync/async functions --- include/sdp_lib.h | 11 +++++------ src/sdp.c | 12 ++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index b1f839bc..d61413c3 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -127,10 +127,9 @@ typedef enum { typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); -int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num); +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); -int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_process(sdp_session_t *session); /* @@ -311,7 +310,7 @@ void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char * * * INPUT : * - * sdp_list_t *search_list + * sdp_list_t *search * list containing elements of the search * pattern. Each entry in the list is a UUID * of the service to be searched @@ -334,7 +333,7 @@ void sdp_set_url_attr(sdp_record_t *rec, const char *clientExecURL, const char * * non-zero service handles. It is a singly linked list of * service record handles (uint16_t) */ -int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num, sdp_list_t **rsp_list); +int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num, sdp_list_t **rsp_list); /* * a service attribute request. @@ -378,7 +377,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_ * * INPUT : * - * sdp_list_t *search_list + * sdp_list_t *search * Singly linked list containing elements of the search * pattern. Each entry in the list is a UUID(DataTypeSDP_UUID16) * of the service to be searched @@ -412,7 +411,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, sdp_ * service(s) found. Each element of this list is of type * sdp_record_t *. */ -int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list); +int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list, sdp_list_t **rsp_list); /* * Allocate/free a service record and its attributes diff --git a/src/sdp.c b/src/sdp.c index c10737a5..362dcfb1 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2735,7 +2735,7 @@ static int copy_cstate(uint8_t *pdata, const sdp_cstate_t *cstate) * * INPUT : * - * sdp_list_t *search_list + * sdp_list_t *search * Singly linked list containing elements of the search * pattern. Each entry in the list is a UUID (DataTypeSDP_UUID16) * of the service to be searched @@ -3127,7 +3127,7 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) * sdp_session_t *session * Current sdp session to be handled * - * sdp_list_t *search_list + * sdp_list_t *search * Singly linked list containing elements of the search * pattern. Each entry in the list is a UUID (DataTypeSDP_UUID16) * of the service to be searched @@ -3144,7 +3144,7 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) * -1 - On any failure and sets errno */ -int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_list, uint16_t max_rec_num) +int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num) { struct sdp_transaction *t; sdp_pdu_hdr_t *reqhdr; @@ -3175,7 +3175,7 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search_li t->reqsize = sizeof(sdp_pdu_hdr_t); // add service class IDs for search - seqlen = gen_searchseq_pdu(pdata, search_list); + seqlen = gen_searchseq_pdu(pdata, search); SDPDBG("Data seq added : %d\n", seqlen); @@ -3357,7 +3357,7 @@ end: * 0 - if the request has been sent properly * -1 - On any failure */ -int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search_list, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list) +int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list) { struct sdp_transaction *t; sdp_pdu_hdr_t *reqhdr; @@ -3388,7 +3388,7 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear t->reqsize = sizeof(sdp_pdu_hdr_t); // add service class IDs for search - seqlen = gen_searchseq_pdu(pdata, search_list); + seqlen = gen_searchseq_pdu(pdata, search); SDPDBG("Data seq added : %d\n", seqlen); -- cgit From 58eb769e7620e03c8b0bf2d2bcf38c06ab58065f Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 31 Aug 2006 21:22:06 +0000 Subject: fixed sdp_process to handle cstate --- src/sdp.c | 78 +++++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 362dcfb1..11896cb0 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3043,7 +3043,7 @@ struct sdp_transaction { sdp_buf_t rsp_concat_buf; uint32_t reqsize; int cstate_len; - int attr_list_len; + int size; }; /* @@ -3454,7 +3454,8 @@ int sdp_process(sdp_session_t *session) struct sdp_transaction *t = NULL; sdp_pdu_hdr_t *reqhdr = NULL; sdp_pdu_hdr_t *rsphdr = NULL; - uint8_t *pdata = NULL, *rspbuf = NULL; + sdp_cstate_t *pcstate = NULL; + uint8_t *pdata = NULL, *rspbuf = NULL, *targetPtr = NULL; int rsp_count = 0, err = -1; uint16_t status = 0; @@ -3486,40 +3487,69 @@ int sdp_process(sdp_session_t *session) goto end; } - rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); - t->attr_list_len += rsp_count; - pdata += sizeof(uint16_t); // pdata points to attribute list + switch (rsphdr->pdu_id) { + uint8_t *ssr_pdata; + uint16_t tsrc, csrc; + case SDP_SVC_SEARCH_RSP: + /* + * TSRC: Total Service Record Count + * CSRC: Current Service Record Count + */ + ssr_pdata = pdata; + ssr_pdata += sizeof(tsrc); + tsrc = ntohs(bt_get_unaligned((uint16_t *) ssr_pdata)); + csrc = ntohs(bt_get_unaligned((uint16_t *) ssr_pdata)); + + if (t->size == 0) { + /* first fragment */ + rsp_count = sizeof(tsrc) + sizeof(csrc) + csrc * 4; + SDPDBG("Total svc count: %d\n", tsrc); + SDPDBG("Current svc count: %d\n", csrc); + } else { + pdata += 2 * sizeof(uint16_t); /* Ignore TSRC and CSRC */ + rsp_count = csrc * 4; + } + t->size += rsp_count; + break; + case SDP_SVC_ATTR_RSP: + case SDP_SVC_SEARCH_ATTR_RSP: + rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); + SDPDBG("Attrlist byte count : %d\n", rsp_count); - t->cstate_len = *(uint8_t *) (pdata + rsp_count); + pdata += sizeof(uint16_t); // points to attribute list + t->size += rsp_count; + break; + default: + /* FIXME: how handle this situation? */ + SDPDBG("Illegal PDU ID!"); + goto end; + } - SDPDBG("Attrlist byte count : %d\n", t->attr_list_len); - SDPDBG("Response byte count : %d\n", rsp_count); - SDPDBG("Cstate length : %d\n", t->cstate_len); + pcstate = (sdp_cstate_t *) (pdata + rsp_count); + + SDPDBG("Cstate length : %d\n", pcstate->length); /* * This is a split response, need to concatenate intermediate * responses and the last one which will have cstate_len == 0 */ - if (t->cstate_len > 0 || t->rsp_concat_buf.data_size != 0) { - uint8_t *targetPtr = NULL; - t->cstate = t->cstate_len > 0 ? (sdp_cstate_t *) (pdata + rsp_count) : 0; - // build concatenated response buffer - t->rsp_concat_buf.data = realloc(t->rsp_concat_buf.data, t->rsp_concat_buf.data_size + rsp_count); - targetPtr = t->rsp_concat_buf.data + t->rsp_concat_buf.data_size; - t->rsp_concat_buf.buf_size = t->rsp_concat_buf.data_size + rsp_count; - memcpy(targetPtr, pdata, rsp_count); - t->rsp_concat_buf.data_size += rsp_count; - } + // build concatenated response buffer + t->rsp_concat_buf.data = realloc(t->rsp_concat_buf.data, t->rsp_concat_buf.data_size + rsp_count); + targetPtr = t->rsp_concat_buf.data + t->rsp_concat_buf.data_size; + t->rsp_concat_buf.buf_size = t->rsp_concat_buf.data_size + rsp_count; + memcpy(targetPtr, pdata, rsp_count); + t->rsp_concat_buf.data_size += rsp_count; + + if (pcstate->length > 0) { + int reqsize, cstate_len; - if (t->cstate) { - int reqsize; reqhdr->tid = htons(sdp_gen_tid(session)); // add continuation state (can be null) - t->cstate_len = copy_cstate(t->reqbuf + t->reqsize, t->cstate); + cstate_len = copy_cstate(t->reqbuf + t->reqsize, pcstate); - reqsize = t->reqsize + t->cstate_len; + reqsize = t->reqsize + cstate_len; // set the request header's param length reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); @@ -3538,7 +3568,7 @@ end: if (t->cb) t->cb(rsphdr->pdu_id, status, pdata, - t->attr_list_len, t->udata); + t->size, t->udata); } if (rspbuf) -- cgit From e4c8ef4fa293cb27510c898e84ce25f948122286 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 3 Sep 2006 09:26:32 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 9df142a0..645a4d63 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -382,6 +382,8 @@ char *bt_compidtostr(int compid) return "CONWISE Technology Corporation Ltd"; case 67: return "PARROT SA"; + case 68: + return "Socket Communications"; case 65535: return "internal use"; default: -- cgit From c01b6039f44d9e78acc26cd8482b5e0c7b23fe14 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 3 Sep 2006 19:51:41 +0000 Subject: Remove cstate and cstate_len from transaction structure --- src/sdp.c | 53 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 11896cb0..1ce5e81b 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3036,14 +3036,11 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, * SDP transaction structure for asynchronous search */ struct sdp_transaction { - sdp_callback_t *cb; - void *udata; - sdp_cstate_t *cstate; - uint8_t *reqbuf; + sdp_callback_t *cb; /* called when the transaction finishes */ + void *udata; /* client user data */ + uint8_t *reqbuf; /* pointer to request PDU */ sdp_buf_t rsp_concat_buf; - uint32_t reqsize; - int cstate_len; - int size; + uint32_t reqsize; /* without cstate */ }; /* @@ -3149,7 +3146,7 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u struct sdp_transaction *t; sdp_pdu_hdr_t *reqhdr; uint8_t *pdata; - int seqlen = 0; + int cstate_len, seqlen = 0; if (!session || !session->priv) { errno = EINVAL; @@ -3187,12 +3184,12 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u t->reqsize += sizeof(uint16_t); pdata += sizeof(uint16_t); + // set the request header's param length - t->cstate_len = copy_cstate(pdata, t->cstate); - - reqhdr->plen = htons((t->reqsize + t->cstate_len) - sizeof(sdp_pdu_hdr_t)); + cstate_len = copy_cstate(pdata, NULL); + reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t)); - if (sdp_send_req(session, t->reqbuf, t->reqsize + t->cstate_len) < 0) { + if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { SDPERR("Error sendind data:%s", strerror(errno)); goto end; } @@ -3250,7 +3247,7 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ struct sdp_transaction *t; sdp_pdu_hdr_t *reqhdr; uint8_t *pdata; - int seqlen = 0; + int cstate_len, seqlen = 0; if (!session || !session->priv) { errno = EINVAL; @@ -3299,11 +3296,10 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ SDPDBG("Attr list length : %d\n", seqlen); // set the request header's param length - t->cstate_len = copy_cstate(pdata, t->cstate); - - reqhdr->plen = htons((t->reqsize + t->cstate_len) - sizeof(sdp_pdu_hdr_t)); + cstate_len = copy_cstate(pdata, NULL); + reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t)); - if (sdp_send_req(session, t->reqbuf, t->reqsize + t->cstate_len) < 0) { + if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { SDPERR("Error sendind data:%s", strerror(errno)); goto end; } @@ -3362,7 +3358,7 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear struct sdp_transaction *t; sdp_pdu_hdr_t *reqhdr; uint8_t *pdata; - int seqlen = 0; + int cstate_len, seqlen = 0; if (!session || !session->priv) { errno = EINVAL; @@ -3415,11 +3411,10 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear t->reqsize += seqlen; // set the request header's param length - t->cstate_len = copy_cstate(pdata, t->cstate); - - reqhdr->plen = htons((t->reqsize + t->cstate_len) - sizeof(sdp_pdu_hdr_t)); + cstate_len = copy_cstate(pdata, NULL); + reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t)); - if (sdp_send_req(session, t->reqbuf, t->reqsize + t->cstate_len) < 0) { + if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { SDPERR("Error sendind data:%s", strerror(errno)); goto end; } @@ -3457,6 +3452,7 @@ int sdp_process(sdp_session_t *session) sdp_cstate_t *pcstate = NULL; uint8_t *pdata = NULL, *rspbuf = NULL, *targetPtr = NULL; int rsp_count = 0, err = -1; + size_t size = 0; uint16_t status = 0; if (!session || !session->priv) { @@ -3484,6 +3480,7 @@ int sdp_process(sdp_session_t *session) if (rsphdr->pdu_id == SDP_ERROR_RSP) { status = ntohs(bt_get_unaligned((uint16_t *) pdata)); + size = rsphdr->plen; goto end; } @@ -3500,7 +3497,7 @@ int sdp_process(sdp_session_t *session) tsrc = ntohs(bt_get_unaligned((uint16_t *) ssr_pdata)); csrc = ntohs(bt_get_unaligned((uint16_t *) ssr_pdata)); - if (t->size == 0) { + if (t->rsp_concat_buf.data_size == 0) { /* first fragment */ rsp_count = sizeof(tsrc) + sizeof(csrc) + csrc * 4; SDPDBG("Total svc count: %d\n", tsrc); @@ -3509,7 +3506,6 @@ int sdp_process(sdp_session_t *session) pdata += 2 * sizeof(uint16_t); /* Ignore TSRC and CSRC */ rsp_count = csrc * 4; } - t->size += rsp_count; break; case SDP_SVC_ATTR_RSP: case SDP_SVC_SEARCH_ATTR_RSP: @@ -3517,7 +3513,6 @@ int sdp_process(sdp_session_t *session) SDPDBG("Attrlist byte count : %d\n", rsp_count); pdata += sizeof(uint16_t); // points to attribute list - t->size += rsp_count; break; default: /* FIXME: how handle this situation? */ @@ -3533,7 +3528,6 @@ int sdp_process(sdp_session_t *session) * responses and the last one which will have cstate_len == 0 */ - // build concatenated response buffer t->rsp_concat_buf.data = realloc(t->rsp_concat_buf.data, t->rsp_concat_buf.data_size + rsp_count); targetPtr = t->rsp_concat_buf.data + t->rsp_concat_buf.data_size; @@ -3556,6 +3550,7 @@ int sdp_process(sdp_session_t *session) if (sdp_send_req(session, t->reqbuf, reqsize) < 0) { SDPERR("Error sendind data:%s", strerror(errno)); + /* FIXME: how handle this error ? */ goto end; } err = 0; @@ -3563,12 +3558,14 @@ int sdp_process(sdp_session_t *session) end: if (err) { - if (t->rsp_concat_buf.data_size != 0) + if (t->rsp_concat_buf.data_size != 0) { pdata = t->rsp_concat_buf.data; + size = t->rsp_concat_buf.data_size; + } if (t->cb) t->cb(rsphdr->pdu_id, status, pdata, - t->size, t->udata); + size, t->udata); } if (rspbuf) -- cgit From 1be1f79648ba7aafde6349cfe51f9c929e20d018 Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Mon, 4 Sep 2006 17:13:33 +0000 Subject: Make sdp_connect() fully async aware --- include/sdp_lib.h | 2 + src/sdp.c | 158 ++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 102 insertions(+), 58 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index d61413c3..0e8948f9 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -80,6 +80,7 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u */ #define SDP_RETRY_IF_BUSY 0x01 #define SDP_WAIT_ON_CLOSE 0x02 +#define SDP_NON_BLOCKING 0x04 /* * a session with an SDP server @@ -125,6 +126,7 @@ typedef enum { * SDP transaction: functions for asynchronous search. */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); +int sdp_is_connected(sdp_session_t *session); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); diff --git a/src/sdp.c b/src/sdp.c index 1ce5e81b..2a054094 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -3041,21 +3042,33 @@ struct sdp_transaction { uint8_t *reqbuf; /* pointer to request PDU */ sdp_buf_t rsp_concat_buf; uint32_t reqsize; /* without cstate */ + uint8_t connected; }; +inline int sdp_is_connected(sdp_session_t *session) +{ + struct sdp_transaction *t = session->priv; + return t->connected; +} + +static inline void sdp_set_connected(sdp_session_t *session) +{ + struct sdp_transaction *t = session->priv; + t->connected = 1; +} + /* * Creates a new sdp session for asynchronous search * INPUT: * int sk - * non-blocking L2CAP socket - * + * non-blocking L2CAP socket + * * RETURN: * sdp_session_t * * NULL - On memory allocation failure */ sdp_session_t *sdp_create(int sk, uint32_t flags) { - sdp_session_t *session; struct sdp_transaction *t; @@ -3064,7 +3077,6 @@ sdp_session_t *sdp_create(int sk, uint32_t flags) errno = ENOMEM; return NULL; } - memset(session, 0, sizeof(*session)); session->flags = flags; @@ -3076,7 +3088,6 @@ sdp_session_t *sdp_create(int sk, uint32_t flags) free(session); return NULL; } - memset(t, 0, sizeof(*t)); session->priv = t; @@ -3826,71 +3837,101 @@ static inline int sdp_is_local(const bdaddr_t *device) return memcmp(device, BDADDR_LOCAL, sizeof(bdaddr_t)) == 0; } -sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags) +static int sdp_connect_local(sdp_session_t *session) { - sdp_session_t *session; - struct sdp_transaction *t; - int err; + struct sockaddr_un sa; + int ret; - session = malloc(sizeof(sdp_session_t)); - if (!session) - return session; + session->sock = socket(PF_UNIX, SOCK_STREAM, 0); + if (session->sock < 0) + return -1; + session->local = 1; - memset(session, 0, sizeof(*session)); + sa.sun_family = AF_UNIX; + strcpy(sa.sun_path, SDP_UNIX_PATH); - session->flags = flags; - session->sock = -1; + ret = connect(session->sock, (struct sockaddr *)&sa, sizeof(sa)); + if (!ret) + sdp_set_connected(session); - t = malloc(sizeof(struct sdp_transaction)); - if (!t) { - errno = ENOMEM; - free(session); - return NULL; + return ret; +} + +static int sdp_connect_l2cap(const bdaddr_t *src, + const bdaddr_t *dst, sdp_session_t *session) +{ + uint32_t flags = session->flags; + struct sockaddr_l2 sa; + int sk; + + session->sock = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); + if (session->sock < 0) + return -1; + session->local = 0; + + sk = session->sock; + + if (flags & SDP_NON_BLOCKING) { + long arg = fcntl(sk, F_GETFL, 0); + fcntl(sk, F_SETFL, arg | O_NONBLOCK); } - memset(t, 0, sizeof(*t)); + sa.l2_family = AF_BLUETOOTH; + sa.l2_psm = 0; - session->priv = t; + if (bacmp(src, BDADDR_ANY)) { + sa.l2_bdaddr = *src; + if (bind(sk, (struct sockaddr *) &sa, sizeof(sa)) < 0) + return -1; + } - if (sdp_is_local(dst)) { - struct sockaddr_un sa; - - // create local unix connection - session->sock = socket(PF_UNIX, SOCK_STREAM, 0); - session->local = 1; - if (session->sock >= 0) { - sa.sun_family = AF_UNIX; - strcpy(sa.sun_path, SDP_UNIX_PATH); - if (connect(session->sock, (struct sockaddr *)&sa, sizeof(sa)) == 0) - return session; + if (flags & SDP_WAIT_ON_CLOSE) { + struct linger l = { .l_onoff = 1, .l_linger = 1 }; + setsockopt(sk, SOL_SOCKET, SO_LINGER, &l, sizeof(l)); + } + + sa.l2_psm = htobs(SDP_PSM); + sa.l2_bdaddr = *dst; + + do { + int ret = connect(sk, (struct sockaddr *) &sa, sizeof(sa)); + if (!ret) { + sdp_set_connected(session); + return 0; } + if (ret < 0 && (flags & SDP_NON_BLOCKING) && + (errno == EAGAIN || errno == EINPROGRESS)) + return 0; + } while (errno == EBUSY && (flags & SDP_RETRY_IF_BUSY)); + + return -1; +} + +sdp_session_t *sdp_connect(const bdaddr_t *src, + const bdaddr_t *dst, uint32_t flags) +{ + sdp_session_t *session; + int err; + + if ((flags & SDP_RETRY_IF_BUSY) && (flags & SDP_NON_BLOCKING)) { + errno = EINVAL; + return NULL; + } + + session = sdp_create(-1, flags); + if (!session) + return NULL; + + if (sdp_is_local(dst)) { + if (sdp_connect_local(session) < 0) + goto fail; } else { - struct sockaddr_l2 sa; - - // create L2CAP connection - session->sock = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); - session->local = 0; - if (session->sock >= 0) { - sa.l2_family = AF_BLUETOOTH; - sa.l2_psm = 0; - if (bacmp(src, BDADDR_ANY) != 0) { - sa.l2_bdaddr = *src; - if (bind(session->sock, (struct sockaddr *) &sa, sizeof(sa)) < 0) - goto fail; - } - if (flags & SDP_WAIT_ON_CLOSE) { - struct linger l = { .l_onoff = 1, .l_linger = 1 }; - setsockopt(session->sock, SOL_SOCKET, SO_LINGER, &l, sizeof(l)); - } - sa.l2_psm = htobs(SDP_PSM); - sa.l2_bdaddr = *dst; - do - if (connect(session->sock, (struct sockaddr *) &sa, sizeof(sa)) == 0) - return session; - while (errno == EBUSY && (flags & SDP_RETRY_IF_BUSY)); - } + if (sdp_connect_l2cap(src, dst, session) < 0) + goto fail; } + return session; + fail: err = errno; if (session->sock >= 0) @@ -3899,7 +3940,8 @@ fail: free(session->priv); free(session); errno = err; - return 0; + + return NULL; } int sdp_get_socket(const sdp_session_t *session) -- cgit From aa7577018bb1faac4b67b52dc8b003663cdd03ad Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Mon, 4 Sep 2006 21:10:23 +0000 Subject: Remove connected flag from SDP transaction structure --- include/sdp_lib.h | 1 - src/sdp.c | 24 ++---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 0e8948f9..dbc836b2 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -126,7 +126,6 @@ typedef enum { * SDP transaction: functions for asynchronous search. */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); -int sdp_is_connected(sdp_session_t *session); sdp_session_t *sdp_create(int sk, uint32_t flags); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); diff --git a/src/sdp.c b/src/sdp.c index 2a054094..26f01eac 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3042,21 +3042,8 @@ struct sdp_transaction { uint8_t *reqbuf; /* pointer to request PDU */ sdp_buf_t rsp_concat_buf; uint32_t reqsize; /* without cstate */ - uint8_t connected; }; -inline int sdp_is_connected(sdp_session_t *session) -{ - struct sdp_transaction *t = session->priv; - return t->connected; -} - -static inline void sdp_set_connected(sdp_session_t *session) -{ - struct sdp_transaction *t = session->priv; - t->connected = 1; -} - /* * Creates a new sdp session for asynchronous search * INPUT: @@ -3840,7 +3827,6 @@ static inline int sdp_is_local(const bdaddr_t *device) static int sdp_connect_local(sdp_session_t *session) { struct sockaddr_un sa; - int ret; session->sock = socket(PF_UNIX, SOCK_STREAM, 0); if (session->sock < 0) @@ -3850,11 +3836,7 @@ static int sdp_connect_local(sdp_session_t *session) sa.sun_family = AF_UNIX; strcpy(sa.sun_path, SDP_UNIX_PATH); - ret = connect(session->sock, (struct sockaddr *)&sa, sizeof(sa)); - if (!ret) - sdp_set_connected(session); - - return ret; + return connect(session->sock, (struct sockaddr *)&sa, sizeof(sa)); } static int sdp_connect_l2cap(const bdaddr_t *src, @@ -3895,10 +3877,8 @@ static int sdp_connect_l2cap(const bdaddr_t *src, do { int ret = connect(sk, (struct sockaddr *) &sa, sizeof(sa)); - if (!ret) { - sdp_set_connected(session); + if (!ret) return 0; - } if (ret < 0 && (flags & SDP_NON_BLOCKING) && (errno == EAGAIN || errno == EINPROGRESS)) return 0; -- cgit From 113a53acaec2519108f0cab944687b7abc537e74 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Sep 2006 09:41:50 +0000 Subject: Remove sdp_cstate_t from the header file --- include/sdp_lib.h | 5 ----- src/sdp.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index dbc836b2..34082579 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -592,11 +592,6 @@ void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); int sdp_send_req_w4_rsp(sdp_session_t *session, uint8_t *req, uint8_t *rsp, uint32_t reqsize, uint32_t *rspsize); -typedef struct { - uint8_t length; - unsigned char data[16]; -} __attribute__ ((packed)) sdp_cstate_t; - #ifdef __cplusplus } #endif diff --git a/src/sdp.c b/src/sdp.c index 26f01eac..f961c7d3 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2720,6 +2720,11 @@ static int gen_attridseq_pdu(uint8_t *dst, const sdp_list_t *seq, uint8_t dataTy return gen_dataseq_pdu(dst, seq, dataType); } +typedef struct { + uint8_t length; + unsigned char data[16]; +} __attribute__ ((packed)) sdp_cstate_t; + static int copy_cstate(uint8_t *pdata, const sdp_cstate_t *cstate) { if (cstate) { -- cgit From 8bbf32450b3c72f5e8457feb825da029f3ecc76e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Sep 2006 09:44:32 +0000 Subject: Small code cleanup --- include/sdp_lib.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 34082579..343493b1 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -94,6 +94,19 @@ typedef struct { void *priv; } sdp_session_t; +typedef enum { + /* + * Attributes are specified as individual elements + */ + SDP_ATTR_REQ_INDIVIDUAL = 1, + /* + * Attributes are specified as a range + */ + SDP_ATTR_REQ_RANGE +} sdp_attrreq_type_t; + +typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); + /* * create an L2CAP connection to a Bluetooth device * @@ -110,28 +123,18 @@ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t fl int sdp_close(sdp_session_t *session); int sdp_get_socket(const sdp_session_t *session); -uint16_t sdp_gen_tid(sdp_session_t *session); - -typedef enum { - /* - * Attributes are specified as individual elements - */ - SDP_ATTR_REQ_INDIVIDUAL = 1, - /* - * Attributes are specified as a range - */ - SDP_ATTR_REQ_RANGE -} sdp_attrreq_type_t; /* * SDP transaction: functions for asynchronous search. */ -typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); sdp_session_t *sdp_create(int sk, uint32_t flags); +int sdp_process(sdp_session_t *session); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); + int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, uint16_t max_rec_num); int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *search, sdp_attrreq_type_t reqtype, const sdp_list_t *attrid_list); -int sdp_process(sdp_session_t *session); + +uint16_t sdp_gen_tid(sdp_session_t *session); /* * find all devices in the piconet -- cgit From 6d83e9274971235c05b40349dbbaf3f826853ff5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Sep 2006 09:52:42 +0000 Subject: Print only unitSize length of the strings --- src/sdp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index f961c7d3..c59a6157 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1149,13 +1149,13 @@ void sdp_record_print(const sdp_record_t *rec) { sdp_data_t *d = sdp_data_get(rec, SDP_ATTR_SVCNAME_PRIMARY); if (d) - printf("Service Name: %s\n", d->val.str); + printf("Service Name: %.*s\n", d->unitSize, d->val.str); d = sdp_data_get(rec, SDP_ATTR_SVCDESC_PRIMARY); if (d) - printf("Service Description: %s\n", d->val.str); + printf("Service Description: %.*s\n", d->unitSize, d->val.str); d = sdp_data_get(rec, SDP_ATTR_PROVNAME_PRIMARY); if (d) - printf("Service Provider: %s\n", d->val.str); + printf("Service Provider: %.*s\n", d->unitSize, d->val.str); } #ifdef SDP_DEBUG -- cgit From 997f54c70b25706839544018ad15a718911eb45f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 Sep 2006 10:17:46 +0000 Subject: Cleanup of some memory usage --- src/sdp.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index c59a6157..ccbc1657 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -90,9 +90,6 @@ static inline void ntoh128(uint128_t *src, uint128_t *dst) static uint128_t *bluetooth_base_uuid = NULL; -#define SDP_BASIC_ATTR_PDUFORM_SIZE 32 -#define SDP_SEQ_PDUFORM_SIZE 128 -#define SDP_UUID_SEQ_SIZE 256 #define SDP_MAX_ATTR_LEN 65535 /* Message structure. */ @@ -808,14 +805,15 @@ static void sdp_attr_pdu(void *value, void *udata) int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *buf) { buf->data = malloc(SDP_PDU_CHUNK_SIZE); - if (buf->data) { - buf->buf_size = SDP_PDU_CHUNK_SIZE; - buf->data_size = 0; - memset(buf->data, 0, buf->buf_size); - sdp_list_foreach(rec->attrlist, sdp_attr_pdu, buf); - return 0; - } - return -1; + if (!buf->data) + return -ENOMEM; + + buf->buf_size = SDP_PDU_CHUNK_SIZE; + buf->data_size = 0; + memset(buf->data, 0, buf->buf_size); + sdp_list_foreach(rec->attrlist, sdp_attr_pdu, buf); + + return 0; } void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *d) @@ -2376,12 +2374,14 @@ void sdp_append_to_buf(sdp_buf_t *dst, uint8_t *data, uint32_t len) void sdp_append_to_pdu(sdp_buf_t *pdu, sdp_data_t *d) { - uint8_t buf[SDP_SEQ_PDUFORM_SIZE]; + uint8_t buf[256]; sdp_buf_t append; + memset(&append, 0, sizeof(sdp_buf_t)); append.data = buf; append.buf_size = sizeof(buf); append.data_size = 0; + sdp_set_attrid(&append, d->attrId); sdp_gen_pdu(&append, d); sdp_append_to_buf(pdu, append.data, append.data_size); @@ -2679,8 +2679,11 @@ static int gen_dataseq_pdu(uint8_t *dst, const sdp_list_t *seq, uint8_t dtd) SDPDBG(""); memset(&buf, 0, sizeof(sdp_buf_t)); - buf.data = malloc(SDP_UUID_SEQ_SIZE); - buf.buf_size = SDP_UUID_SEQ_SIZE; + buf.data = malloc(256); + buf.buf_size = 256; + + if (!buf.data) + return -ENOMEM; SDPDBG("Seq length : %d\n", seqlen); -- cgit From 0f49354526ab98dc4e78c112343dcdc03efb26f6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 Sep 2006 12:30:10 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c12f479b..233c6b5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.5: + Add asynchronous API for SDP. + ver 3.4: Fix UUID128 string lookup handling. Fix malloc() versus bt_malloc() usage. diff --git a/configure.in b/configure.in index 2a863382..69d7d11c 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.4) +AM_INIT_AUTOMAKE(bluez-libs, 3.5) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 7fc9da99..c4497674 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 4:1:2 +libbluetooth_la_LDFLAGS = -version-info 5:0:3 INCLUDES = -I$(top_builddir)/include -- cgit From 5ec20cab698055029198b10afb4db20bee06ce72 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 11 Sep 2006 20:55:05 +0000 Subject: fixed error handling in sdp_process( ) --- include/sdp_lib.h | 10 +++++++ src/sdp.c | 89 +++++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 74 insertions(+), 25 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 343493b1..9a83586f 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -105,6 +105,15 @@ typedef enum { SDP_ATTR_REQ_RANGE } sdp_attrreq_type_t; +/* + * When the pdu_id(type) is a sdp error response, check the status value + * to figure out the error reason. For status values 0x0001-0x0006 check + * Bluetooth SPEC. If the status is 0xffff, call sdp_get_error function + * to get the real reason: + * - wrong transaction ID(EPROTO) + * - wrong PDU id or(EPROTO) + * - I/O error + */ typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata); /* @@ -127,6 +136,7 @@ int sdp_get_socket(const sdp_session_t *session); * SDP transaction: functions for asynchronous search. */ sdp_session_t *sdp_create(int sk, uint32_t flags); +int sdp_get_error(sdp_session_t *session); int sdp_process(sdp_session_t *session); int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata); diff --git a/src/sdp.c b/src/sdp.c index ccbc1657..e311f014 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3050,6 +3050,7 @@ struct sdp_transaction { uint8_t *reqbuf; /* pointer to request PDU */ sdp_buf_t rsp_concat_buf; uint32_t reqsize; /* without cstate */ + int err; /* ZERO if success or the errno if failed */ }; /* @@ -3437,6 +3438,35 @@ end: return -1; } +/* + * Function used to get the error reason after sdp_callback_t function has been called + * and the status is 0xffff. It indicates that an error NOT related to SDP_ErrorResponse + * happened. Get errno directly is not safe because multiple transactions can be triggered. + * This function must be used with asynchronous sdp functions only. + * + * INPUT: + * sdp_session_t *session + * Current sdp session to be handled + * RETURN: + * 0 = No error in the current transaction + * -1 - if the session is invalid + * positive value - the errno value + * + */ +int sdp_get_error(sdp_session_t *session) +{ + struct sdp_transaction *t; + + if (!session || !session->priv) { + SDPERR("Invalid session"); + return -1; + } + + t = session->priv; + + return t->err; +} + /* * Receive the incomming SDP PDU. This function must be called when there is data * available to be read. On continuation state, the original request (with a new @@ -3452,14 +3482,14 @@ end: */ int sdp_process(sdp_session_t *session) { - struct sdp_transaction *t = NULL; - sdp_pdu_hdr_t *reqhdr = NULL; - sdp_pdu_hdr_t *rsphdr = NULL; - sdp_cstate_t *pcstate = NULL; - uint8_t *pdata = NULL, *rspbuf = NULL, *targetPtr = NULL; - int rsp_count = 0, err = -1; + struct sdp_transaction *t; + sdp_pdu_hdr_t *reqhdr, *rsphdr; + sdp_cstate_t *pcstate; + uint8_t *pdata, *rspbuf, *targetPtr; + int rsp_count, err = -1; size_t size = 0; - uint16_t status = 0; + uint16_t status = 0xffff; + uint8_t pdu_id = 0x00; if (!session || !session->priv) { SDPERR("Invalid session"); @@ -3467,8 +3497,11 @@ int sdp_process(sdp_session_t *session) } rspbuf = malloc(SDP_RSP_BUFFER_SIZE); - if (!rspbuf) + if (!rspbuf) { + SDPERR("Response buffer alloc failure:%s (%d)", + strerror(errno), errno); return -1; + } memset(rspbuf, 0, SDP_RSP_BUFFER_SIZE); @@ -3476,20 +3509,21 @@ int sdp_process(sdp_session_t *session) reqhdr = (sdp_pdu_hdr_t *)t->reqbuf; rsphdr = (sdp_pdu_hdr_t *)rspbuf; - if (sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE) <= 0) - goto end; + pdata = rspbuf + sizeof(sdp_pdu_hdr_t); - if (reqhdr->tid != rsphdr->tid) + if (sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE) <= 0) { + SDPERR("Read response:%s (%d)", strerror(errno), errno); + t->err = errno; goto end; + } - pdata = rspbuf + sizeof(sdp_pdu_hdr_t); - - if (rsphdr->pdu_id == SDP_ERROR_RSP) { - status = ntohs(bt_get_unaligned((uint16_t *) pdata)); - size = rsphdr->plen; + if (reqhdr->tid != rsphdr->tid) { + t->err = EPROTO; + SDPERR("Wrong transaction ID."); goto end; } + pdu_id = rsphdr->pdu_id; switch (rsphdr->pdu_id) { uint8_t *ssr_pdata; uint16_t tsrc, csrc; @@ -3512,6 +3546,7 @@ int sdp_process(sdp_session_t *session) pdata += 2 * sizeof(uint16_t); /* Ignore TSRC and CSRC */ rsp_count = csrc * 4; } + status = 0x0000; break; case SDP_SVC_ATTR_RSP: case SDP_SVC_SEARCH_ATTR_RSP: @@ -3519,10 +3554,15 @@ int sdp_process(sdp_session_t *session) SDPDBG("Attrlist byte count : %d\n", rsp_count); pdata += sizeof(uint16_t); // points to attribute list + status = 0x0000; break; + case SDP_ERROR_RSP: + status = ntohs(bt_get_unaligned((uint16_t *) pdata)); + size = rsphdr->plen; + goto end; default: - /* FIXME: how handle this situation? */ - SDPDBG("Illegal PDU ID!"); + t->err = EPROTO; + SDPERR("Illegal PDU ID: 0x%x", rsphdr->pdu_id); goto end; } @@ -3531,7 +3571,7 @@ int sdp_process(sdp_session_t *session) SDPDBG("Cstate length : %d\n", pcstate->length); /* * This is a split response, need to concatenate intermediate - * responses and the last one which will have cstate_len == 0 + * responses and the last one which will have cstate length == 0 */ // build concatenated response buffer @@ -3546,7 +3586,7 @@ int sdp_process(sdp_session_t *session) reqhdr->tid = htons(sdp_gen_tid(session)); - // add continuation state (can be null) + // add continuation state cstate_len = copy_cstate(t->reqbuf + t->reqsize, pcstate); reqsize = t->reqsize + cstate_len; @@ -3555,8 +3595,9 @@ int sdp_process(sdp_session_t *session) reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); if (sdp_send_req(session, t->reqbuf, reqsize) < 0) { - SDPERR("Error sendind data:%s", strerror(errno)); - /* FIXME: how handle this error ? */ + SDPERR("Error sendind data:%s(%d)", strerror(errno), errno); + status = 0xffff; + t->err = errno; goto end; } err = 0; @@ -3568,10 +3609,8 @@ end: pdata = t->rsp_concat_buf.data; size = t->rsp_concat_buf.data_size; } - if (t->cb) - t->cb(rsphdr->pdu_id, status, pdata, - size, t->udata); + t->cb(pdu_id, status, pdata, size, t->udata); } if (rspbuf) -- cgit From f207a4f0f6d5d38a3e357f62d4976bedaed2cf4f Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 13 Sep 2006 18:21:48 +0000 Subject: fixed search transaction reqbuf double free --- src/sdp.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index e311f014..d82a23d7 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3204,10 +3204,9 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u return 0; end: - if (t) { - if (t->reqbuf) - free(t->reqbuf); - free(t); + if (t->reqbuf) { + free(t->reqbuf); + t->reqbuf = NULL; } return -1; @@ -3314,10 +3313,9 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ return 0; end: - if (t) { - if (t->reqbuf) - free(t->reqbuf); - free(t); + if (t->reqbuf) { + free(t->reqbuf); + t->reqbuf = NULL; } return -1; @@ -3429,10 +3427,9 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear return 0; end: - if (t) { - if (t->reqbuf) - free(t->reqbuf); - free(t); + if (t->reqbuf) { + free(t->reqbuf); + t->reqbuf = NULL; } return -1; -- cgit From 12f41aa6ff9529a80a182754d0855dccb11978ac Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 13 Sep 2006 21:33:19 +0000 Subject: Use transaction err instead of errno for *_async funcs --- src/sdp.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index d82a23d7..3e56f490 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3155,15 +3155,13 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u uint8_t *pdata; int cstate_len, seqlen = 0; - if (!session || !session->priv) { - errno = EINVAL; + if (!session || !session->priv) return -1; - } t = session->priv; t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); if (!t->reqbuf) { - errno = ENOMEM; + t->err = ENOMEM; goto end; } @@ -3191,13 +3189,13 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u t->reqsize += sizeof(uint16_t); pdata += sizeof(uint16_t); - // set the request header's param length cstate_len = copy_cstate(pdata, NULL); reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t)); if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { SDPERR("Error sendind data:%s", strerror(errno)); + t->err = errno; goto end; } @@ -3255,15 +3253,13 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ uint8_t *pdata; int cstate_len, seqlen = 0; - if (!session || !session->priv) { - errno = EINVAL; + if (!session || !session->priv) return -1; - } t = session->priv; t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); if (!t->reqbuf) { - errno = ENOMEM; + t->err = ENOMEM; goto end; } @@ -3292,7 +3288,7 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ seqlen = gen_attridseq_pdu(pdata, attrid_list, reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32); if (seqlen == -1) { - errno = EINVAL; + t->err = EINVAL; goto end; } @@ -3307,6 +3303,7 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { SDPERR("Error sendind data:%s", strerror(errno)); + t->err = errno; goto end; } @@ -3365,15 +3362,13 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear uint8_t *pdata; int cstate_len, seqlen = 0; - if (!session || !session->priv) { - errno = EINVAL; + if (!session || !session->priv) return -1; - } t = session->priv; t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); if (!t->reqbuf) { - errno = ENOMEM; + t->err = ENOMEM; goto end; } @@ -3407,7 +3402,7 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear seqlen = gen_attridseq_pdu(pdata, attrid_list, reqtype == SDP_ATTR_REQ_INDIVIDUAL ? SDP_UINT16 : SDP_UINT32); if (seqlen == -1) { - errno = EINVAL; + t->err = EINVAL; goto end; } @@ -3421,6 +3416,7 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { SDPERR("Error sendind data:%s", strerror(errno)); + t->err = errno; goto end; } @@ -3437,8 +3433,9 @@ end: /* * Function used to get the error reason after sdp_callback_t function has been called - * and the status is 0xffff. It indicates that an error NOT related to SDP_ErrorResponse - * happened. Get errno directly is not safe because multiple transactions can be triggered. + * and the status is 0xffff or if sdp_service_{search, attr, search_attr}_async returns -1. + * It indicates that an error NOT related to SDP_ErrorResponse happened. Get errno directly + * is not safe because multiple transactions can be triggered. * This function must be used with asynchronous sdp functions only. * * INPUT: -- cgit From 18a82a6fce76be0883a431380495510010515fff Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 13 Sep 2006 21:45:21 +0000 Subject: avoid multiple allocs/leak in *_async calls --- src/sdp.c | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 3e56f490..a9187865 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3159,14 +3159,20 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u return -1; t = session->priv; - t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + + /* check if the buffer is already allocated */ + if (t->rsp_concat_buf.data) + free(t->rsp_concat_buf.data); + memset(&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); + if (!t->reqbuf) { - t->err = ENOMEM; - goto end; + t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + if (!t->reqbuf) { + t->err = ENOMEM; + goto end; + } } - memset(t->reqbuf, 0, SDP_REQ_BUFFER_SIZE); - memset((char *)&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); reqhdr = (sdp_pdu_hdr_t *) t->reqbuf; reqhdr->tid = htons(sdp_gen_tid(session)); @@ -3257,14 +3263,20 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ return -1; t = session->priv; - t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + + /* check if the buffer is already allocated */ + if (t->rsp_concat_buf.data) + free(t->rsp_concat_buf.data); + memset(&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); + if (!t->reqbuf) { - t->err = ENOMEM; - goto end; + t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + if (!t->reqbuf) { + t->err = ENOMEM; + goto end; + } } - memset(t->reqbuf, 0, SDP_REQ_BUFFER_SIZE); - memset((char *)&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); reqhdr = (sdp_pdu_hdr_t *) t->reqbuf; reqhdr->tid = htons(sdp_gen_tid(session)); @@ -3366,14 +3378,20 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear return -1; t = session->priv; - t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + + /* check if the buffer is already allocated */ + if (t->rsp_concat_buf.data) + free(t->rsp_concat_buf.data); + memset(&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); + if (!t->reqbuf) { - t->err = ENOMEM; - goto end; + t->reqbuf = malloc(SDP_REQ_BUFFER_SIZE); + if (!t->reqbuf) { + t->err = ENOMEM; + goto end; + } } - memset(t->reqbuf, 0, SDP_REQ_BUFFER_SIZE); - memset((char *)&t->rsp_concat_buf, 0, sizeof(sdp_buf_t)); reqhdr = (sdp_pdu_hdr_t *) t->reqbuf; reqhdr->tid = htons(sdp_gen_tid(session)); -- cgit From b214431051ac907f47cc8e798216869c5a5e1d5a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 24 Sep 2006 19:25:32 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 233c6b5e..56f14715 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.6: + Fix issues with the asynchronous API for SDP. + ver 3.5: Add asynchronous API for SDP. diff --git a/configure.in b/configure.in index 69d7d11c..e4c3ab35 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.5) +AM_INIT_AUTOMAKE(bluez-libs, 3.6) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index c4497674..bcf2543d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 5:0:3 +libbluetooth_la_LDFLAGS = -version-info 6:0:4 INCLUDES = -I$(top_builddir)/include -- cgit From 9203084c0b92805006c133f82fbc0cbd6b203904 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 28 Sep 2006 19:30:01 +0000 Subject: sdp_process:check if the PDU length match with the received data --- src/sdp.c | 55 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index a9187865..7e7698b2 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3500,6 +3500,7 @@ int sdp_process(sdp_session_t *session) uint8_t *pdata, *rspbuf, *targetPtr; int rsp_count, err = -1; size_t size = 0; + int n, plen; uint16_t status = 0xffff; uint8_t pdu_id = 0x00; @@ -3523,15 +3524,17 @@ int sdp_process(sdp_session_t *session) pdata = rspbuf + sizeof(sdp_pdu_hdr_t); - if (sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE) <= 0) { + n = sdp_read_rsp(session, rspbuf, SDP_RSP_BUFFER_SIZE); + if (n < 0) { SDPERR("Read response:%s (%d)", strerror(errno), errno); t->err = errno; goto end; } - if (reqhdr->tid != rsphdr->tid) { + if (n == 0 || reqhdr->tid != rsphdr->tid || + (n != (ntohs(rsphdr->plen) + sizeof(sdp_pdu_hdr_t)))) { t->err = EPROTO; - SDPERR("Wrong transaction ID."); + SDPERR("Protocol error."); goto end; } @@ -3541,19 +3544,30 @@ int sdp_process(sdp_session_t *session) uint16_t tsrc, csrc; case SDP_SVC_SEARCH_RSP: /* - * TSRC: Total Service Record Count - * CSRC: Current Service Record Count + * TSRC: Total Service Record Count (2 bytes) + * CSRC: Current Service Record Count (2 bytes) */ ssr_pdata = pdata; - ssr_pdata += sizeof(tsrc); tsrc = ntohs(bt_get_unaligned((uint16_t *) ssr_pdata)); + ssr_pdata += sizeof(uint16_t); csrc = ntohs(bt_get_unaligned((uint16_t *) ssr_pdata)); + /* csrc should never be larger than tsrc */ + if (csrc > tsrc) { + t->err = EPROTO; + SDPERR("Protocol error: wrong current service record count value."); + goto end; + } + + SDPDBG("Total svc count: %d\n", tsrc); + SDPDBG("Current svc count: %d\n", csrc); + + /* parameter length without continuation state */ + plen = sizeof(tsrc) + sizeof(csrc) + csrc * 4; + if (t->rsp_concat_buf.data_size == 0) { /* first fragment */ rsp_count = sizeof(tsrc) + sizeof(csrc) + csrc * 4; - SDPDBG("Total svc count: %d\n", tsrc); - SDPDBG("Current svc count: %d\n", csrc); } else { pdata += 2 * sizeof(uint16_t); /* Ignore TSRC and CSRC */ rsp_count = csrc * 4; @@ -3564,13 +3578,22 @@ int sdp_process(sdp_session_t *session) case SDP_SVC_SEARCH_ATTR_RSP: rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); SDPDBG("Attrlist byte count : %d\n", rsp_count); + + /* + * Number of bytes in the AttributeLists parameter(without + * continuation state) + AttributeListsByteCount field size. + */ + plen = sizeof(uint16_t) + rsp_count; pdata += sizeof(uint16_t); // points to attribute list status = 0x0000; break; case SDP_ERROR_RSP: status = ntohs(bt_get_unaligned((uint16_t *) pdata)); - size = rsphdr->plen; + size = ntohs(rsphdr->plen); + + /* error code + error info */ + plen = size; goto end; default: t->err = EPROTO; @@ -3581,12 +3604,22 @@ int sdp_process(sdp_session_t *session) pcstate = (sdp_cstate_t *) (pdata + rsp_count); SDPDBG("Cstate length : %d\n", pcstate->length); + + /* + * Check out of bound. Continuation state must have at least + * 1 byte: ZERO to indicate that it is not a partial response. + */ + if ((n - sizeof(sdp_pdu_hdr_t)) != (plen + pcstate->length + 1)) { + t->err = EPROTO; + SDPERR("Protocol error: wrong PDU size."); + status = 0xffff; + goto end; + } + /* * This is a split response, need to concatenate intermediate * responses and the last one which will have cstate length == 0 */ - - // build concatenated response buffer t->rsp_concat_buf.data = realloc(t->rsp_concat_buf.data, t->rsp_concat_buf.data_size + rsp_count); targetPtr = t->rsp_concat_buf.data + t->rsp_concat_buf.data_size; t->rsp_concat_buf.buf_size = t->rsp_concat_buf.data_size + rsp_count; -- cgit From e3dbc939bd096c8604d1480e0994f73f65a39f16 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 28 Sep 2006 21:36:48 +0000 Subject: fixed csrc for partial responses --- src/sdp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 7e7698b2..0eeb5a09 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3569,7 +3569,17 @@ int sdp_process(sdp_session_t *session) /* first fragment */ rsp_count = sizeof(tsrc) + sizeof(csrc) + csrc * 4; } else { - pdata += 2 * sizeof(uint16_t); /* Ignore TSRC and CSRC */ + /* point to the first csrc */ + uint16_t *pcsrc = (uint16_t *) (t->rsp_concat_buf.data + 2); + + /* FIXME: update the interface later. csrc doesn't need be passed to clients */ + + pdata += sizeof(uint16_t); /* point to csrc */ + + /* the first csrc contains the sum of partial csrc responses */ + *pcsrc += bt_get_unaligned((uint16_t *) pdata); + + pdata += sizeof(uint16_t); /* point to the first handle */ rsp_count = csrc * 4; } status = 0x0000; -- cgit From 3c8d737f3ebcd49548d364e8976f0ca1cdb4e5ae Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 29 Sep 2006 21:11:37 +0000 Subject: Update changelog and bump version number --- ChangeLog | 4 ++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56f14715..cf3db9bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +ver 3.7: + Add additional PDU length checks. + Fix CSRC value for partial responses. + ver 3.6: Fix issues with the asynchronous API for SDP. diff --git a/configure.in b/configure.in index e4c3ab35..6c38b2a4 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.6) +AM_INIT_AUTOMAKE(bluez-libs, 3.7) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index bcf2543d..10abc721 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 6:0:4 +libbluetooth_la_LDFLAGS = -version-info 6:1:4 INCLUDES = -I$(top_builddir)/include -- cgit From 82817924a25fb0eaaeb9824372106870c45c9db9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Nov 2006 18:30:16 +0000 Subject: Add functions for registering binary records --- include/sdp_lib.h | 13 ++++--- src/sdp.c | 103 +++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 82 insertions(+), 34 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 9a83586f..05bfa7d4 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -443,22 +443,25 @@ void sdp_record_free(sdp_record_t *rec); * the service record visible to SDP clients. This function returns 0 * on success or -1 on failure (and sets errno). */ -int sdp_record_register(sdp_session_t *sess, sdp_record_t *rec, uint8_t flags); -int sdp_device_record_register(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec, uint8_t flags); +int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, uint8_t *data, uint32_t size, uint8_t flags, uint32_t *handle); +int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec, uint8_t flags); +int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags); /* * Unregister a service record. */ -int sdp_record_unregister(sdp_session_t *sess, sdp_record_t *rec); -int sdp_device_record_unregister(sdp_session_t *sess, bdaddr_t *device, sdp_record_t *rec); +int sdp_device_record_unregister_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle); +int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec); +int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec); /* * Update an existing service record. (Calling this function * before a previous call to sdp_record_register() will result * in an error.) */ +int sdp_device_record_update_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle, uint8_t *data, uint32_t size); +int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp_record_t *rec); int sdp_record_update(sdp_session_t *sess, const sdp_record_t *rec); -int sdp_device_record_update(sdp_session_t *sess, bdaddr_t *device, const sdp_record_t *rec); void sdp_record_print(const sdp_record_t *rec); diff --git a/src/sdp.c b/src/sdp.c index 0eeb5a09..d83dea76 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2395,13 +2395,12 @@ void sdp_append_to_pdu(sdp_buf_t *pdu, sdp_data_t *d) * * Returns zero on success, otherwise -1 (and sets errno). */ -int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec, uint8_t flags) +int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, uint8_t *data, uint32_t size, uint8_t flags, uint32_t *handle) { - int status = 0; uint8_t *req, *rsp, *p; uint32_t reqsize, rspsize; sdp_pdu_hdr_t *reqhdr, *rsphdr; - sdp_buf_t pdu; + int status; SDPDBG(""); @@ -2416,16 +2415,13 @@ int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_rec errno = ENOMEM; goto end; } - if (rec->handle && rec->handle != 0xffffffff) { - uint32_t handle = rec->handle; - sdp_data_t *data = sdp_data_alloc(SDP_UINT32, &handle); - sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, data); - } + reqhdr = (sdp_pdu_hdr_t *)req; reqhdr->pdu_id = SDP_SVC_REGISTER_REQ; reqhdr->tid = htons(sdp_gen_tid(session)); reqsize = sizeof(sdp_pdu_hdr_t) + 1; p = req + sizeof(sdp_pdu_hdr_t); + if (bacmp(device, BDADDR_ANY)) { *p++ = flags | SDP_DEVICE_RECORD; bacpy((bdaddr_t *) p, device); @@ -2433,35 +2429,66 @@ int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_rec reqsize += sizeof(bdaddr_t); } else *p++ = flags; - if (sdp_gen_record_pdu(rec, &pdu) < 0) { - status = -1; - errno = ENOMEM; - goto end; - } - memcpy(p, pdu.data, pdu.data_size); - free(pdu.data); - reqsize += pdu.data_size; + + memcpy(p, data, size); + reqsize += size; reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); status = sdp_send_req_w4_rsp(session, req, rsp, reqsize, &rspsize); if (status < 0) goto end; + rsphdr = (sdp_pdu_hdr_t *) rsp; p = rsp + sizeof(sdp_pdu_hdr_t); + if (rsphdr->pdu_id == SDP_SVC_REGISTER_RSP) { - uint32_t handle = ntohl(bt_get_unaligned((uint32_t *) p)); - sdp_data_t *data = sdp_data_alloc(SDP_UINT32, &handle); - rec->handle = handle; - sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, data); + if (handle) + *handle = ntohl(bt_get_unaligned((uint32_t *) p)); } + end: if (req) free(req); + if (rsp) free(rsp); + return status; } +int sdp_device_record_register(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec, uint8_t flags) +{ + sdp_buf_t pdu; + uint32_t handle; + int err; + + SDPDBG(""); + + if (rec->handle && rec->handle != 0xffffffff) { + uint32_t handle = rec->handle; + sdp_data_t *data = sdp_data_alloc(SDP_UINT32, &handle); + sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, data); + } + + if (sdp_gen_record_pdu(rec, &pdu) < 0) { + errno = ENOMEM; + return -1; + } + + err = sdp_device_record_register_binary(session, device, + pdu.data, pdu.data_size, flags, &handle); + + free(pdu.data); + + if (err == 0) { + sdp_data_t *data = sdp_data_alloc(SDP_UINT32, &handle); + rec->handle = handle; + sdp_attr_replace(rec, SDP_ATTR_RECORD_HANDLE, data); + } + + return err; +} + int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags) { return sdp_device_record_register(session, BDADDR_ANY, rec, flags); @@ -2470,25 +2497,25 @@ int sdp_record_register(sdp_session_t *session, sdp_record_t *rec, uint8_t flags /* * unregister a service record */ -int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec) +int sdp_device_record_unregister_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle) { - int status = 0; uint8_t *reqbuf, *rspbuf, *p; uint32_t reqsize = 0, rspsize = 0; sdp_pdu_hdr_t *reqhdr, *rsphdr; - uint32_t handle = 0; + int status; SDPDBG(""); - handle = rec->handle; if (handle == SDP_SERVER_RECORD_HANDLE) { errno = EINVAL; return -1; } + if (!session->local) { errno = EREMOTE; return -1; } + reqbuf = malloc(SDP_REQ_BUFFER_SIZE); rspbuf = malloc(SDP_RSP_BUFFER_SIZE); if (!reqbuf || !rspbuf) { @@ -2511,19 +2538,31 @@ int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_r rsphdr = (sdp_pdu_hdr_t *) rspbuf; p = rspbuf + sizeof(sdp_pdu_hdr_t); status = bt_get_unaligned((uint16_t *) p); - if (status == 0 && rsphdr->pdu_id == SDP_SVC_REMOVE_RSP) { - SDPDBG("Removing local copy\n"); - sdp_record_free(rec); - } + if (status != 0 || rsphdr->pdu_id != SDP_SVC_REMOVE_RSP) + status = -1; } + end: if (reqbuf) free(reqbuf); + if (rspbuf) free(rspbuf); + return status; } +int sdp_device_record_unregister(sdp_session_t *session, bdaddr_t *device, sdp_record_t *rec) +{ + int err; + + err = sdp_device_record_unregister_binary(session, device, rec->handle); + if (err == 0) + sdp_record_free(rec); + + return err; +} + int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) { return sdp_device_record_unregister(session, BDADDR_ANY, rec); @@ -2532,16 +2571,22 @@ int sdp_record_unregister(sdp_session_t *session, sdp_record_t *rec) /* * modify an existing service record */ +int sdp_device_record_update_binary(sdp_session_t *session, bdaddr_t *device, uint32_t handle, uint8_t *data, uint32_t size) +{ + return -1; +} + int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp_record_t *rec) { - int status = 0; uint8_t *reqbuf, *rspbuf, *p; uint32_t reqsize, rspsize; sdp_pdu_hdr_t *reqhdr, *rsphdr; uint32_t handle; sdp_buf_t pdu; + int status; SDPDBG(""); + handle = rec->handle; if (handle == SDP_SERVER_RECORD_HANDLE) { -- cgit From a7c82c586998da5b64e680a9027a6f5aeba915f5 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 9 Nov 2006 21:25:30 +0000 Subject: handling invalid sdp record sintax for registration/unregistration/update --- src/sdp.c | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index d83dea76..d55f3159 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2441,7 +2441,14 @@ int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, rsphdr = (sdp_pdu_hdr_t *) rsp; p = rsp + sizeof(sdp_pdu_hdr_t); - if (rsphdr->pdu_id == SDP_SVC_REGISTER_RSP) { + if (rsphdr->pdu_id == SDP_ERROR_RSP) { + /* Invalid service record */ + errno = EINVAL; + status = -1; + } else if (rsphdr->pdu_id != SDP_SVC_REGISTER_RSP) { + errno = EPROTO; + status = -1; + } else { if (handle) *handle = ntohl(bt_get_unaligned((uint32_t *) p)); } @@ -2534,14 +2541,21 @@ int sdp_device_record_unregister_binary(sdp_session_t *session, bdaddr_t *device reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); - if (status == 0) { - rsphdr = (sdp_pdu_hdr_t *) rspbuf; - p = rspbuf + sizeof(sdp_pdu_hdr_t); - status = bt_get_unaligned((uint16_t *) p); - if (status != 0 || rsphdr->pdu_id != SDP_SVC_REMOVE_RSP) - status = -1; - } + if (status < 0) + goto end; + + rsphdr = (sdp_pdu_hdr_t *) rspbuf; + p = rspbuf + sizeof(sdp_pdu_hdr_t); + status = bt_get_unaligned((uint16_t *) p); + if (rsphdr->pdu_id == SDP_ERROR_RSP) { + /* For this case the status always is invalid record handle */ + errno = EINVAL; + status = -1; + } else if (rsphdr->pdu_id != SDP_SVC_REMOVE_RSP) { + errno = EPROTO; + status = -1; + } end: if (reqbuf) free(reqbuf); @@ -2625,13 +2639,22 @@ int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); + if (status < 0) + goto end; SDPDBG("Send req status : %d\n", status); - if (status == 0) { - rsphdr = (sdp_pdu_hdr_t *) rspbuf; - p = rspbuf + sizeof(sdp_pdu_hdr_t); - status = bt_get_unaligned((uint16_t *) p); + rsphdr = (sdp_pdu_hdr_t *) rspbuf; + p = rspbuf + sizeof(sdp_pdu_hdr_t); + status = bt_get_unaligned((uint16_t *) p); + + if (rsphdr->pdu_id == SDP_ERROR_RSP) { + /* The status can be invalid sintax or invalid record handle */ + errno = EINVAL; + status = -1; + } else if (rsphdr->pdu_id != SDP_SVC_UPDATE_RSP) { + errno = EPROTO; + status = -1; } end: if (reqbuf) -- cgit From 85a6b6ed56f25eb8f766b2efbbf0c86aa9848c3a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 25 Dec 2006 13:45:52 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf3db9bb..a6250694 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.8: + Add functions for registering binary records. + ver 3.7: Add additional PDU length checks. Fix CSRC value for partial responses. diff --git a/configure.in b/configure.in index 6c38b2a4..46301fa9 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.7) +AM_INIT_AUTOMAKE(bluez-libs, 3.8) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 10abc721..79bcaaa5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 6:1:4 +libbluetooth_la_LDFLAGS = -version-info 7:0:5 INCLUDES = -I$(top_builddir)/include -- cgit From 25effaf3a661c4de960ebae7125ba56a990ad628 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 13 Jan 2007 17:50:06 +0000 Subject: Update copyright information --- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- src/bluetooth.c | 2 +- src/hci.c | 2 +- src/sdp.c | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/bluetooth.h b/include/bluetooth.h index 2ad82a7d..1362ed82 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 13f10015..90b650ea 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index 72bd7e13..e81a9ecc 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index 0454f96e..46f97bb7 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index 20af8bdb..a784a08b 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index 71d0150a..580495f5 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2006 Marcel Holtmann + * Copyright (C) 2003-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index d2320f46..5c173e28 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index 7537f958..6cdfb614 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index 4777640c..836784a0 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index f6af1261..8a78ba30 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 05bfa7d4..45f96e4d 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/src/bluetooth.c b/src/bluetooth.c index 645a4d63..33e033ad 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/hci.c b/src/hci.c index f7235f74..7d30c552 100644 --- a/src/hci.c +++ b/src/hci.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/sdp.c b/src/sdp.c index d55f3159..4270ac83 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2006 Marcel Holtmann + * Copyright (C) 2002-2007 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From 233a4572376f767603890c71f240458c23f821b1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 28 Jan 2007 20:35:48 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a6250694..a1734b69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.9: + Update copyright information. + ver 3.8: Add functions for registering binary records. diff --git a/configure.in b/configure.in index 46301fa9..46a65bce 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.8) +AM_INIT_AUTOMAKE(bluez-libs, 3.9) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 397609f69cbc21cfd87b27246f4f5ed9dada646d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 13 Feb 2007 14:44:47 +0000 Subject: Add version code for Bluetooth 2.1 --- src/hci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hci.c b/src/hci.c index 7d30c552..a064980f 100644 --- a/src/hci.c +++ b/src/hci.c @@ -505,6 +505,7 @@ static hci_map ver_map[] = { { "1.1", 0x01 }, { "1.2", 0x02 }, { "2.0", 0x03 }, + { "2.1", 0x04 }, { NULL } }; -- cgit From 5f17af319f0caee2243c5471a6500742ad7d6576 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 5 Mar 2007 20:54:48 +0000 Subject: Export sdp_uuid32_to_uuid128() function --- include/sdp_lib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 45f96e4d..9a8ab4fd 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -475,6 +475,7 @@ int sdp_uuid16_cmp(const void *p1, const void *p2); int sdp_uuid128_cmp(const void *p1, const void *p2); uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid); void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16); +void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32); int sdp_uuid128_to_uuid(uuid_t *uuid); int sdp_uuid_to_proto(uuid_t *uuid); int sdp_uuid_extract(const uint8_t *buffer, uuid_t *uuid, int *scanned); -- cgit From c5621bfbf9071ed359d904bdd91308f6599dc5e5 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 26 Apr 2007 19:47:36 +0000 Subject: Fixed memory leak --- src/sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 4270ac83..af2cf162 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2629,13 +2629,14 @@ int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp reqsize += sizeof(uint32_t); p += sizeof(uint32_t); - if (0 > sdp_gen_record_pdu(rec, &pdu)) { + if (sdp_gen_record_pdu(rec, &pdu) < 0) { errno = ENOMEM; status = -1; goto end; } memcpy(p, pdu.data, pdu.data_size); reqsize += pdu.data_size; + free(pdu.data); reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); -- cgit From 1613675da92e96b4074c381965eb536b7184e8d7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 27 Apr 2007 16:09:46 +0000 Subject: Add ESCO_LINK connection type constant --- include/hci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hci.h b/include/hci.h index 46f97bb7..eb015fc7 100644 --- a/include/hci.h +++ b/include/hci.h @@ -198,6 +198,7 @@ enum { /* Baseband links */ #define SCO_LINK 0x00 #define ACL_LINK 0x01 +#define ESCO_LINK 0x02 /* LMP features */ #define LMP_3SLOT 0x01 -- cgit From 0910c7010b29b9716d69459ecbd5ab29c6a34fa4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 May 2007 07:22:22 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1734b69..107a629f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 3.10: + Add version code for Bluetooth 2.1 specification. + Add ESCO_LINK connection type constant. + Export sdp_uuid32_to_uuid128() function. + ver 3.9: Update copyright information. diff --git a/configure.in b/configure.in index 46a65bce..e87884a3 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.9) +AM_INIT_AUTOMAKE(bluez-libs, 3.10) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 79bcaaa5..4ecf123e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 7:0:5 +libbluetooth_la_LDFLAGS = -version-info 8:0:6 INCLUDES = -I$(top_builddir)/include -- cgit From cb08fcdb50544c554e1275ede85605e4542b5b1b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 22 May 2007 08:13:54 +0000 Subject: Fix URL data size handling --- src/sdp.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index af2cf162..0414d013 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -695,61 +695,57 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) break; case SDP_UINT16: u16 = htons(d->val.uint16); - src = (unsigned char *)&u16; + src = (unsigned char *) &u16; data_size = sizeof(uint16_t); break; case SDP_UINT32: u32 = htonl(d->val.uint32); - src = (unsigned char *)&u32; + src = (unsigned char *) &u32; data_size = sizeof(uint32_t); break; case SDP_UINT64: u64 = hton64(d->val.uint64); - src = (unsigned char *)&u64; + src = (unsigned char *) &u64; data_size = sizeof(uint64_t); break; case SDP_UINT128: hton128(&d->val.uint128, &u128); - src = (unsigned char *)&u128; + src = (unsigned char *) &u128; data_size = sizeof(uint128_t); break; case SDP_INT8: case SDP_BOOL: - src = (unsigned char *)&d->val.int8; + src = (unsigned char *) &d->val.int8; data_size = sizeof(int8_t); break; case SDP_INT16: u16 = htons(d->val.int16); - src = (unsigned char *)&u16; + src = (unsigned char *) &u16; data_size = sizeof(int16_t); break; case SDP_INT32: u32 = htonl(d->val.int32); - src = (unsigned char *)&u32; + src = (unsigned char *) &u32; data_size = sizeof(int32_t); break; case SDP_INT64: u64 = hton64(d->val.int64); - src = (unsigned char *)&u64; + src = (unsigned char *) &u64; data_size = sizeof(int64_t); break; case SDP_INT128: hton128(&d->val.int128, &u128); - src = (unsigned char *)&u128; + src = (unsigned char *) &u128; data_size = sizeof(uint128_t); break; case SDP_TEXT_STR8: case SDP_TEXT_STR16: case SDP_TEXT_STR32: - src = (unsigned char *)d->val.str; - data_size = d->unitSize - sizeof(uint8_t); - sdp_set_seq_len(seqp, data_size); - break; case SDP_URL_STR8: case SDP_URL_STR16: case SDP_URL_STR32: - src = (unsigned char *)d->val.str; - data_size = strlen(d->val.str); + src = (unsigned char *) d->val.str; + data_size = d->unitSize - sizeof(uint8_t); sdp_set_seq_len(seqp, data_size); break; case SDP_SEQ8: @@ -768,16 +764,16 @@ int sdp_gen_pdu(sdp_buf_t *buf, sdp_data_t *d) break; case SDP_UUID16: u16 = htons(d->val.uuid.value.uuid16); - src = (unsigned char *)&u16; + src = (unsigned char *) &u16; data_size = sizeof(uint16_t); break; case SDP_UUID32: u32 = htonl(d->val.uuid.value.uuid32); - src = (unsigned char *)&u32; + src = (unsigned char *) &u32; data_size = sizeof(uint32_t); break; case SDP_UUID128: - src = (unsigned char *)&d->val.uuid.value.uuid128; + src = (unsigned char *) &d->val.uuid.value.uuid128; data_size = sizeof(uint128_t); break; default: -- cgit From 8be6e8b5936c34b4f826af0b91bb1df565a083f1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 24 May 2007 14:21:44 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 107a629f..ea140843 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.11: + Fix URL data size handling. + ver 3.10: Add version code for Bluetooth 2.1 specification. Add ESCO_LINK connection type constant. diff --git a/configure.in b/configure.in index e87884a3..95b0f921 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.10) +AM_INIT_AUTOMAKE(bluez-libs, 3.11) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 4ecf123e..0602d4e9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 8:0:6 +libbluetooth_la_LDFLAGS = -version-info 8:1:6 INCLUDES = -I$(top_builddir)/include -- cgit From a2c6ef2451d7677c976beebe7251ed0de9d3d392 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 26 May 2007 19:21:02 +0000 Subject: Remove variable data from information request structure --- include/l2cap.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/l2cap.h b/include/l2cap.h index 5c173e28..49006803 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -175,7 +175,6 @@ typedef struct { typedef struct { uint16_t type; - uint8_t data[0]; } __attribute__ ((packed)) l2cap_info_req; #define L2CAP_INFO_REQ_SIZE 2 -- cgit From 07c0013ff14eb0b16570d33fc50a9130d008609c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 11 Jun 2007 18:48:59 +0000 Subject: Add new company identifiers --- src/bluetooth.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 33e033ad..e2ba87ca 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -384,6 +384,16 @@ char *bt_compidtostr(int compid) return "PARROT SA"; case 68: return "Socket Communications"; + case 69: + return "Atheros Communications, Inc."; + case 70: + return "MediaTek, Inc."; + case 71: + return "Bluegiga"; /* (tentative) */ + case 72: + return "Marvell Technology Group Ltd."; + case 73: + return "3DSP Corporation"; case 65535: return "internal use"; default: -- cgit From 9d9a7646b189cc2471b925cc448862e14c10c0c4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 15 Jun 2007 11:00:46 +0000 Subject: Check record struct pointer before adding an UUID --- src/sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 0414d013..920bc880 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -922,7 +922,8 @@ static sdp_data_t *extract_uuid(const uint8_t *p, int *len, sdp_record_t *rec) return NULL; } d->dtd = *(uint8_t *) p; - sdp_pattern_add_uuid(rec, &d->val.uuid); + if (rec) + sdp_pattern_add_uuid(rec, &d->val.uuid); return d; } -- cgit From 34c5828e678e244a28b7c3ba7078a08583273aa3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 16 Jun 2007 11:46:22 +0000 Subject: Add definitions for inquiry power level and erroneous data --- include/hci.h | 3 +++ src/hci.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/hci.h b/include/hci.h index eb015fc7..327d17a4 100644 --- a/include/hci.h +++ b/include/hci.h @@ -249,8 +249,11 @@ enum { #define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_INQ 0x01 +#define LMP_ERR_DAT_REP 0x20 +#define LMP_NFLUSH_PKTS 0x40 #define LMP_LSTO 0x01 +#define LMP_INQ_TX_PWR 0x02 #define LMP_EXT_FEAT 0x80 /* Link policies */ diff --git a/src/hci.c b/src/hci.c index a064980f..4e95a420 100644 --- a/src/hci.c +++ b/src/hci.c @@ -600,14 +600,14 @@ static hci_map lmp_features_map[8][9] = { { "", 0x04 }, /* Bit 2 */ { "", 0x08 }, /* Bit 3 */ { "", 0x10 }, /* Bit 4 */ - { "", 0x20 }, /* Bit 5 */ - { "", 0x40 }, /* Bit 6 */ + { "", LMP_ERR_DAT_REP }, /* Bit 5 */ + { "", LMP_NFLUSH_PKTS }, /* Bit 6 */ { "", 0x80 }, /* Bit 7 */ { NULL } }, { /* Byte 7 */ { "", LMP_LSTO }, /* Bit 1 */ - { "", 0x02 }, /* Bit 1 */ + { "", LMP_INQ_TX_PWR }, /* Bit 1 */ { "", 0x04 }, /* Bit 2 */ { "", 0x08 }, /* Bit 3 */ { "", 0x10 }, /* Bit 4 */ -- cgit From 54d90a07ab77d86aeac4eed963071a07247eff18 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 20 Jun 2007 15:34:46 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index e2ba87ca..f0f800a5 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -394,6 +394,8 @@ char *bt_compidtostr(int compid) return "Marvell Technology Group Ltd."; case 73: return "3DSP Corporation"; + case 74: + return "Accel Semiconductor Ltd."; case 65535: return "internal use"; default: -- cgit From 3536636a5b1664499ee0ededd305b9bdc9ddeaa4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 21 Jun 2007 21:18:00 +0000 Subject: Add common bachk() function --- include/bluetooth.h | 1 + src/bluetooth.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 1362ed82..1d377781 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -125,6 +125,7 @@ char *batostr(const bdaddr_t *ba); int ba2str(const bdaddr_t *ba, char *str); int str2ba(const char *str, bdaddr_t *ba); int ba2oui(const bdaddr_t *ba, char *oui); +int bachk(const char *str); int baprintf(const char *format, ...); int bafprintf(FILE *stream, const char *format, ...); diff --git a/src/bluetooth.c b/src/bluetooth.c index f0f800a5..676e468e 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -110,6 +111,40 @@ int ba2oui(const bdaddr_t *ba, char *str) return sprintf(str, "%2.2X-%2.2X-%2.2X", b[0], b[1], b[2]); } +int bachk(const char *str) +{ + char tmp[18], *ptr = tmp; + + if (!str) + return -1; + + if (strlen(str) != 17) + return -1; + + memcpy(tmp, str, 18); + + while (*ptr) { + *ptr = toupper(*ptr); + if (*ptr < '0'|| (*ptr > '9' && *ptr < 'A') || *ptr > 'F') + return -1; + ptr++; + + *ptr = toupper(*ptr); + if (*ptr < '0'|| (*ptr > '9' && *ptr < 'A') || *ptr > 'F') + return -1; + ptr++; + + *ptr = toupper(*ptr); + if (*ptr == 0) + break; + if (*ptr != ':') + return -1; + ptr++; + } + + return 0; +} + int baprintf(const char *format, ...) { va_list ap; -- cgit From e37574cc50749ebaaf19bc4480905b81c589b93e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Jun 2007 17:05:41 +0000 Subject: Add mising HCI event structures --- include/hci.h | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/include/hci.h b/include/hci.h index 327d17a4..a32ccdee 100644 --- a/include/hci.h +++ b/include/hci.h @@ -1385,7 +1385,7 @@ typedef struct { } __attribute__ ((packed)) evt_sync_conn_changed; #define EVT_SYNC_CONN_CHANGED_SIZE 9 -#define EVT_SNIFF_SUBRATE 0x2E +#define EVT_SNIFF_SUBRATING 0x2E typedef struct { uint8_t status; uint16_t handle; @@ -1393,8 +1393,8 @@ typedef struct { uint16_t max_rx_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; -} __attribute__ ((packed)) evt_sniff_subrate; -#define EVT_SNIFF_SUBRATE_SIZE 11 +} __attribute__ ((packed)) evt_sniff_subrating; +#define EVT_SNIFF_SUBRATING_SIZE 11 #define EVT_EXTENDED_INQUIRY_RESULT 0x2F typedef struct { @@ -1408,12 +1408,32 @@ typedef struct { } __attribute__ ((packed)) extended_inquiry_info; #define EXTENDED_INQUIRY_INFO_SIZE 254 -#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGE 0x38 +#define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE 0x30 +typedef struct { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)) evt_encryption_key_refresh_complete; +#define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE_SIZE 3 + +#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED 0x38 typedef struct { uint16_t handle; uint16_t timeout; -} __attribute__ ((packed)) evt_link_supervision_timeout_change; -#define EVT_LINK_SUPERVISION_TIMEOUT_SIZE 4 +} __attribute__ ((packed)) evt_link_supervision_timeout_changed; +#define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED_SIZE 4 + +#define EVT_ENHANCED_FLUSH_COMPLETE 0x39 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) evt_enhanced_flush_complete; +#define EVT_ENHANCED_FLUSH_COMPLETE_SIZE 2 + +#define EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3D +typedef struct { + bdaddr_t bdaddr; + uint8_t features[8]; +} __attribute__ ((packed)) evt_remote_host_features_notify; +#define EVT_REMOTE_HOST_FEATURES_NOTIFY_SIZE 14 #define EVT_TESTING 0xFE -- cgit From 668600a6e16d3d84b4d256c5ed44491d6301ec4a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Jun 2007 17:41:53 +0000 Subject: Add mising HCI commands structures --- include/hci.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/include/hci.h b/include/hci.h index a32ccdee..906bbb4b 100644 --- a/include/hci.h +++ b/include/hci.h @@ -577,14 +577,14 @@ typedef struct { #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F -#define OCF_SNIFF_SUBRATE 0x0011 +#define OCF_SNIFF_SUBRATING 0x0011 typedef struct { uint16_t handle; uint16_t max_latency; uint16_t min_remote_timeout; uint16_t min_local_timeout; -} __attribute__ ((packed)) sniff_subrate_cp; -#define SNIFF_SUBRATE_CP_SIZE 8 +} __attribute__ ((packed)) sniff_subrating_cp; +#define SNIFF_SUBRATING_CP_SIZE 8 /* Host Controller and Baseband */ #define OGF_HOST_CTL 0x03 @@ -968,6 +968,57 @@ typedef struct { } __attribute__ ((packed)) write_ext_inquiry_response_rp; #define WRITE_EXT_INQUIRY_RESPONSE_RP_SIZE 1 +#define OCF_REFRESH_ENCRYPTION_KEY 0x0053 +typedef struct { + uint16_t handle; +} __attribute__ ((packed)) refresh_encryption_key_cp; +#define REFRESH_ENCRYPTION_KEY_CP_SIZE 2 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) refresh_encryption_key_rp; +#define REFRESH_ENCRYPTION_KEY_RP_SIZE 1 + +#define OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL 0x0058 +typedef struct { + uint8_t status; + int8_t level; +} __attribute__ ((packed)) read_inquiry_transmit_power_level_rp; +#define READ_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 2 + +#define OCF_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL 0x0059 +typedef struct { + int8_t level; +} __attribute__ ((packed)) write_inquiry_transmit_power_level_cp; +#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_inquiry_transmit_power_level_rp; +#define WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE 1 + +#define OCF_READ_DEFAULT_ERROR_DATA_REPORTING 0x005A +typedef struct { + uint8_t status; + uint8_t reporting; +} __attribute__ ((packed)) read_default_error_data_reporting_rp; +#define READ_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 2 + +#define OCF_WRITE_DEFAULT_ERROR_DATA_REPORTING 0x005B +typedef struct { + uint8_t reporting; +} __attribute__ ((packed)) write_default_error_data_reporting_cp; +#define WRITE_DEFAULT_ERROR_DATA_REPORTING_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_default_error_data_reporting_rp; +#define WRITE_DEFAULT_ERROR_DATA_REPORTING_RP_SIZE 1 + +#define OCF_ENHANCED_FLUSH 0x005F +typedef struct { + uint16_t handle; + uint8_t type; +} __attribute__ ((packed)) enhanced_flush_cp; +#define ENHANCED_FLUSH_CP_SIZE 3 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 -- cgit From a9ad7c6fef3c62fa773a586d10402a343a4ee91b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 22 Jun 2007 19:09:54 +0000 Subject: Add HCI command text descriptions --- src/hci.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/hci.c b/src/hci.c index 4e95a420..47359195 100644 --- a/src/hci.c +++ b/src/hci.c @@ -447,9 +447,35 @@ static hci_map commands_map[] = { { "Reserved", 135 }, { "Read Extended Inquiry Response", 136 }, { "Write Extended Inquiry Response", 137 }, - { "Unknown", 138 }, - { "Unknown", 139 }, - { "Sniff Subrate", 140 }, + { "Refresh Encryption Key", 138 }, + { "Reserved", 139 }, + { "Sniff Subrating", 140 }, + { "Unknown", 141 }, + { "Unknown", 142 }, + { "Unknown", 143 }, + { "Read Inquiry Transmit Power Level", 144 }, + { "Write Inquiry Transmit Power Level", 145 }, + { "Read Default Erroneous Data Reporting", 146 }, + { "Write Default Erroneous Data Reporting", 147 }, + { "Reserved", 148 }, + { "Reserved", 149 }, + { "Reserved", 150 }, + { "Unknown", 151 }, + { "Unknown", 152 }, + { "Unknown", 153 }, + { "Unknown", 154 }, + { "Unknown", 155 }, + { "Unknown", 156 }, + { "Enhanced Flush", 157 }, + { "Unknown", 158 }, + { "Reserved", 159 }, + { "Reserved", 160 }, + { "Unknown", 161 }, + { "Unknown", 162 }, + { "Reserved", 163 }, + { "Reserved", 164 }, + { "Reserved", 165 }, + { "Reserved", 166 }, { NULL } }; -- cgit From 362b9690036f8324e2d0a40bed4adc6d0986caad Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 23 Jun 2007 23:37:00 +0000 Subject: Update changelog and bump version number --- ChangeLog | 6 ++++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea140843..3461e849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +ver 3.12: + Add missing HCI command text descriptions + Add missing HCI commands structures. + Add missing HCI event structures. + Add common bachk() function. + ver 3.11: Fix URL data size handling. diff --git a/configure.in b/configure.in index 95b0f921..6d26ac95 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.11) +AM_INIT_AUTOMAKE(bluez-libs, 3.12) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 0602d4e9..0b662369 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 8:1:6 +libbluetooth_la_LDFLAGS = -version-info 9:0:7 INCLUDES = -I$(top_builddir)/include -- cgit From 08b3ddeeff510f9ac61c860a74d13575a47420b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jul 2007 08:25:50 +0000 Subject: Update HCI command table --- include/hci.h | 2 ++ src/hci.c | 36 +++++++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/include/hci.h b/include/hci.h index 906bbb4b..eaab3964 100644 --- a/include/hci.h +++ b/include/hci.h @@ -577,6 +577,8 @@ typedef struct { #define OCF_WRITE_DEFAULT_LINK_POLICY 0x000F +#define OCF_FLOW_SPECIFICATION 0x0010 + #define OCF_SNIFF_SUBRATING 0x0011 typedef struct { uint16_t handle; diff --git a/src/hci.c b/src/hci.c index 47359195..04da6de5 100644 --- a/src/hci.c +++ b/src/hci.c @@ -317,6 +317,7 @@ static hci_map commands_map[] = { { "Disconnect", 5 }, { "Add SCO Connection", 6 }, { "Cancel Create Connection", 7 }, + { "Accept Connection Request", 8 }, { "Reject Connection Request", 9 }, { "Link Key Request Reply", 10 }, @@ -325,6 +326,7 @@ static hci_map commands_map[] = { { "PIN Code Request Negative Reply", 13 }, { "Change Connection Packet Type", 14 }, { "Authentication Requested", 15 }, + { "Set Connection Encryption", 16 }, { "Change Connection Link Key", 17 }, { "Master Link Key", 18 }, @@ -333,6 +335,7 @@ static hci_map commands_map[] = { { "Read Remote Supported Features", 21 }, { "Read Remote Extended Features", 22 }, { "Read Remote Version Information", 23 }, + { "Read Clock Offset", 24 }, { "Read LMP Handle", 25 }, { "Reserved", 26 }, @@ -341,6 +344,7 @@ static hci_map commands_map[] = { { "Reserved", 29 }, { "Reserved", 30 }, { "Reserved", 31 }, + { "Reserved", 32 }, { "Hold Mode", 33 }, { "Sniff Mode", 34 }, @@ -349,6 +353,7 @@ static hci_map commands_map[] = { { "Exit Park State", 37 }, { "QoS Setup", 38 }, { "Role Discovery", 39 }, + { "Switch Role", 40 }, { "Read Link Policy Settings", 41 }, { "Write Link Policy Settings", 42 }, @@ -357,6 +362,7 @@ static hci_map commands_map[] = { { "Flow Specification", 45 }, { "Set Event Mask", 46 }, { "Reset", 47 }, + { "Set Event Filter", 48 }, { "Flush", 49 }, { "Read PIN Type", 50 }, @@ -365,6 +371,7 @@ static hci_map commands_map[] = { { "Read Stored Link Key", 53 }, { "Write Stored Link Key", 54 }, { "Delete Stored Link Key", 55 }, + { "Write Local Name", 56 }, { "Read Local Name", 57 }, { "Read Connection Accept Timeout", 58 }, @@ -373,6 +380,7 @@ static hci_map commands_map[] = { { "Write Page Timeout", 61 }, { "Read Scan Enable", 62 }, { "Write Scan Enable", 63 }, + { "Read Page Scan Activity", 64 }, { "Write Page Scan Activity", 65 }, { "Read Inquiry Scan Activity", 66 }, @@ -381,6 +389,7 @@ static hci_map commands_map[] = { { "Write Authentication Enable", 69 }, { "Read Encryption Mode", 70 }, { "Write Encryption Mode", 71 }, + { "Read Class Of Device", 72 }, { "Write Class Of Device", 73 }, { "Read Voice Setting", 74 }, @@ -389,6 +398,7 @@ static hci_map commands_map[] = { { "Write Automatic Flush Timeout", 77 }, { "Read Num Broadcast Retransmissions", 78 }, { "Write Num Broadcast Retransmissions", 79 }, + { "Read Hold Mode Activity", 80 }, { "Write Hold Mode Activity", 81 }, { "Read Transmit Power Level", 82 }, @@ -397,6 +407,7 @@ static hci_map commands_map[] = { { "Set Host Controller To Host Flow Control", 85 }, { "Host Buffer Size", 86 }, { "Host Number Of Completed Packets", 87 }, + { "Read Link Supervision Timeout", 88 }, { "Write Link Supervision Timeout", 89 }, { "Read Number of Supported IAC", 90 }, @@ -405,14 +416,16 @@ static hci_map commands_map[] = { { "Read Page Scan Period Mode", 93 }, { "Write Page Scan Period Mode", 94 }, { "Read Page Scan Mode", 95 }, + { "Write Page Scan Mode", 96 }, { "Set AFH Channel Classification", 97 }, - { "reserved", 98 }, - { "reserved", 99 }, + { "Reserved", 98 }, + { "Reserved", 99 }, { "Read Inquiry Scan Type", 100 }, { "Write Inquiry Scan Type", 101 }, { "Read Inquiry Mode", 102 }, { "Write Inquiry Mode", 103 }, + { "Read Page Scan Type", 104 }, { "Write Page Scan Type", 105 }, { "Read AFH Channel Assessment Mode", 106 }, @@ -421,6 +434,7 @@ static hci_map commands_map[] = { { "Reserved", 109 }, { "Reserved", 110 }, { "Reserved", 111 }, + { "Reserved", 112 }, { "Reserved", 113 }, { "Reserved", 114 }, @@ -429,6 +443,7 @@ static hci_map commands_map[] = { { "Read Local Supported Features", 117 }, { "Read Local Extended Features", 118 }, { "Read Buffer Size", 119 }, + { "Read Country Code", 120 }, { "Read BD ADDR", 121 }, { "Read Failed Contact Counter", 122 }, @@ -437,6 +452,7 @@ static hci_map commands_map[] = { { "Read RSSI", 125 }, { "Read AFH Channel Map", 126 }, { "Read BD Clock", 127 }, + { "Read Loopback Mode", 128 }, { "Write Loopback Mode", 129 }, { "Enable Device Under Test Mode", 130 }, @@ -445,6 +461,7 @@ static hci_map commands_map[] = { { "Reject Synchronous Connection", 133 }, { "Reserved", 134 }, { "Reserved", 135 }, + { "Read Extended Inquiry Response", 136 }, { "Write Extended Inquiry Response", 137 }, { "Refresh Encryption Key", 138 }, @@ -453,6 +470,7 @@ static hci_map commands_map[] = { { "Unknown", 141 }, { "Unknown", 142 }, { "Unknown", 143 }, + { "Read Inquiry Transmit Power Level", 144 }, { "Write Inquiry Transmit Power Level", 145 }, { "Read Default Erroneous Data Reporting", 146 }, @@ -461,21 +479,25 @@ static hci_map commands_map[] = { { "Reserved", 149 }, { "Reserved", 150 }, { "Unknown", 151 }, + { "Unknown", 152 }, { "Unknown", 153 }, { "Unknown", 154 }, { "Unknown", 155 }, { "Unknown", 156 }, - { "Enhanced Flush", 157 }, - { "Unknown", 158 }, - { "Reserved", 159 }, + { "Unknown", 157 }, + { "Enhanced Flush", 158 }, + { "Unknown", 159 }, + { "Reserved", 160 }, - { "Unknown", 161 }, + { "Reserved", 161 }, { "Unknown", 162 }, - { "Reserved", 163 }, + { "Unknown", 163 }, { "Reserved", 164 }, { "Reserved", 165 }, { "Reserved", 166 }, + { "Reserved", 167 }, + { NULL } }; -- cgit From 7092f984dafd1b9e67873f73ffe9334289ff1a17 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 26 Jul 2007 08:30:21 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3461e849..f8291693 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.13: + Update HCI command table. + ver 3.12: Add missing HCI command text descriptions Add missing HCI commands structures. diff --git a/configure.in b/configure.in index 6d26ac95..5ef4b501 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.12) +AM_INIT_AUTOMAKE(bluez-libs, 3.13) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 0b662369..9392082d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 9:0:7 +libbluetooth_la_LDFLAGS = -version-info 9:1:7 INCLUDES = -I$(top_builddir)/include -- cgit From a3cc218cd5f213922cd529ebfb5da5ba1b1f1aca Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 1 Aug 2007 07:29:23 +0000 Subject: Add definitions and functions for Simple Pairing --- include/hci.h | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/hci_lib.h | 3 ++ src/hci.c | 107 +++++++++++++++++++++++++++++++------ 3 files changed, 248 insertions(+), 16 deletions(-) diff --git a/include/hci.h b/include/hci.h index eaab3964..a4f88146 100644 --- a/include/hci.h +++ b/include/hci.h @@ -188,6 +188,8 @@ enum { #define HCI_SLOT_VIOLATION 0x34 #define HCI_ROLE_SWITCH_FAILED 0x35 #define HCI_EIR_TOO_LARGE 0x36 +#define HCI_SIMPLE_PAIRING_NOT_SUPPORTED 0x37 +#define HCI_HOST_BUSY_PAIRING 0x38 /* ACL flags */ #define ACL_CONT 0x01 @@ -249,6 +251,8 @@ enum { #define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_INQ 0x01 +#define LMP_SIMPLE_PAIR 0x08 +#define LMP_ENCAPS_PDU 0x10 #define LMP_ERR_DAT_REP 0x20 #define LMP_NFLUSH_PKTS 0x40 @@ -473,6 +477,49 @@ typedef struct { } __attribute__ ((packed)) reject_sync_conn_req_cp; #define REJECT_SYNC_CONN_REQ_CP_SIZE 7 +#define OCF_IO_CAPABILITY_REPLY 0x002B +typedef struct { + bdaddr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __attribute__ ((packed)) io_capability_reply_cp; +#define IO_CAPABILITY_REPLY_CP_SIZE 9 + +#define OCF_USER_CONFIRM_REPLY 0x002C +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) user_confirm_reply_cp; +#define USER_CONFIRM_REPLY_CP_SIZE 6 + +#define OCF_USER_CONFIRM_NEG_REPLY 0x002D + +#define OCF_USER_PASSKEY_REPLY 0x002E +typedef struct { + bdaddr_t bdaddr; + uint32_t passkey; +} __attribute__ ((packed)) user_passkey_reply_cp; +#define USER_PASSKEY_REPLY_CP_SIZE 10 + +#define OCF_USER_PASSKEY_NEG_REPLY 0x002F + +#define OCF_REMOTE_OOB_DATA_REPLY 0x0030 +typedef struct { + bdaddr_t bdaddr; + uint8_t hash[16]; + uint8_t randomizer[16]; +} __attribute__ ((packed)) remote_oob_data_reply_cp; +#define REMOTE_OOB_DATA_REPLY_CP_SIZE 38 + +#define OCF_REMOTE_OOB_DATA_NEG_REPLY 0x0033 + +#define OCF_IO_CAPABILITY_NEG_REPLY 0x0034 +typedef struct { + bdaddr_t bdaddr; + uint8_t reason; +} __attribute__ ((packed)) io_capability_neg_reply_cp; +#define IO_CAPABILITY_NEG_REPLY_CP_SIZE 7 + /* Link Policy */ #define OGF_LINK_POLICY 0x02 @@ -980,6 +1027,31 @@ typedef struct { } __attribute__ ((packed)) refresh_encryption_key_rp; #define REFRESH_ENCRYPTION_KEY_RP_SIZE 1 +#define OCF_READ_SIMPLE_PAIRING_MODE 0x0055 +typedef struct { + uint8_t status; + uint8_t mode; +} __attribute__ ((packed)) read_simple_pairing_mode_rp; +#define READ_SIMPLE_PAIRING_MODE_RP_SIZE 2 + +#define OCF_WRITE_SIMPLE_PAIRING_MODE 0x0056 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_simple_pairing_mode_cp; +#define WRITE_SIMPLE_PAIRING_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_simple_pairing_mode_rp; +#define WRITE_SIMPLE_PAIRING_MODE_RP_SIZE 1 + +#define OCF_READ_LOCAL_OOB_DATA 0x0057 +typedef struct { + uint8_t status; + uint8_t hash[16]; + uint8_t randomizer[16]; +} __attribute__ ((packed)) read_local_oob_data_rp; +#define READ_LOCAL_OOB_DATA_RP_SIZE 33 + #define OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL 0x0058 typedef struct { uint8_t status; @@ -1021,6 +1093,17 @@ typedef struct { } __attribute__ ((packed)) enhanced_flush_cp; #define ENHANCED_FLUSH_CP_SIZE 3 +#define OCF_SEND_KEYPRESS_NOTIFY 0x0060 +typedef struct { + bdaddr_t bdaddr; + uint8_t type; +} __attribute__ ((packed)) send_keypress_notify_cp; +#define SEND_KEYPRESS_NOTIFY_CP_SIZE 7 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) send_keypress_notify_rp; +#define SEND_KEYPRESS_NOTIFY_RP_SIZE 1 + /* Informational Parameters */ #define OGF_INFO_PARAM 0x04 @@ -1141,6 +1224,22 @@ typedef struct { /* Testing commands */ #define OGF_TESTING_CMD 0x3e +#define OCF_READ_LOOPBACK_MODE 0x0001 + +#define OCF_WRITE_LOOPBACK_MODE 0x0002 + +#define OCF_ENABLE_DEVICE_UNDER_TEST_MODE 0x0003 + +#define OCF_WRITE_SIMPLE_PAIRING_DEBUG_MODE 0x0004 +typedef struct { + uint8_t mode; +} __attribute__ ((packed)) write_simple_pairing_debug_mode_cp; +#define WRITE_SIMPLE_PAIRING_DEBUG_MODE_CP_SIZE 1 +typedef struct { + uint8_t status; +} __attribute__ ((packed)) write_simple_pairing_debug_mode_rp; +#define WRITE_SIMPLE_PAIRING_DEBUG_MODE_RP_SIZE 1 + /* Vendor specific commands */ #define OGF_VENDOR_CMD 0x3f @@ -1468,6 +1567,47 @@ typedef struct { } __attribute__ ((packed)) evt_encryption_key_refresh_complete; #define EVT_ENCRYPTION_KEY_REFRESH_COMPLETE_SIZE 3 +#define EVT_IO_CAPABILITY_REQUEST 0x31 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_io_capability_request; +#define EVT_IO_CAPABILITY_REQUEST_SIZE 6 + +#define EVT_IO_CAPABILITY_RESPONSE 0x32 +typedef struct { + bdaddr_t bdaddr; + uint8_t capability; + uint8_t oob_data; + uint8_t authentication; +} __attribute__ ((packed)) evt_io_capability_response; +#define EVT_IO_CAPABILITY_RESPONSE_SIZE 9 + +#define EVT_USER_CONFIRM_REQUEST 0x33 +typedef struct { + bdaddr_t bdaddr; + uint32_t passkey; +} __attribute__ ((packed)) evt_user_confirm_request; +#define EVT_USER_CONFIRM_REQUEST_SIZE 10 + +#define EVT_USER_PASSKEY_REQUEST 0x34 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_user_passkey_request; +#define EVT_USER_PASSKEY_REQUEST_SIZE 6 + +#define EVT_REMOTE_OOB_DATA_REQUEST 0x35 +typedef struct { + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_remote_oob_data_request; +#define EVT_REMOTE_OOB_DATA_REQUEST_SIZE 6 + +#define EVT_SIMPLE_PAIRING_COMPLETE 0x36 +typedef struct { + uint8_t status; + bdaddr_t bdaddr; +} __attribute__ ((packed)) evt_simple_pairing_complete; +#define EVT_SIMPLE_PAIRING_COMPLETE_SIZE 7 + #define EVT_LINK_SUPERVISION_TIMEOUT_CHANGED 0x38 typedef struct { uint16_t handle; @@ -1481,6 +1621,20 @@ typedef struct { } __attribute__ ((packed)) evt_enhanced_flush_complete; #define EVT_ENHANCED_FLUSH_COMPLETE_SIZE 2 +#define EVT_USER_PASSKEY_NOTIFY 0x3B +typedef struct { + bdaddr_t bdaddr; + uint32_t passkey; +} __attribute__ ((packed)) evt_user_passkey_notify; +#define EVT_USER_PASSKEY_NOTIFY_SIZE 10 + +#define EVT_KEYPRESS_NOTIFY 0x3C +typedef struct { + bdaddr_t bdaddr; + uint8_t type; +} __attribute__ ((packed)) evt_keypress_notify; +#define EVT_KEYPRESS_NOTIFY_SIZE 7 + #define EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3D typedef struct { bdaddr_t bdaddr; diff --git a/include/hci_lib.h b/include/hci_lib.h index a784a08b..1215a62f 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -98,6 +98,9 @@ int hci_read_afh_mode(int dd, uint8_t *mode, int to); int hci_write_afh_mode(int dd, uint8_t mode, int to); int hci_read_ext_inquiry_response(int dd, uint8_t *fec, uint8_t *data, int to); int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to); +int hci_read_simple_pairing_mode(int dd, uint8_t *mode, int to); +int hci_write_simple_pairing_mode(int dd, uint8_t mode, int to); +int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); diff --git a/src/hci.c b/src/hci.c index 04da6de5..d3e81d2c 100644 --- a/src/hci.c +++ b/src/hci.c @@ -467,9 +467,9 @@ static hci_map commands_map[] = { { "Refresh Encryption Key", 138 }, { "Reserved", 139 }, { "Sniff Subrating", 140 }, - { "Unknown", 141 }, - { "Unknown", 142 }, - { "Unknown", 143 }, + { "Read Simple Pairing Mode", 141 }, + { "Write Simple Pairing Mode", 142 }, + { "Read Local OOB Data", 143 }, { "Read Inquiry Transmit Power Level", 144 }, { "Write Inquiry Transmit Power Level", 145 }, @@ -478,21 +478,21 @@ static hci_map commands_map[] = { { "Reserved", 148 }, { "Reserved", 149 }, { "Reserved", 150 }, - { "Unknown", 151 }, - - { "Unknown", 152 }, - { "Unknown", 153 }, - { "Unknown", 154 }, - { "Unknown", 155 }, - { "Unknown", 156 }, - { "Unknown", 157 }, + { "IO Capability Request Reply", 151 }, + + { "User Confirmation Request Reply", 152 }, + { "User Confirmation Request Negative Reply", 153 }, + { "User Passkey Request Reply", 154 }, + { "User Passkey Request Negative Reply", 155 }, + { "Remote OOB Data Request Reply", 156 }, + { "Write Simple Pairing Debug Mode", 157 }, { "Enhanced Flush", 158 }, - { "Unknown", 159 }, + { "Remote OOB Data Request Negative Reply", 159 }, { "Reserved", 160 }, { "Reserved", 161 }, - { "Unknown", 162 }, - { "Unknown", 163 }, + { "Send Keypress Notification", 162 }, + { "IO Capabilities Response Negative Reply", 163 }, { "Reserved", 164 }, { "Reserved", 165 }, { "Reserved", 166 }, @@ -646,8 +646,8 @@ static hci_map lmp_features_map[8][9] = { { "", LMP_EXT_INQ }, /* Bit 0 */ { "", 0x02 }, /* Bit 1 */ { "", 0x04 }, /* Bit 2 */ - { "", 0x08 }, /* Bit 3 */ - { "", 0x10 }, /* Bit 4 */ + { "", LMP_SIMPLE_PAIR }, /* Bit 3 */ + { "", LMP_ENCAPS_PDU }, /* Bit 4 */ { "", LMP_ERR_DAT_REP }, /* Bit 5 */ { "", LMP_NFLUSH_PKTS }, /* Bit 6 */ { "", 0x80 }, /* Bit 7 */ @@ -2060,6 +2060,81 @@ int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to) return 0; } +int hci_read_simple_pairing_mode(int dd, uint8_t *mode, int to) +{ + read_simple_pairing_mode_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_SIMPLE_PAIRING_MODE; + rq.rparam = &rp; + rq.rlen = READ_SIMPLE_PAIRING_MODE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *mode = rp.mode; + return 0; +} + +int hci_write_simple_pairing_mode(int dd, uint8_t mode, int to) +{ + write_simple_pairing_mode_cp cp; + write_simple_pairing_mode_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.mode = mode; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_SIMPLE_PAIRING_MODE; + rq.cparam = &cp; + rq.clen = WRITE_SIMPLE_PAIRING_MODE_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_SIMPLE_PAIRING_MODE_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} + +int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to) +{ + read_local_oob_data_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_LOCAL_OOB_DATA; + rq.rparam = &rp; + rq.rlen = READ_LOCAL_OOB_DATA_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + memcpy(hash, rp.hash, 16); + memcpy(randomizer, rp.randomizer, 16); + return 0; +} + int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to) { read_transmit_power_level_cp cp; -- cgit From 3ad6c870f3759d3e98a1a3e0f2e71dc3b26e0994 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 8 Aug 2007 16:30:46 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8291693..4ff673d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.14: + Add definitions and functions for Simple Pairing. + ver 3.13: Update HCI command table. diff --git a/configure.in b/configure.in index 5ef4b501..e08c003e 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.13) +AM_INIT_AUTOMAKE(bluez-libs, 3.14) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 9392082d..6d3e627f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 9:1:7 +libbluetooth_la_LDFLAGS = -version-info 10:0:8 INCLUDES = -I$(top_builddir)/include -- cgit From 4c6bbf0a08426efd008c1b9e439c693a826ee708 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 22 Aug 2007 00:31:24 +0000 Subject: Extract main service class for later use --- include/sdp.h | 7 ++++--- src/sdp.c | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/include/sdp.h b/include/sdp.h index 8a78ba30..05572c06 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -457,11 +457,12 @@ typedef struct { typedef struct { uint32_t handle; - /* - * Search pattern: a sequence of all UUIDs seen in this record - */ + /* Search pattern: a sequence of all UUIDs seen in this record */ sdp_list_t *pattern; sdp_list_t *attrlist; + + /* Main service class for Extended Inquiry Response */ + uuid_t svclass; } sdp_record_t; typedef struct sdp_data_struct sdp_data_t; diff --git a/src/sdp.c b/src/sdp.c index 920bc880..c39ad64d 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -574,22 +574,48 @@ sdp_data_t *sdp_seq_alloc(void **dtds, void **values, int len) return sdp_data_alloc(SDP_SEQ8, seq); } +static void extract_svclass_uuid(sdp_data_t *data, uuid_t *uuid) +{ + sdp_data_t *d; + + if (!data || data->dtd < SDP_SEQ8 || data->dtd > SDP_SEQ32) + return; + + d = data->val.dataseq; + if (!d) + return; + + if (d->dtd < SDP_UUID16 || d->dtd > SDP_UUID128) + return; + + *uuid = d->val.uuid; +} + int sdp_attr_add(sdp_record_t *rec, uint16_t attr, sdp_data_t *d) { sdp_data_t *p = sdp_data_get(rec, attr); if (p) return -1; + d->attrId = attr; rec->attrlist = sdp_list_insert_sorted(rec->attrlist, d, sdp_attrid_comp_func); + + if (attr == SDP_ATTR_SVCLASS_ID_LIST) + extract_svclass_uuid(d, &rec->svclass); + return 0; } void sdp_attr_remove(sdp_record_t *rec, uint16_t attr) { sdp_data_t *d = sdp_data_get(rec, attr); + if (d) rec->attrlist = sdp_list_remove(rec->attrlist, d); + + if (attr == SDP_ATTR_SVCLASS_ID_LIST) + memset(&rec->svclass, 0, sizeof(rec->svclass)); } void sdp_set_seq_len(uint8_t *ptr, uint32_t length) @@ -820,8 +846,12 @@ void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *d) rec->attrlist = sdp_list_remove(rec->attrlist, p); sdp_data_free(p); } + d->attrId = attr; - rec->attrlist = sdp_list_insert_sorted(rec->attrlist, (void *)d, sdp_attrid_comp_func); + rec->attrlist = sdp_list_insert_sorted(rec->attrlist, d, sdp_attrid_comp_func); + + if (attr == SDP_ATTR_SVCLASS_ID_LIST) + extract_svclass_uuid(d, &rec->svclass); } int sdp_attrid_comp_func(const void *key1, const void *key2) @@ -1114,8 +1144,13 @@ sdp_record_t *sdp_extract_pdu(const uint8_t *buf, int *scanned) SDPDBG("Terminating extraction of attributes"); break; } + if (attr == SDP_ATTR_RECORD_HANDLE) rec->handle = data->val.uint32; + + if (attr == SDP_ATTR_SVCLASS_ID_LIST) + extract_svclass_uuid(data, &rec->svclass); + extracted += n; p += n; sdp_attr_replace(rec, attr, data); @@ -1215,7 +1250,7 @@ sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attrId) if (p) return (sdp_data_t *)p->data; } - return 0; + return NULL; } /* -- cgit From 54146f1c528394e399b2d4375d7468f9f9a6644b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 23 Aug 2007 11:21:26 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ff673d5..4ee08521 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.15: + Extract main service class for later use. + ver 3.14: Add definitions and functions for Simple Pairing. diff --git a/configure.in b/configure.in index e08c003e..c086bf5c 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.14) +AM_INIT_AUTOMAKE(bluez-libs, 3.15) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 6d3e627f..f0027ccd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 10:0:8 +libbluetooth_la_LDFLAGS = -version-info 10:1:8 INCLUDES = -I$(top_builddir)/include -- cgit From 175d6403eb52b7f6c2f081624159405d28521749 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 27 Aug 2007 11:29:08 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 676e468e..5cbff47f 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -431,6 +431,8 @@ char *bt_compidtostr(int compid) return "3DSP Corporation"; case 74: return "Accel Semiconductor Ltd."; + case 75: + return "Continental Automotive Systems"; case 65535: return "internal use"; default: -- cgit From 1160385cf5604689c14d73397d11a0ca1edfcbe7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 28 Aug 2007 17:53:49 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ee08521..d50561df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.16: + Update company identifier list. + ver 3.15: Extract main service class for later use. diff --git a/configure.in b/configure.in index c086bf5c..c16692f4 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.15) +AM_INIT_AUTOMAKE(bluez-libs, 3.16) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index f0027ccd..7975212b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 10:1:8 +libbluetooth_la_LDFLAGS = -version-info 10:2:8 INCLUDES = -I$(top_builddir)/include -- cgit From c04e0056db8c4a8dc02b87fb647e300b26ccb207 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 29 Aug 2007 14:32:55 +0000 Subject: Fix supported commands bit calculation --- src/hci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hci.c b/src/hci.c index d3e81d2c..54e57cf3 100644 --- a/src/hci.c +++ b/src/hci.c @@ -515,7 +515,7 @@ char *hci_commandstostr(uint8_t *commands, char *pref, int width) m = commands_map; while (m->str) { - if (hci_test_bit(m->val, commands)) + if (commands[m->val / 8] & (1 << (m->val % 8))) size += strlen(m->str) + (pref ? strlen(pref) : 0) + 3; m++; } @@ -534,7 +534,7 @@ char *hci_commandstostr(uint8_t *commands, char *pref, int width) m = commands_map; while (m->str) { - if (hci_test_bit(m->val, commands)) { + if (commands[m->val / 8] & (1 << (m->val % 8))) { if (strlen(off) + strlen(m->str) > width - 3) { ptr += sprintf(ptr, "\n%s", pref ? pref : ""); off = ptr; -- cgit From bf3139919cb3732931100b0aa6de18ad16c451d1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 30 Aug 2007 14:24:30 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d50561df..9beb29f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.17: + Fix supported commands bit calculation. + ver 3.16: Update company identifier list. diff --git a/configure.in b/configure.in index c16692f4..cd915de9 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.16) +AM_INIT_AUTOMAKE(bluez-libs, 3.17) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 7975212b..8b805f22 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 10:2:8 +libbluetooth_la_LDFLAGS = -version-info 10:3:8 INCLUDES = -I$(top_builddir)/include -- cgit From 3f8700636d21bb868c2dbb8d2403e550a7750ceb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 31 Aug 2007 18:43:40 +0000 Subject: Don't allocate memory for the Bluetooth base UUID --- src/sdp.c | 149 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 78 insertions(+), 71 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index c39ad64d..fcf5c897 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -88,7 +88,10 @@ static inline void ntoh128(uint128_t *src, uint128_t *dst) #define BASE_UUID "00000000-0000-1000-8000-00805F9B34FB" -static uint128_t *bluetooth_base_uuid = NULL; +static uint128_t bluetooth_base_uuid = { + .data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0x80, 0x5F, 0xF9, 0xB3, 0xFB } +}; #define SDP_MAX_ATTR_LEN 65535 @@ -2078,6 +2081,7 @@ void sdp_set_url_attr(sdp_record_t *rec, const char *client, const char *doc, co */ uint128_t *sdp_create_base_uuid(void) { + uint128_t *base_uuid; char baseStr[128]; int delim = '-'; unsigned long dataLongValue; @@ -2087,69 +2091,75 @@ uint128_t *sdp_create_base_uuid(void) int toBeCopied; uint8_t *data; - if (bluetooth_base_uuid == NULL) { - strcpy(baseStr, BASE_UUID); - bluetooth_base_uuid = malloc(sizeof(uint128_t)); - data = bluetooth_base_uuid->data; - memset(data, '\0', sizeof(uint128_t)); - memset(temp, '\0', 10); - dataPtr = baseStr; - delimPtr = NULL; - delimPtr = strchr(dataPtr, delim); - toBeCopied = delimPtr - dataPtr; - if (toBeCopied != 8) { - SDPDBG("To be copied(1) : %d\n", toBeCopied); - return NULL; - } - strncpy(temp, dataPtr, toBeCopied); - dataLongValue = htonl(strtoul(temp, NULL, 16)); - memcpy(&data[0], &dataLongValue, 4); + strcpy(baseStr, BASE_UUID); + base_uuid = malloc(sizeof(uint128_t)); + if (!base_uuid) + return NULL; - /* - * Get the next 4 bytes (note that there is a "-" - * between them now) - */ - memset(temp, '\0', 10); - dataPtr = delimPtr + 1; - delimPtr = strchr(dataPtr, delim); - toBeCopied = delimPtr - dataPtr; - if (toBeCopied != 4) { - SDPDBG("To be copied(2) : %d\n", toBeCopied); - return NULL; - } - strncpy(temp, dataPtr, toBeCopied); - dataPtr = delimPtr + 1; - delimPtr = strchr(dataPtr, delim); - toBeCopied = delimPtr - dataPtr; - if (toBeCopied != 4) { - SDPDBG("To be copied(3) : %d\n", toBeCopied); - return NULL; - } - strncat(temp, dataPtr, toBeCopied); - dataLongValue = htonl(strtoul(temp, NULL, 16)); - memcpy(&data[4], &dataLongValue, 4); + data = base_uuid->data; + memset(data, '\0', sizeof(uint128_t)); + memset(temp, '\0', 10); + dataPtr = baseStr; + delimPtr = NULL; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 8) { + SDPDBG("To be copied(1) : %d\n", toBeCopied); + free(base_uuid); + return NULL; + } + strncpy(temp, dataPtr, toBeCopied); + dataLongValue = htonl(strtoul(temp, NULL, 16)); + memcpy(&data[0], &dataLongValue, 4); - /* - * Get the last 4 bytes (note that there are 6 bytes - * after the last separator, which is truncated (2+4) - */ - memset(temp, '\0', 10); - dataPtr = delimPtr + 1; - dataPtr = delimPtr + 1; - delimPtr = strchr(dataPtr, delim); - toBeCopied = delimPtr - dataPtr; - if (toBeCopied != 4) { - SDPDBG("To be copied(4) : %d\n", toBeCopied); - return NULL; - } - strncpy(temp, dataPtr, toBeCopied); - strncat(temp, (delimPtr + 1), 4); - dataLongValue = htonl(strtoul(temp, NULL, 16)); - memcpy(&data[8], &dataLongValue, 4); - dataLongValue = htonl(strtoul(delimPtr + 5, NULL, 16)); - memcpy(&data[12], &dataLongValue, 4); + /* + * Get the next 4 bytes (note that there is a "-" + * between them now) + */ + memset(temp, '\0', 10); + dataPtr = delimPtr + 1; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 4) { + SDPDBG("To be copied(2) : %d\n", toBeCopied); + free(base_uuid); + return NULL; + } + strncpy(temp, dataPtr, toBeCopied); + dataPtr = delimPtr + 1; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 4) { + SDPDBG("To be copied(3) : %d\n", toBeCopied); + free(base_uuid); + return NULL; + } + strncat(temp, dataPtr, toBeCopied); + dataLongValue = htonl(strtoul(temp, NULL, 16)); + memcpy(&data[4], &dataLongValue, 4); + + /* + * Get the last 4 bytes (note that there are 6 bytes + * after the last separator, which is truncated (2+4) + */ + memset(temp, '\0', 10); + dataPtr = delimPtr + 1; + dataPtr = delimPtr + 1; + delimPtr = strchr(dataPtr, delim); + toBeCopied = delimPtr - dataPtr; + if (toBeCopied != 4) { + SDPDBG("To be copied(4) : %d\n", toBeCopied); + free(base_uuid); + return NULL; } - return bluetooth_base_uuid; + strncpy(temp, dataPtr, toBeCopied); + strncat(temp, (delimPtr + 1), 4); + dataLongValue = htonl(strtoul(temp, NULL, 16)); + memcpy(&data[8], &dataLongValue, 4); + dataLongValue = htonl(strtoul(delimPtr + 5, NULL, 16)); + memcpy(&data[12], &dataLongValue, 4); + + return base_uuid; } uuid_t *sdp_uuid16_create(uuid_t *u, uint16_t val) @@ -2212,12 +2222,11 @@ void sdp_uuid16_to_uuid128(uuid_t *uuid128, uuid_t *uuid16) unsigned short data1; // allocate a 128bit UUID and init to the Bluetooth base UUID - uint128_t *pBTBase128Bit = sdp_create_base_uuid(); - uuid128->value.uuid128 = *pBTBase128Bit; + uuid128->value.uuid128 = bluetooth_base_uuid; uuid128->type = SDP_UUID128; // extract bytes 2 and 3 of 128bit BT base UUID - memcpy(&data1, &pBTBase128Bit->data[2], 2); + memcpy(&data1, &bluetooth_base_uuid.data[2], 2); // add the given UUID (16 bits) data1 += htons(uuid16->value.uuid16); @@ -2235,12 +2244,11 @@ void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32) unsigned int data0; // allocate a 128bit UUID and init to the Bluetooth base UUID - uint128_t *pBTBase128Bit = sdp_create_base_uuid(); - uuid128->value.uuid128 = *pBTBase128Bit; + uuid128->value.uuid128 = bluetooth_base_uuid; uuid128->type = SDP_UUID128; // extract first 4 bytes - memcpy(&data0, &pBTBase128Bit->data[0], 4); + memcpy(&data0, &bluetooth_base_uuid.data[0], 4); // add the given UUID (32bits) data0 += htonl(uuid32->value.uuid32); @@ -2273,11 +2281,10 @@ uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid) */ int sdp_uuid128_to_uuid(uuid_t *uuid) { - extern uint128_t *sdp_create_base_uuid(); - int i; - uint128_t *b = sdp_create_base_uuid(); + uint128_t *b = &bluetooth_base_uuid; uint128_t *u = &uuid->value.uuid128; uint32_t data; + int i; if (uuid->type != SDP_UUID128) return 1; @@ -2290,7 +2297,7 @@ int sdp_uuid128_to_uuid(uuid_t *uuid) data = htonl(data); if (data <= 0xffff) { uuid->type = SDP_UUID16; - uuid->value.uuid16 = (uint16_t)data; + uuid->value.uuid16 = (uint16_t) data; } else { uuid->type = SDP_UUID32; uuid->value.uuid32 = data; -- cgit From c30706178221e3df5dfe82eb5c91f39fe118eb78 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 31 Aug 2007 20:08:52 +0000 Subject: Fix Bluetooth base UUID typo --- src/sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index fcf5c897..cf1a9895 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -90,7 +90,7 @@ static inline void ntoh128(uint128_t *src, uint128_t *dst) static uint128_t bluetooth_base_uuid = { .data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, - 0x80, 0x00, 0x00, 0x80, 0x5F, 0xF9, 0xB3, 0xFB } + 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB } }; #define SDP_MAX_ATTR_LEN 65535 -- cgit From 819661edc6f2144e85690c5a957f338ee668d89d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 2 Sep 2007 18:34:50 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9beb29f9..e1f38eb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.18: + Don't allocate memory for the Bluetooth base UUID. + ver 3.17: Fix supported commands bit calculation. diff --git a/configure.in b/configure.in index cd915de9..bf90302e 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.17) +AM_INIT_AUTOMAKE(bluez-libs, 3.18) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 8b805f22..c7591d6d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 10:3:8 +libbluetooth_la_LDFLAGS = -version-info 10:4:8 INCLUDES = -I$(top_builddir)/include -- cgit From 302330d72bbdc03f33090747ae4b13110ec3a9c4 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 16 Sep 2007 10:54:46 +0000 Subject: Add L2CAP mode constants --- include/l2cap.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/l2cap.h b/include/l2cap.h index 49006803..478819ec 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -161,6 +161,10 @@ typedef struct { #define L2CAP_CONF_MAX_SIZE 22 +#define L2CAP_MODE_BASIC 0x00 +#define L2CAP_MODE_RETRANS 0x01 +#define L2CAP_MODE_FLOWCTL 0x02 + typedef struct { uint16_t dcid; uint16_t scid; -- cgit From 0d5bcfd73f1d52e3c2b49b28062f9972f40ad42f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 16 Sep 2007 10:56:39 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1f38eb0..584c24a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.19: + Add L2CAP mode constants. + ver 3.18: Don't allocate memory for the Bluetooth base UUID. diff --git a/configure.in b/configure.in index bf90302e..2183f1c1 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.18) +AM_INIT_AUTOMAKE(bluez-libs, 3.19) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index c7591d6d..0c758ee1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 10:4:8 +libbluetooth_la_LDFLAGS = -version-info 10:5:8 INCLUDES = -I$(top_builddir)/include -- cgit From f4afe8ea387410929ee303a510fd7cdfd1cc7552 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Oct 2007 11:23:35 +0000 Subject: Add support for inquiry transmit power level --- include/hci_lib.h | 2 ++ src/hci.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index 1215a62f..7b728283 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -101,6 +101,8 @@ int hci_write_ext_inquiry_response(int dd, uint8_t fec, uint8_t *data, int to); int hci_read_simple_pairing_mode(int dd, uint8_t *mode, int to); int hci_write_simple_pairing_mode(int dd, uint8_t mode, int to); int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to); +int hci_read_inquiry_transmit_power_level(int dd, int8_t *level, int to); +int hci_write_inquiry_transmit_power_level(int dd, int8_t level, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); diff --git a/src/hci.c b/src/hci.c index 54e57cf3..8351c475 100644 --- a/src/hci.c +++ b/src/hci.c @@ -2135,6 +2135,57 @@ int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to) return 0; } +int hci_read_inquiry_transmit_power_level(int dd, int8_t *level, int to) +{ + read_inquiry_transmit_power_level_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_READ_INQUIRY_TRANSMIT_POWER_LEVEL; + rq.rparam = &rp; + rq.rlen = READ_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *level = rp.level; + return 0; +} + +int hci_write_inquiry_transmit_power_level(int dd, int8_t level, int to) +{ + write_inquiry_transmit_power_level_cp cp; + write_inquiry_transmit_power_level_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.level = level; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_HOST_CTL; + rq.ocf = OCF_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL; + rq.cparam = &cp; + rq.clen = WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_INQUIRY_TRANSMIT_POWER_LEVEL_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} + int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to) { read_transmit_power_level_cp cp; -- cgit From a0303b05f6eeb967dfa60600e10c32282f6ab33f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 5 Oct 2007 11:26:17 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 584c24a1..436b43b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.20: + Add support for inquiry transmit power level. + ver 3.19: Add L2CAP mode constants. diff --git a/configure.in b/configure.in index 2183f1c1..cca4829d 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.19) +AM_INIT_AUTOMAKE(bluez-libs, 3.20) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 0c758ee1..27d7dec5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 10:5:8 +libbluetooth_la_LDFLAGS = -version-info 11:0:9 INCLUDES = -I$(top_builddir)/include -- cgit From 37651dd5c06b2e176f4bfdc99f5702e55a520ee9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 24 Oct 2007 21:16:46 +0000 Subject: Add constant for Bluetooth socket options level --- include/bluetooth.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/bluetooth.h b/include/bluetooth.h index 1d377781..d483d904 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -41,6 +41,10 @@ extern "C" { #define PF_BLUETOOTH AF_BLUETOOTH #endif +#ifndef SOL_BLUETOOTH +#define SOL_BLUETOOTH 274 +#endif + #define BTPROTO_L2CAP 0 #define BTPROTO_HCI 1 #define BTPROTO_SCO 2 -- cgit From f35f7aa9aacf6cba18949d927f279475c7ca1571 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 24 Oct 2007 22:22:34 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 436b43b9..b5351570 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.21: + Add constant for Bluetooth socket options level. + ver 3.20: Add support for inquiry transmit power level. diff --git a/configure.in b/configure.in index cca4829d..083dcaa5 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.20) +AM_INIT_AUTOMAKE(bluez-libs, 3.21) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 27d7dec5..5f021b39 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 11:0:9 +libbluetooth_la_LDFLAGS = -version-info 11:1:9 INCLUDES = -I$(top_builddir)/include -- cgit From d1a192c601d9e0e0f4f0da13fadccb50904c5004 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Oct 2007 23:03:55 +0000 Subject: Fix remote name request event handling --- src/hci.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index 8351c475..dbfc8ba5 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1009,7 +1009,9 @@ int hci_send_req(int dd, struct hci_request *r, int to) try = 10; while (try--) { evt_cmd_complete *cc; - evt_cmd_status *cs; + evt_cmd_status *cs; + evt_remote_name_req_complete *rn; + remote_name_req_cp *cp; if (to) { struct pollfd p; @@ -1074,6 +1076,20 @@ int hci_send_req(int dd, struct hci_request *r, int to) memcpy(r->rparam, ptr, r->rlen); goto done; + case EVT_REMOTE_NAME_REQ_COMPLETE: + if (hdr->evt != r->event) + break; + + rn = r->rparam; + cp = r->cparam; + + if (bacmp(&rn->bdaddr, &cp->bdaddr)) + continue; + + r->rlen = MIN(len, r->rlen); + memcpy(r->rparam, ptr, r->rlen); + goto done; + default: if (hdr->evt != r->event) break; -- cgit From ea66d4c5353160087ff0cb4c6a1014c5fdd1cffc Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 25 Oct 2007 23:05:25 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5351570..fce59a04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.22: + Fix remote name request event handling. + ver 3.21: Add constant for Bluetooth socket options level. diff --git a/configure.in b/configure.in index 083dcaa5..fe088876 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.21) +AM_INIT_AUTOMAKE(bluez-libs, 3.22) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 5f021b39..87429799 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 11:1:9 +libbluetooth_la_LDFLAGS = -version-info 11:2:9 INCLUDES = -I$(top_builddir)/include -- cgit From 6c33a52af7bb9bd45c2526265e0ec91ac3f994c0 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 25 Nov 2007 12:41:14 +0000 Subject: Fix remote name request handling bug --- src/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index dbfc8ba5..875ac9c2 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1080,7 +1080,7 @@ int hci_send_req(int dd, struct hci_request *r, int to) if (hdr->evt != r->event) break; - rn = r->rparam; + rn = (void *) ptr; cp = r->cparam; if (bacmp(&rn->bdaddr, &cp->bdaddr)) -- cgit From 00eb7685233f2061c9b752f453bca7aa10a5c576 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 Dec 2007 21:46:12 +0000 Subject: Improve build system --- Makefile.am | 2 +- bluez.pc.in | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0010ae58..b51795a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = bluez.pc -DISTCLEANFILES = bluez.pc +DISTCLEANFILES = $(pkgconfig_DATA) MAINTAINERCLEANFILES = Makefile.in \ aclocal.m4 configure config.h.in config.sub config.guess \ diff --git a/bluez.pc.in b/bluez.pc.in index e7d98ee8..3d6e5961 100644 --- a/bluez.pc.in +++ b/bluez.pc.in @@ -6,6 +6,5 @@ includedir=@includedir@ Name: BlueZ Description: Bluetooth protocol stack for Linux Version: @VERSION@ -Requires: Libs: -L${libdir} -lbluetooth Cflags: -I${includedir} -- cgit From a1ade55a6ffb38b0a3c10fa3e1f88a265d28cab6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 8 Dec 2007 21:49:10 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fce59a04..7d5f7843 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.23: + Fix remote name request handling bug. + ver 3.22: Fix remote name request event handling. diff --git a/configure.in b/configure.in index fe088876..cc27a1cb 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.22) +AM_INIT_AUTOMAKE(bluez-libs, 3.23) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 87429799..2613af59 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 11:2:9 +libbluetooth_la_LDFLAGS = -version-info 11:3:9 INCLUDES = -I$(top_builddir)/include -- cgit From 1622daf2f8fa0abeb0a11be14558ed30a17fc044 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 25 Dec 2007 20:35:41 +0000 Subject: Add definitions for MDP --- include/sdp.h | 6 ++++++ src/sdp.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index 05572c06..61cc2637 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -138,6 +138,9 @@ extern "C" { #define VIDEO_SOURCE_SVCLASS_ID 0x1303 #define VIDEO_SINK_SVCLASS_ID 0x1304 #define VIDEO_DISTRIBUTION_SVCLASS_ID 0x1305 +#define MDP_SVCLASS_ID 0x1400 +#define MDP_SOURCE_SVCLASS_ID 0x1401 +#define MDP_SINK_SVCLASS_ID 0x1402 #define APPLE_AGENT_SVCLASS_ID 0x2112 /* @@ -207,6 +210,9 @@ extern "C" { #define VIDEO_SOURCE_PROFILE_ID VIDEO_SOURCE_SVCLASS_ID #define VIDEO_SINK_PROFILE_ID VIDEO_SINK_SVCLASS_ID #define VIDEO_DISTRIBUTION_PROFILE_ID VIDEO_DISTRIBUTION_SVCLASS_ID +#define MDP_PROFILE_ID MDP_SVCLASS_ID +#define MDP_SOURCE_PROFILE_ID MDP_SROUCE_SVCLASS_ID +#define MDP_SINK_PROFILE_ID MDP_SINK_SVCLASS_ID #define APPLE_AGENT_PROFILE_ID APPLE_AGENT_SVCLASS_ID /* diff --git a/src/sdp.c b/src/sdp.c index cf1a9895..16dd7774 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -192,6 +192,9 @@ static struct tupla ServiceClass[] = { { VIDEO_SOURCE_SVCLASS_ID, "Video Source" }, { VIDEO_SINK_SVCLASS_ID, "Video Sink" }, { VIDEO_DISTRIBUTION_SVCLASS_ID, "Video Distribution" }, + { MDP_SVCLASS_ID, "MDP" }, + { MDP_SOURCE_SVCLASS_ID, "MDP Source" }, + { MDP_SINK_SVCLASS_ID, "MDP Sink" }, { APPLE_AGENT_SVCLASS_ID, "Apple Agent" }, { 0 } }; -- cgit From cd0c03f1c182b633855b256540a42d83cbed4538 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 25 Dec 2007 20:40:04 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d5f7843..bade4bed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.24: + Add definitions for MDP. + ver 3.23: Fix remote name request handling bug. diff --git a/configure.in b/configure.in index cc27a1cb..b98232e6 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.23) +AM_INIT_AUTOMAKE(bluez-libs, 3.24) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 2613af59..0c91924d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 11:3:9 +libbluetooth_la_LDFLAGS = -version-info 11:4:9 INCLUDES = -I$(top_builddir)/include -- cgit From 7208028266fc19d380ac77c97c46b6f2fdc80e1d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:11:09 +0000 Subject: Update copyright information --- README | 2 +- include/bluetooth.h | 2 +- include/bnep.h | 2 +- include/cmtp.h | 2 +- include/hci.h | 2 +- include/hci_lib.h | 2 +- include/hidp.h | 2 +- include/l2cap.h | 2 +- include/rfcomm.h | 2 +- include/sco.h | 2 +- include/sdp.h | 2 +- include/sdp_lib.h | 2 +- src/bluetooth.c | 2 +- src/hci.c | 2 +- src/sdp.c | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README b/README index ad1b80b8..4b236a1b 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated Copyright (C) 2002-2003 Maxim Krasnyansky -Copyright (C) 2002-2006 Marcel Holtmann +Copyright (C) 2002-2008 Marcel Holtmann Bluetooth libraries diff --git a/include/bluetooth.h b/include/bluetooth.h index d483d904..d886cb80 100644 --- a/include/bluetooth.h +++ b/include/bluetooth.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/bnep.h b/include/bnep.h index 90b650ea..75eaac05 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/cmtp.h b/include/cmtp.h index e81a9ecc..16add1d2 100644 --- a/include/cmtp.h +++ b/include/cmtp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci.h b/include/hci.h index a4f88146..92c3a447 100644 --- a/include/hci.h +++ b/include/hci.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hci_lib.h b/include/hci_lib.h index 7b728283..b2b78e80 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/hidp.h b/include/hidp.h index 580495f5..74da6897 100644 --- a/include/hidp.h +++ b/include/hidp.h @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2003-2007 Marcel Holtmann + * Copyright (C) 2003-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/l2cap.h b/include/l2cap.h index 478819ec..d54e74d2 100644 --- a/include/l2cap.h +++ b/include/l2cap.h @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/rfcomm.h b/include/rfcomm.h index 6cdfb614..5c4751ea 100644 --- a/include/rfcomm.h +++ b/include/rfcomm.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sco.h b/include/sco.h index 836784a0..bce7098f 100644 --- a/include/sco.h +++ b/include/sco.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/include/sdp.h b/include/sdp.h index 61cc2637..293e6ec8 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 9a8ab4fd..eac2fe6d 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * diff --git a/src/bluetooth.c b/src/bluetooth.c index 5cbff47f..afbd4928 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/hci.c b/src/hci.c index 875ac9c2..dd8a6ace 100644 --- a/src/hci.c +++ b/src/hci.c @@ -4,7 +4,7 @@ * * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify diff --git a/src/sdp.c b/src/sdp.c index 16dd7774..40d694de 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -4,7 +4,7 @@ * * Copyright (C) 2001-2002 Nokia Corporation * Copyright (C) 2002-2003 Maxim Krasnyansky - * Copyright (C) 2002-2007 Marcel Holtmann + * Copyright (C) 2002-2008 Marcel Holtmann * Copyright (C) 2002-2003 Stephen Crane * * -- cgit From 2de9995f627814f06079793ddee32e6a68188105 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:13:16 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bade4bed..34f099a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.25: + Update copyright information. + ver 3.24: Add definitions for MDP. diff --git a/configure.in b/configure.in index b98232e6..40c18fc0 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.24) +AM_INIT_AUTOMAKE(bluez-libs, 3.25) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From b393cdff611943a05ec598048b5c4be8130151dd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 13:17:16 +0000 Subject: Fix compilation problem with USHRT_MAX and UCHAR_MAX --- src/sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index 40d694de..3b1a5d93 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -30,9 +30,10 @@ #include #include -#include #include +#include #include +#include #include #include #include -- cgit From 39d17f6566147b3516db4277841dd3f93db3d8e0 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 11 Feb 2008 00:42:05 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 34f099a6..aeb77538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.26: + Fix compilation problem with USHRT_MAX and UCHAR_MAX. + ver 3.25: Update copyright information. diff --git a/configure.in b/configure.in index 40c18fc0..82b5765d 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.25) +AM_INIT_AUTOMAKE(bluez-libs, 3.26) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 20b6d88f9505c38b03a998db38be742eedf0e0df Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 23 Feb 2008 00:22:19 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index afbd4928..c8ad0b11 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -433,6 +433,8 @@ char *bt_compidtostr(int compid) return "Accel Semiconductor Ltd."; case 75: return "Continental Automotive Systems"; + case 76: + return "Apple, Inc."; case 65535: return "internal use"; default: -- cgit From 5ab165a4d37a0fd2893f70a59318fa0bdf066324 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 23 Feb 2008 00:23:22 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index aeb77538..b8b5a811 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.27: + Add another company identifier. + ver 3.26: Fix compilation problem with USHRT_MAX and UCHAR_MAX. diff --git a/configure.in b/configure.in index 82b5765d..a3841a5b 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.26) +AM_INIT_AUTOMAKE(bluez-libs, 3.27) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From f767416e71484be2463caa6482dc978e165cabae Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 5 Mar 2008 19:30:32 +0000 Subject: Add support for MCAP UUIDs --- include/sdp.h | 2 ++ src/sdp.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/sdp.h b/include/sdp.h index 293e6ec8..dd5b0e24 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -69,6 +69,8 @@ extern "C" { #define AVDTP_UUID 0x0019 #define CMTP_UUID 0x001b #define UDI_UUID 0x001d +#define MCAP_CTRL_UUID 0x001e +#define MCAP_DATA_UUID 0x001f #define L2CAP_UUID 0x0100 /* diff --git a/src/sdp.c b/src/sdp.c index 3b1a5d93..44ba17e4 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -124,6 +124,8 @@ static struct tupla Protocol[] = { { AVDTP_UUID, "AVDTP" }, { CMTP_UUID, "CMTP" }, { UDI_UUID, "UDI" }, + { MCAP_CTRL_UUID, "MCAP-Ctrl" }, + { MCAP_DATA_UUID, "MCAP-Data" }, { L2CAP_UUID, "L2CAP" }, { 0 } }; -- cgit From 03bac653ed513d6efaaa36eb349b5ca9a23dce19 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 5 Mar 2008 19:36:50 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8b5a811..9e8b69e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.28: + Add support for MCAP UUIDs. + ver 3.27: Add another company identifier. diff --git a/configure.in b/configure.in index a3841a5b..1029f3be 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.27) +AM_INIT_AUTOMAKE(bluez-libs, 3.28) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 0c91924d..0115a7c5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 11:4:9 +libbluetooth_la_LDFLAGS = -version-info 11:5:9 INCLUDES = -I$(top_builddir)/include -- cgit From 1f9ec47e02cc789ab45c85e855c4f9e377df7e3c Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 10 Mar 2008 21:57:46 +0000 Subject: sdp_get_uuidseq_attr: fixed memory leak --- src/sdp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 44ba17e4..28e24c0a 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1530,13 +1530,14 @@ int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr, sdp_list_t **se if (sdpdata && sdpdata->dtd >= SDP_SEQ8 && sdpdata->dtd <= SDP_SEQ32) { sdp_data_t *d; for (d = sdpdata->val.dataseq; d; d = d->next) { - uuid_t *u = malloc(sizeof(uuid_t)); - memset((char *)u, 0, sizeof(uuid_t)); - if (d->dtd >= SDP_UUID16 && d->dtd <= SDP_UUID128) { - *u = d->val.uuid; - *seqp = sdp_list_append(*seqp, u); - } else + uuid_t *u; + if (d->dtd < SDP_UUID16 || d->dtd > SDP_UUID128) goto fail; + + u = malloc(sizeof(uuid_t)); + memset(u, 0, sizeof(uuid_t)); + *u = d->val.uuid; + *seqp = sdp_list_append(*seqp, u); } return 0; } -- cgit From 60ece348f344fc1e5d4ac7113e916155c1e350a2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 21 Mar 2008 23:34:11 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e8b69e3..186916a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.29: + Fix memory leak in sdp_get_uuidseq_attr function. + ver 3.28: Add support for MCAP UUIDs. diff --git a/configure.in b/configure.in index 1029f3be..ca7098be 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.28) +AM_INIT_AUTOMAKE(bluez-libs, 3.29) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 0115a7c5..7d19490f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 11:5:9 +libbluetooth_la_LDFLAGS = -version-info 11:6:9 INCLUDES = -I$(top_builddir)/include -- cgit From f4f6e80b7ba37ed1f4e6505995a24f9185e6fb19 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Apr 2008 01:11:50 +0000 Subject: Add another company identifier --- src/bluetooth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index c8ad0b11..d183d97e 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -435,6 +435,8 @@ char *bt_compidtostr(int compid) return "Continental Automotive Systems"; case 76: return "Apple, Inc."; + case 77: + return "Staccato Communications, Inc."; case 65535: return "internal use"; default: -- cgit From ca433eee144b32ec99726b06409e0326de16cac2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 3 Apr 2008 01:14:59 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 186916a9..ef2daa4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.30: + Add another company identifier. + ver 3.29: Fix memory leak in sdp_get_uuidseq_attr function. diff --git a/configure.in b/configure.in index ca7098be..9d4b220f 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.29) +AM_INIT_AUTOMAKE(bluez-libs, 3.30) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 8e294a5cbd81dadb65f9420dd03e40c75195c6f9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 11 Apr 2008 23:39:00 +0000 Subject: Don't optimize when debug is enabled --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index f450f9ad..e12fd01a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -61,6 +61,6 @@ AC_DEFUN([AC_ARG_BLUEZ], [ fi if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then - CFLAGS="$CFLAGS -g" + CFLAGS="$CFLAGS -g -O0" fi ]) -- cgit From c19e86a336612989a717407ea35c09f744c5c482 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 6 May 2008 01:22:32 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ef2daa4c..15d87e66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.31: + Don't optimize when debug is enabled. + ver 3.30: Add another company identifier. diff --git a/configure.in b/configure.in index 9d4b220f..c4c5ec38 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.30) +AM_INIT_AUTOMAKE(bluez-libs, 3.31) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From 237531ab9c9e06a131b34d6524bab659d8147fdf Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 15 May 2008 15:33:36 +0000 Subject: Add OCF constants for synchronous flow control enabling --- include/hci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hci.h b/include/hci.h index 92c3a447..6e295be3 100644 --- a/include/hci.h +++ b/include/hci.h @@ -869,6 +869,10 @@ typedef struct { } __attribute__ ((packed)) read_transmit_power_level_rp; #define READ_TRANSMIT_POWER_LEVEL_RP_SIZE 4 +#define OCF_READ_SYNC_FLOW_ENABLE 0x002E + +#define OCF_WRITE_SYNC_FLOW_ENABLE 0x002F + #define OCF_SET_CONTROLLER_TO_HOST_FC 0x0031 #define OCF_HOST_BUFFER_SIZE 0x0033 -- cgit From bd89e0b981558100ce906d57f959f1436dbf4ede Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 20 May 2008 21:16:41 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 15d87e66..f882394f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.32: + Add OCF constants for synchronous flow control enabling. + ver 3.31: Don't optimize when debug is enabled. diff --git a/configure.in b/configure.in index c4c5ec38..b086dbdf 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.31) +AM_INIT_AUTOMAKE(bluez-libs, 3.32) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE -- cgit From bb45b882917f26aaa26b2b903b70d622b39cce84 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 11 Jun 2008 13:12:21 +0000 Subject: It is better to include string.h instead of malloc.h --- src/bluetooth.c | 1 - src/hci.c | 1 - src/sdp.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bluetooth.c b/src/bluetooth.c index d183d97e..463e0e05 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include diff --git a/src/hci.c b/src/hci.c index dd8a6ace..280a654a 100644 --- a/src/hci.c +++ b/src/hci.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include diff --git a/src/sdp.c b/src/sdp.c index 28e24c0a..3ec877a1 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include -- cgit From a39a1b4c3e075e80d05caad61646a352693f5455 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 12 Jun 2008 21:40:14 +0000 Subject: Add functions for reading and writing the link policy settings --- include/hci_lib.h | 2 ++ src/hci.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/include/hci_lib.h b/include/hci_lib.h index b2b78e80..ccd155a5 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -104,6 +104,8 @@ int hci_read_local_oob_data(int dd, uint8_t *hash, uint8_t *randomizer, int to); int hci_read_inquiry_transmit_power_level(int dd, int8_t *level, int to); int hci_write_inquiry_transmit_power_level(int dd, int8_t level, int to); int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t *level, int to); +int hci_read_link_policy(int dd, uint16_t handle, uint16_t *policy, int to); +int hci_write_link_policy(int dd, uint16_t handle, uint16_t policy, int to); int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to); int hci_write_link_supervision_timeout(int dd, uint16_t handle, uint16_t timeout, int to); int hci_set_afh_classification(int dd, uint8_t *map, int to); diff --git a/src/hci.c b/src/hci.c index 280a654a..e2c355c0 100644 --- a/src/hci.c +++ b/src/hci.c @@ -2231,6 +2231,60 @@ int hci_read_transmit_power_level(int dd, uint16_t handle, uint8_t type, int8_t return 0; } +int hci_read_link_policy(int dd, uint16_t handle, uint16_t *policy, int to) +{ + read_link_policy_rp rp; + struct hci_request rq; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_LINK_POLICY; + rq.ocf = OCF_READ_LINK_POLICY; + rq.cparam = &handle; + rq.clen = 2; + rq.rparam = &rp; + rq.rlen = READ_LINK_POLICY_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + *policy = rp.policy; + return 0; +} + +int hci_write_link_policy(int dd, uint16_t handle, uint16_t policy, int to) +{ + write_link_policy_cp cp; + write_link_policy_rp rp; + struct hci_request rq; + + memset(&cp, 0, sizeof(cp)); + cp.handle = handle; + cp.policy = policy; + + memset(&rq, 0, sizeof(rq)); + rq.ogf = OGF_LINK_POLICY; + rq.ocf = OCF_WRITE_LINK_POLICY; + rq.cparam = &cp; + rq.clen = WRITE_LINK_POLICY_CP_SIZE; + rq.rparam = &rp; + rq.rlen = WRITE_LINK_POLICY_RP_SIZE; + + if (hci_send_req(dd, &rq, to) < 0) + return -1; + + if (rp.status) { + errno = EIO; + return -1; + } + + return 0; +} + int hci_read_link_supervision_timeout(int dd, uint16_t handle, uint16_t *timeout, int to) { read_link_supervision_timeout_rp rp; -- cgit From 70ee40161f6faa1faa8670ca2fd7b517c4de0598 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 16 Jun 2008 00:49:28 +0000 Subject: Enable usage of PIE by default --- acinclude.m4 | 12 +++++++++++- configure.in | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index e12fd01a..6242e390 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -45,13 +45,18 @@ AC_DEFUN([AC_INIT_BLUEZ], [ ]) AC_DEFUN([AC_ARG_BLUEZ], [ - fortify_enable=yes debug_enable=no + fortify_enable=yes + pie_enable=yes AC_ARG_ENABLE(fortify, AC_HELP_STRING([--disable-fortify], [disable compile time buffer checks]), [ fortify_enable=${enableval} ]) + AC_ARG_ENABLE(pie, AC_HELP_STRING([--disable-pie], [enable position independent executables flag]), [ + pie_enable=${enableval} + ]) + AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable compiling with debugging information]), [ debug_enable=${enableval} ]) @@ -60,6 +65,11 @@ AC_DEFUN([AC_ARG_BLUEZ], [ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" fi + if (test "${pie_enable}" = "yes" && test "${ac_cv_prog_cc_pie}" = "yes"); then + CFLAGS="$CFLAGS -fPIC" + LDFLAGS="$LDFLAGS -pie" + fi + if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then CFLAGS="$CFLAGS -g -O0" fi diff --git a/configure.in b/configure.in index b086dbdf..2e6c5510 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,7 @@ AC_INIT_BLUEZ AC_LANG_C AC_PROG_CC +AC_PROG_CC_PIE AC_PROG_INSTALL m4_define([_LT_AC_TAGCONFIG], []) -- cgit From 1c2202809e5da072ac3cf8b832b5ae310369bad6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 16 Jun 2008 01:23:58 +0000 Subject: Add definition for authentication requirements --- include/hci.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/hci.h b/include/hci.h index 6e295be3..499f1bdd 100644 --- a/include/hci.h +++ b/include/hci.h @@ -83,6 +83,7 @@ enum { #define HCIGETDEVINFO _IOR('H', 211, int) #define HCIGETCONNLIST _IOR('H', 212, int) #define HCIGETCONNINFO _IOR('H', 213, int) +#define HCIGETAUTHINFO _IOR('H', 215, int) #define HCISETRAW _IOW('H', 220, int) #define HCISETSCAN _IOW('H', 221, int) @@ -1813,6 +1814,11 @@ struct hci_conn_info_req { struct hci_conn_info conn_info[0]; }; +struct hci_auth_info_req { + bdaddr_t bdaddr; + uint8_t type; +}; + struct hci_inquiry_req { uint16_t dev_id; uint16_t flags; -- cgit From 5e4c3e1a8fdab9ac8a45ef0e80cd045421c73621 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 18 Jun 2008 16:09:54 +0000 Subject: Update changelog and bump version number --- ChangeLog | 5 +++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f882394f..43b4aa95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +ver 3.33: + Add functions for reading and writing the link policy settings. + Add definition for authentication requirements. + Enable PIE by default if supported. + ver 3.32: Add OCF constants for synchronous flow control enabling. diff --git a/configure.in b/configure.in index 2e6c5510..3b77c1e0 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.32) +AM_INIT_AUTOMAKE(bluez-libs, 3.33) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 7d19490f..a03816e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 11:6:9 +libbluetooth_la_LDFLAGS = -version-info 12:0:10 INCLUDES = -I$(top_builddir)/include -- cgit From a3648e0df0ff53fef74e5437ff089aef96209db2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 20 Jun 2008 03:30:53 +0000 Subject: Add more safe version of three low-level extraction functions --- include/sdp_lib.h | 3 + src/sdp.c | 299 +++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 223 insertions(+), 79 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index eac2fe6d..2323abfc 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -479,6 +479,7 @@ void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32); int sdp_uuid128_to_uuid(uuid_t *uuid); int sdp_uuid_to_proto(uuid_t *uuid); int sdp_uuid_extract(const uint8_t *buffer, uuid_t *uuid, int *scanned); +int sdp_uuid_extract_safe(const uint8_t *buffer, int bufsize, uuid_t *uuid, int *scanned); void sdp_uuid_print(const uuid_t *uuid); #define MAX_LEN_UUID_STR 37 @@ -601,8 +602,10 @@ int sdp_gen_pdu(sdp_buf_t *pdu, sdp_data_t *data); int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *pdu); int sdp_extract_seqtype(const uint8_t *buf, uint8_t *dtdp, int *seqlen); +int sdp_extract_seqtype_safe(const uint8_t *buf, int bufsize, uint8_t *dtdp, int *size); sdp_data_t *sdp_extract_attr(const uint8_t *pdata, int *extractedLength, sdp_record_t *rec); +sdp_data_t *sdp_extract_attr_safe(const uint8_t *pdata, int bufsize, int *extractedLength, sdp_record_t *rec); void sdp_pattern_add_uuid(sdp_record_t *rec, uuid_t *uuid); void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq); diff --git a/src/sdp.c b/src/sdp.c index 3ec877a1..977f6660 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -904,15 +904,76 @@ void sdp_data_free(sdp_data_t *d) free(d); } -static sdp_data_t *extract_int(const void *p, int *len) +int sdp_uuid_extract_safe(const uint8_t *p, int bufsize, uuid_t *uuid, int *scanned) { - sdp_data_t *d = malloc(sizeof(sdp_data_t)); + uint8_t type; + + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + return -1; + } + + type = *(const uint8_t *) p; + + if (!SDP_IS_UUID(type)) { + SDPERR("Unknown data type : %d expecting a svc UUID\n", type); + return -1; + } + p += sizeof(uint8_t); + *scanned += sizeof(uint8_t); + bufsize -= sizeof(uint8_t); + if (type == SDP_UUID16) { + if (bufsize < sizeof(uint16_t)) { + SDPERR("Not enough room for 16-bit UUID"); + return -1; + } + sdp_uuid16_create(uuid, ntohs(bt_get_unaligned((uint16_t *) p))); + *scanned += sizeof(uint16_t); + p += sizeof(uint16_t); + } else if (type == SDP_UUID32) { + if (bufsize < sizeof(uint32_t)) { + SDPERR("Not enough room for 32-bit UUID"); + return -1; + } + sdp_uuid32_create(uuid, ntohl(bt_get_unaligned((uint32_t *) p))); + *scanned += sizeof(uint32_t); + p += sizeof(uint32_t); + } else { + if (bufsize < sizeof(uint128_t)) { + SDPERR("Not enough room for 128-bit UUID"); + return -1; + } + sdp_uuid128_create(uuid, p); + *scanned += sizeof(uint128_t); + p += sizeof(uint128_t); + } + return 0; +} + +int sdp_uuid_extract(const uint8_t *p, uuid_t *uuid, int *scanned) +{ + /* Assume p points to a buffer of size at least SDP_MAX_ATTR_LEN, + because we don't have any better information */ + return sdp_uuid_extract_safe(p, SDP_MAX_ATTR_LEN, uuid, scanned); +} + +static sdp_data_t *extract_int(const void *p, int bufsize, int *len) +{ + sdp_data_t *d; + + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + return NULL; + } + + d = malloc(sizeof(sdp_data_t)); SDPDBG("Extracting integer\n"); memset(d, 0, sizeof(sdp_data_t)); d->dtd = *(uint8_t *) p; p += sizeof(uint8_t); *len += sizeof(uint8_t); + bufsize -= sizeof(uint8_t); switch (d->dtd) { case SDP_DATA_NIL: @@ -920,26 +981,51 @@ static sdp_data_t *extract_int(const void *p, int *len) case SDP_BOOL: case SDP_INT8: case SDP_UINT8: + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + free(d); + return NULL; + } *len += sizeof(uint8_t); d->val.uint8 = *(uint8_t *) p; break; case SDP_INT16: case SDP_UINT16: + if (bufsize < sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + free(d); + return NULL; + } *len += sizeof(uint16_t); d->val.uint16 = ntohs(bt_get_unaligned((uint16_t *) p)); break; case SDP_INT32: case SDP_UINT32: + if (bufsize < sizeof(uint32_t)) { + SDPERR("Unexpected end of packet"); + free(d); + return NULL; + } *len += sizeof(uint32_t); d->val.uint32 = ntohl(bt_get_unaligned((uint32_t *) p)); break; case SDP_INT64: case SDP_UINT64: + if (bufsize < sizeof(uint64_t)) { + SDPERR("Unexpected end of packet"); + free(d); + return NULL; + } *len += sizeof(uint64_t); d->val.uint64 = ntoh64(bt_get_unaligned((uint64_t *) p)); break; case SDP_INT128: case SDP_UINT128: + if (bufsize < sizeof(uint128_t)) { + SDPERR("Unexpected end of packet"); + free(d); + return NULL; + } *len += sizeof(uint128_t); ntoh128((uint128_t *) p, &d->val.uint128); break; @@ -950,13 +1036,13 @@ static sdp_data_t *extract_int(const void *p, int *len) return d; } -static sdp_data_t *extract_uuid(const uint8_t *p, int *len, sdp_record_t *rec) +static sdp_data_t *extract_uuid(const uint8_t *p, int bufsize, int *len, sdp_record_t *rec) { sdp_data_t *d = malloc(sizeof(sdp_data_t)); SDPDBG("Extracting UUID"); memset(d, 0, sizeof(sdp_data_t)); - if (sdp_uuid_extract(p, &d->val.uuid, len) < 0) { + if (sdp_uuid_extract_safe(p, bufsize, &d->val.uuid, len) < 0) { free(d); return NULL; } @@ -969,29 +1055,49 @@ static sdp_data_t *extract_uuid(const uint8_t *p, int *len, sdp_record_t *rec) /* * Extract strings from the PDU (could be service description and similar info) */ -static sdp_data_t *extract_str(const void *p, int *len) +static sdp_data_t *extract_str(const void *p, int bufsize, int *len) { char *s; int n; - sdp_data_t *d = malloc(sizeof(sdp_data_t)); + sdp_data_t *d; + + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + return NULL; + } + + d = malloc(sizeof(sdp_data_t)); memset(d, 0, sizeof(sdp_data_t)); d->dtd = *(uint8_t *) p; p += sizeof(uint8_t); *len += sizeof(uint8_t); + bufsize -= sizeof(uint8_t); switch (d->dtd) { case SDP_TEXT_STR8: case SDP_URL_STR8: + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + free(d); + return NULL; + } n = *(uint8_t *) p; p += sizeof(uint8_t); - *len += sizeof(uint8_t) + n; + *len += sizeof(uint8_t); + bufsize -= sizeof(uint8_t); break; case SDP_TEXT_STR16: case SDP_URL_STR16: + if (bufsize < sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + free(d); + return NULL; + } n = ntohs(bt_get_unaligned((uint16_t *) p)); p += sizeof(uint16_t); *len += sizeof(uint16_t) + n; + bufsize -= sizeof(uint16_t); break; default: SDPERR("Sizeof text string > UINT16_MAX\n"); @@ -999,10 +1105,23 @@ static sdp_data_t *extract_str(const void *p, int *len) return 0; } + if (bufsize < n) { + SDPERR("String too long to fit in packet"); + free(d); + return NULL; + } + s = malloc(n + 1); + if (!s) { + SDPERR("Not enough memory for incoming string"); + free(d); + return NULL; + } memset(s, 0, n + 1); memcpy(s, p, n); + *len += n; + SDPDBG("Len : %d\n", n); SDPDBG("Str : %s\n", s); @@ -1011,7 +1130,67 @@ static sdp_data_t *extract_str(const void *p, int *len) return d; } -static sdp_data_t *extract_seq(const void *p, int *len, sdp_record_t *rec) +/* + * Extract the sequence type and its length, and return offset into buf + * or 0 on failure. + */ +int sdp_extract_seqtype_safe(const uint8_t *buf, int bufsize, uint8_t *dtdp, int *size) +{ + uint8_t dtd; + int scanned = sizeof(uint8_t); + + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + return 0; + } + + dtd = *(uint8_t *) buf; + buf += sizeof(uint8_t); + bufsize -= sizeof(uint8_t); + *dtdp = dtd; + switch (dtd) { + case SDP_SEQ8: + case SDP_ALT8: + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + return 0; + } + *size = *(uint8_t *) buf; + scanned += sizeof(uint8_t); + break; + case SDP_SEQ16: + case SDP_ALT16: + if (bufsize < sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + return 0; + } + *size = ntohs(bt_get_unaligned((uint16_t *) buf)); + scanned += sizeof(uint16_t); + break; + case SDP_SEQ32: + case SDP_ALT32: + if (bufsize < sizeof(uint32_t)) { + SDPERR("Unexpected end of packet"); + return 0; + } + *size = ntohl(bt_get_unaligned((uint32_t *) buf)); + scanned += sizeof(uint32_t); + break; + default: + SDPERR("Unknown sequence type, aborting\n"); + return 0; + } + return scanned; +} + +int sdp_extract_seqtype(const uint8_t *buf, uint8_t *dtdp, int *size) +{ + /* Assume buf points to a buffer of size at least SDP_MAX_ATTR_LEN, + because we don't have any better information */ + return sdp_extract_seqtype_safe(buf, SDP_MAX_ATTR_LEN, dtdp, size); +} + +static sdp_data_t *extract_seq(const void *p, int bufsize, int *len, sdp_record_t *rec) { int seqlen, n = 0; sdp_data_t *curr, *prev; @@ -1019,17 +1198,24 @@ static sdp_data_t *extract_seq(const void *p, int *len, sdp_record_t *rec) SDPDBG("Extracting SEQ"); memset(d, 0, sizeof(sdp_data_t)); - *len = sdp_extract_seqtype(p, &d->dtd, &seqlen); + *len = sdp_extract_seqtype_safe(p, bufsize, &d->dtd, &seqlen); SDPDBG("Sequence Type : 0x%x length : 0x%x\n", d->dtd, seqlen); if (*len == 0) return d; + if (*len > bufsize) { + SDPERR("Packet not big enough to hold sequence."); + free(d); + return NULL; + } + p += *len; + bufsize -= *len; curr = prev = NULL; while (n < seqlen) { int attrlen = 0; - curr = sdp_extract_attr(p, &attrlen, rec); + curr = sdp_extract_attr_safe(p, bufsize, &attrlen, rec); if (curr == NULL) break; @@ -1040,6 +1226,7 @@ static sdp_data_t *extract_seq(const void *p, int *len, sdp_record_t *rec) prev = curr; p += attrlen; n += attrlen; + bufsize -= attrlen; SDPDBG("Extracted: %d SequenceLength: %d", n, seqlen); } @@ -1048,11 +1235,18 @@ static sdp_data_t *extract_seq(const void *p, int *len, sdp_record_t *rec) return d; } -sdp_data_t *sdp_extract_attr(const uint8_t *p, int *size, sdp_record_t *rec) +sdp_data_t *sdp_extract_attr_safe(const uint8_t *p, int bufsize, int *size, sdp_record_t *rec) { sdp_data_t *elem; int n = 0; - uint8_t dtd = *(const uint8_t *)p; + uint8_t dtd; + + if (bufsize < sizeof(uint8_t)) { + SDPERR("Unexpected end of packet"); + return NULL; + } + + dtd = *(const uint8_t *)p; SDPDBG("extract_attr: dtd=0x%x", dtd); switch (dtd) { @@ -1068,12 +1262,12 @@ sdp_data_t *sdp_extract_attr(const uint8_t *p, int *size, sdp_record_t *rec) case SDP_INT32: case SDP_INT64: case SDP_INT128: - elem = extract_int(p, &n); + elem = extract_int(p, bufsize, &n); break; case SDP_UUID16: case SDP_UUID32: case SDP_UUID128: - elem = extract_uuid(p, &n, rec); + elem = extract_uuid(p, bufsize, &n, rec); break; case SDP_TEXT_STR8: case SDP_TEXT_STR16: @@ -1081,7 +1275,7 @@ sdp_data_t *sdp_extract_attr(const uint8_t *p, int *size, sdp_record_t *rec) case SDP_URL_STR8: case SDP_URL_STR16: case SDP_URL_STR32: - elem = extract_str(p, &n); + elem = extract_str(p, bufsize, &n); break; case SDP_SEQ8: case SDP_SEQ16: @@ -1089,7 +1283,7 @@ sdp_data_t *sdp_extract_attr(const uint8_t *p, int *size, sdp_record_t *rec) case SDP_ALT8: case SDP_ALT16: case SDP_ALT32: - elem = extract_seq(p, &n, rec); + elem = extract_seq(p, bufsize, &n, rec); break; default: SDPERR("Unknown data descriptor : 0x%x terminating\n", dtd); @@ -1099,6 +1293,13 @@ sdp_data_t *sdp_extract_attr(const uint8_t *p, int *size, sdp_record_t *rec) return elem; } +sdp_data_t *sdp_extract_attr(const uint8_t *p, int *size, sdp_record_t *rec) +{ + /* Assume p points to a buffer of size at least SDP_MAX_ATTR_LEN, + because we don't have any better information */ + return sdp_extract_attr_safe(p, SDP_MAX_ATTR_LEN, size, rec); +} + #ifdef SDP_DEBUG static void attr_print_func(void *value, void *userData) { @@ -1262,40 +1463,6 @@ sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attrId) return NULL; } -/* - * Extract the sequence type and its length, and return offset into buf - * or 0 on failure. - */ -int sdp_extract_seqtype(const uint8_t *buf, uint8_t *dtdp, int *size) -{ - uint8_t dtd = *(uint8_t *) buf; - int scanned = sizeof(uint8_t); - - buf += sizeof(uint8_t); - *dtdp = dtd; - switch (dtd) { - case SDP_SEQ8: - case SDP_ALT8: - *size = *(uint8_t *) buf; - scanned += sizeof(uint8_t); - break; - case SDP_SEQ16: - case SDP_ALT16: - *size = ntohs(bt_get_unaligned((uint16_t *) buf)); - scanned += sizeof(uint16_t); - break; - case SDP_SEQ32: - case SDP_ALT32: - *size = ntohl(bt_get_unaligned((uint32_t *) buf)); - scanned += sizeof(uint32_t); - break; - default: - SDPERR("Unknown sequence type, aborting\n"); - return 0; - } - return scanned; -} - int sdp_send_req(sdp_session_t *session, uint8_t *buf, uint32_t size) { uint32_t sent = 0; @@ -2329,32 +2496,6 @@ int sdp_uuid_to_proto(uuid_t *uuid) return 0; } -int sdp_uuid_extract(const uint8_t *p, uuid_t *uuid, int *scanned) -{ - uint8_t type = *(const uint8_t *) p; - - if (!SDP_IS_UUID(type)) { - SDPERR("Unknown data type : %d expecting a svc UUID\n", type); - return -1; - } - p += sizeof(uint8_t); - *scanned += sizeof(uint8_t); - if (type == SDP_UUID16) { - sdp_uuid16_create(uuid, ntohs(bt_get_unaligned((uint16_t *) p))); - *scanned += sizeof(uint16_t); - p += sizeof(uint16_t); - } else if (type == SDP_UUID32) { - sdp_uuid32_create(uuid, ntohl(bt_get_unaligned((uint32_t *) p))); - *scanned += sizeof(uint32_t); - p += sizeof(uint32_t); - } else { - sdp_uuid128_create(uuid, p); - *scanned += sizeof(uint128_t); - p += sizeof(uint128_t); - } - return 0; -} - /* * This function appends data to the PDU buffer "dst" from source "src". * The data length is also computed and set. @@ -2792,7 +2933,7 @@ static int gen_dataseq_pdu(uint8_t *dst, const sdp_list_t *seq, uint8_t dtd) // Fill up the value and the dtd arrays SDPDBG(""); - + memset(&buf, 0, sizeof(sdp_buf_t)); buf.data = malloc(256); buf.buf_size = 256; @@ -2986,7 +3127,7 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, } } while (cstate); - end: +end: if (reqbuf) free(reqbuf); if (rspbuf) @@ -3146,7 +3287,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, status = -1; } - end: +end: if (reqbuf) free(reqbuf); if (rsp_concat_buf.data) -- cgit From 0e1789b3f1897512eb30d63c8e9803f1461446c1 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 22 Jun 2008 21:59:42 +0000 Subject: Add safe version of sdp_extract_pdu function --- include/sdp_lib.h | 4 +++- src/sdp.c | 30 ++++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 2323abfc..8df540c6 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -585,9 +585,11 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } -sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); sdp_data_t *sdp_extract_string(uint8_t *, int *); +sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); +sdp_record_t *sdp_extract_pdu_safe(const uint8_t *pdata, int bufsize, int *scanned); + void sdp_data_print(sdp_data_t *data); void sdp_print_service_attr(sdp_list_t *alist); diff --git a/src/sdp.c b/src/sdp.c index 977f6660..b9b0e4f6 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -1323,7 +1323,7 @@ void sdp_print_service_attr(sdp_list_t *svcAttrList) } #endif -sdp_record_t *sdp_extract_pdu(const uint8_t *buf, int *scanned) +sdp_record_t *sdp_extract_pdu_safe(const uint8_t *buf, int bufsize, int *scanned) { int extracted = 0, seqlen = 0; uint8_t dtd; @@ -1331,21 +1331,30 @@ sdp_record_t *sdp_extract_pdu(const uint8_t *buf, int *scanned) sdp_record_t *rec = sdp_record_alloc(); const uint8_t *p = buf; - *scanned = sdp_extract_seqtype(buf, &dtd, &seqlen); + *scanned = sdp_extract_seqtype_safe(buf, bufsize, &dtd, &seqlen); p += *scanned; + bufsize -= *scanned; rec->attrlist = NULL; - while (extracted < seqlen) { + + while (extracted < seqlen && bufsize > 0) { int n = sizeof(uint8_t), attrlen = 0; sdp_data_t *data = NULL; - SDPDBG("Extract PDU, sequenceLength: %d localExtractedLength: %d", seqlen, extracted); + SDPDBG("Extract PDU, sequenceLength: %d localExtractedLength: %d", + seqlen, extracted); + + if (bufsize < n + sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + break; + } + dtd = *(uint8_t *) p; attr = ntohs(bt_get_unaligned((uint16_t *) (p + n))); n += sizeof(uint16_t); SDPDBG("DTD of attrId : %d Attr id : 0x%x \n", dtd, attr); - data = sdp_extract_attr(p + n, &attrlen, rec); + data = sdp_extract_attr_safe(p + n, bufsize - n, &attrlen, rec); SDPDBG("Attr id : 0x%x attrValueLength : %d\n", attr, attrlen); @@ -1363,9 +1372,11 @@ sdp_record_t *sdp_extract_pdu(const uint8_t *buf, int *scanned) extracted += n; p += n; + bufsize -= n; sdp_attr_replace(rec, attr, data); + SDPDBG("Extract PDU, seqLength: %d localExtractedLength: %d", - seqlen, extracted); + seqlen, extracted); } #ifdef SDP_DEBUG SDPDBG("Successful extracting of Svc Rec attributes\n"); @@ -1375,6 +1386,13 @@ sdp_record_t *sdp_extract_pdu(const uint8_t *buf, int *scanned) return rec; } +sdp_record_t *sdp_extract_pdu(const uint8_t *buf, int *scanned) +{ + /* Assume buf points to a buffer of size at least SDP_MAX_ATTR_LEN, + because we don't have any better information */ + return sdp_extract_pdu_safe(buf, SDP_MAX_ATTR_LEN, scanned); +} + #ifdef SDP_DEBUG static void print_dataseq(sdp_data_t *p) { -- cgit From 66e753bae1b6dd26ba78efdf345f45c362bb2463 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 22 Jun 2008 22:02:27 +0000 Subject: Remove sdp_extract_string prototype --- include/sdp_lib.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/sdp_lib.h b/include/sdp_lib.h index 8df540c6..143056f6 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -585,8 +585,6 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } -sdp_data_t *sdp_extract_string(uint8_t *, int *); - sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); sdp_record_t *sdp_extract_pdu_safe(const uint8_t *pdata, int bufsize, int *scanned); -- cgit From 0a8f7c9206e17ab118966bf7da8a053ef34dce84 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 23 Jun 2008 02:49:12 +0000 Subject: Add safety check for continuation state function --- src/sdp.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index b9b0e4f6..59686388 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3002,12 +3002,17 @@ typedef struct { unsigned char data[16]; } __attribute__ ((packed)) sdp_cstate_t; -static int copy_cstate(uint8_t *pdata, const sdp_cstate_t *cstate) +static int copy_cstate(uint8_t *pdata, int pdata_len, const sdp_cstate_t *cstate) { if (cstate) { - *pdata++ = cstate->length; - memcpy(pdata, cstate->data, cstate->length); - return cstate->length + 1; + uint8_t len = cstate->length; + if (len >= pdata_len) { + SDPERR("Continuation state size exceeds internal buffer"); + len = pdata_len - 1; + } + *pdata++ = len; + memcpy(pdata, cstate->data, len); + return len + 1; } *pdata = 0; return 1; @@ -3087,7 +3092,8 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, do { // Add continuation state or NULL (first time) - reqsize = _reqsize + copy_cstate(_pdata, cstate); + reqsize = _reqsize + copy_cstate(_pdata, + SDP_REQ_BUFFER_SIZE - _reqsize, cstate); // Set the request header's param length reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); @@ -3249,7 +3255,8 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, do { // add NULL continuation state - reqsize = _reqsize + copy_cstate(_pdata, cstate); + reqsize = _reqsize + copy_cstate(_pdata, + SDP_REQ_BUFFER_SIZE - _reqsize, cstate); // set the request header's param length reqhdr->tid = htons(sdp_gen_tid(session)); @@ -3470,7 +3477,7 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u pdata += sizeof(uint16_t); // set the request header's param length - cstate_len = copy_cstate(pdata, NULL); + cstate_len = copy_cstate(pdata, SDP_REQ_BUFFER_SIZE - t->reqsize, NULL); reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t)); if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { @@ -3584,7 +3591,7 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_ SDPDBG("Attr list length : %d\n", seqlen); // set the request header's param length - cstate_len = copy_cstate(pdata, NULL); + cstate_len = copy_cstate(pdata, SDP_REQ_BUFFER_SIZE - t->reqsize, NULL); reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t)); if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { @@ -3703,7 +3710,7 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear t->reqsize += seqlen; // set the request header's param length - cstate_len = copy_cstate(pdata, NULL); + cstate_len = copy_cstate(pdata, SDP_REQ_BUFFER_SIZE - t->reqsize, NULL); reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t)); if (sdp_send_req(session, t->reqbuf, t->reqsize + cstate_len) < 0) { @@ -3916,7 +3923,8 @@ int sdp_process(sdp_session_t *session) reqhdr->tid = htons(sdp_gen_tid(session)); // add continuation state - cstate_len = copy_cstate(t->reqbuf + t->reqsize, pcstate); + cstate_len = copy_cstate(t->reqbuf + t->reqsize, + SDP_REQ_BUFFER_SIZE - t->reqsize, pcstate); reqsize = t->reqsize + cstate_len; @@ -4059,7 +4067,8 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search reqhdr->tid = htons(sdp_gen_tid(session)); // add continuation state (can be null) - reqsize = _reqsize + copy_cstate(_pdata, cstate); + reqsize = _reqsize + copy_cstate(_pdata, + SDP_REQ_BUFFER_SIZE - _reqsize, cstate); // set the request header's param length reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); -- cgit From 121c632f01e3f49a69a9d637e0da4d25c2ee090d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 23 Jun 2008 06:18:33 +0000 Subject: Have the service routines use the new safe functions --- src/sdp.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 86 insertions(+), 12 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index 59686388..4217aedd 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2923,18 +2923,23 @@ void sdp_pattern_add_uuidseq(sdp_record_t *rec, sdp_list_t *seq) * handles are not in "data element sequence" form, but just like * an array of service handles */ -static void extract_record_handle_seq(uint8_t *pdu, sdp_list_t **seq, int count, int *scanned) +static void extract_record_handle_seq(uint8_t *pdu, int bufsize, sdp_list_t **seq, int count, int *scanned) { sdp_list_t *pSeq = *seq; uint8_t *pdata = pdu; int n; for (n = 0; n < count; n++) { + if (bufsize < sizeof(uint32_t)) { + SDPERR("Unexpected end of packet"); + break; + } uint32_t *pSvcRec = malloc(sizeof(uint32_t)); *pSvcRec = ntohl(bt_get_unaligned((uint32_t *) pdata)); pSeq = sdp_list_append(pSeq, pSvcRec); pdata += sizeof(uint32_t); *scanned += sizeof(uint32_t); + bufsize -= sizeof(uint32_t); } *seq = pSeq; } @@ -3054,7 +3059,7 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, uint32_t reqsize = 0, _reqsize; uint32_t rspsize = 0, rsplen; int seqlen = 0; - int scanned, total_rec_count, rec_count; + int scanned, total_rec_count, rec_count, pdata_len; uint8_t *pdata, *_pdata; uint8_t *reqbuf, *rspbuf; sdp_pdu_hdr_t *reqhdr, *rsphdr; @@ -3107,7 +3112,12 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, if (status < 0) goto end; - rsplen = 0; + if (rspsize < sizeof(sdp_pdu_hdr_t)) { + SDPERR("Unexpected end of packet"); + status = -1; + goto end; + } + rsphdr = (sdp_pdu_hdr_t *) rspbuf; rsplen = ntohs(rsphdr->plen); @@ -3118,14 +3128,23 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, } scanned = 0; pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + pdata_len = rspsize - sizeof(sdp_pdu_hdr_t); + + if (pdata_len < sizeof(uint16_t) + sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + status = -1; + goto end; + } // net service record match count total_rec_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); pdata += sizeof(uint16_t); scanned += sizeof(uint16_t); + pdata_len -= sizeof(uint16_t); rec_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); pdata += sizeof(uint16_t); scanned += sizeof(uint16_t); + pdata_len -= sizeof(uint16_t); SDPDBG("Total svc count: %d\n", total_rec_count); SDPDBG("Current svc count: %d\n", rec_count); @@ -3135,12 +3154,18 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search, status = -1; goto end; } - extract_record_handle_seq(pdata, rsp, rec_count, &scanned); + extract_record_handle_seq(pdata, pdata_len, rsp, rec_count, &scanned); SDPDBG("BytesScanned : %d\n", scanned); if (rsplen > scanned) { uint8_t cstate_len; + if (rspsize < sizeof(sdp_pdu_hdr_t) + scanned + sizeof(uint8_t)) { + SDPERR("Unexpected end of packet: continuation state data missing"); + status = -1; + goto end; + } + pdata = rspbuf + sizeof(sdp_pdu_hdr_t) + scanned; cstate_len = *(uint8_t *) pdata; if (cstate_len > 0) { @@ -3199,7 +3224,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, uint32_t reqsize = 0, _reqsize; uint32_t rspsize = 0, rsp_count; int attr_list_len = 0; - int seqlen = 0; + int seqlen = 0, pdata_len; uint8_t *pdata, *_pdata; uint8_t *reqbuf, *rspbuf; sdp_pdu_hdr_t *reqhdr, *rsphdr; @@ -3265,6 +3290,13 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); if (status < 0) goto end; + + if (rspsize < sizeof(sdp_pdu_hdr_t)) { + SDPERR("Unexpected end of packet"); + status = -1; + goto end; + } + rsp_count = 0; rsphdr = (sdp_pdu_hdr_t *) rspbuf; if (rsphdr->pdu_id == SDP_ERROR_RSP) { @@ -3273,11 +3305,25 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, goto end; } pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + pdata_len = rspsize - sizeof(sdp_pdu_hdr_t); + + if (pdata_len < sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + status = -1; + goto end; + } + rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); attr_list_len += rsp_count; pdata += sizeof(uint16_t); + pdata_len -= sizeof(uint16_t); // if continuation state set need to re-issue request before parsing + if (pdata_len < rsp_count + sizeof(uint8_t)) { + SDPERR("Unexpected end of packet: continuation state data missing"); + status = -1; + goto end; + } cstate_len = *(uint8_t *) (pdata + rsp_count); SDPDBG("Response id : %d\n", rsphdr->pdu_id); @@ -3304,9 +3350,11 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle, if (attr_list_len > 0) { int scanned = 0; - if (rsp_concat_buf.data_size != 0) + if (rsp_concat_buf.data_size != 0) { pdata = rsp_concat_buf.data; - rec = sdp_extract_pdu(pdata, &scanned); + pdata_len = rsp_concat_buf.data_size; + } + rec = sdp_extract_pdu_safe(pdata, pdata_len, &scanned); if (!rec) status = -1; @@ -4003,7 +4051,7 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search uint32_t reqsize = 0, _reqsize; uint32_t rspsize = 0; int seqlen = 0, attr_list_len = 0; - int rsp_count = 0, cstate_len = 0; + int rsp_count = 0, cstate_len = 0, pdata_len; uint8_t *pdata, *_pdata; uint8_t *reqbuf, *rspbuf; sdp_pdu_hdr_t *reqhdr, *rsphdr; @@ -4074,6 +4122,12 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t)); rsphdr = (sdp_pdu_hdr_t *) rspbuf; status = sdp_send_req_w4_rsp(session, reqbuf, rspbuf, reqsize, &rspsize); + if (rspsize < sizeof(sdp_pdu_hdr_t)) { + SDPERR("Unexpected end of packet"); + status = -1; + goto end; + } + if (status < 0) { SDPDBG("Status : 0x%x\n", rsphdr->pdu_id); goto end; @@ -4085,9 +4139,25 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search } pdata = rspbuf + sizeof(sdp_pdu_hdr_t); + pdata_len = rspsize - sizeof(sdp_pdu_hdr_t); + + if (pdata_len < sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + status = -1; + goto end; + } + rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata)); attr_list_len += rsp_count; pdata += sizeof(uint16_t); // pdata points to attribute list + pdata_len -= sizeof(uint16_t); + + if (pdata_len < rsp_count + sizeof(uint8_t)) { + SDPERR("Unexpected end of packet: continuation state data missing"); + status = -1; + goto end; + } + cstate_len = *(uint8_t *) (pdata + rsp_count); SDPDBG("Attrlist byte count : %d\n", attr_list_len); @@ -4114,24 +4184,27 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search if (attr_list_len > 0) { int scanned = 0; - if (rsp_concat_buf.data_size != 0) + if (rsp_concat_buf.data_size != 0) { pdata = rsp_concat_buf.data; + pdata_len = rsp_concat_buf.data_size; + } /* * Response is a sequence of sequence(s) for one or * more data element sequence(s) representing services * for which attributes are returned */ - scanned = sdp_extract_seqtype(pdata, &dataType, &seqlen); + scanned = sdp_extract_seqtype_safe(pdata, pdata_len, &dataType, &seqlen); SDPDBG("Bytes scanned : %d\n", scanned); SDPDBG("Seq length : %d\n", seqlen); if (scanned && seqlen) { pdata += scanned; + pdata_len -= scanned; do { int recsize = 0; - sdp_record_t *rec = sdp_extract_pdu(pdata, &recsize); + sdp_record_t *rec = sdp_extract_pdu_safe(pdata, pdata_len, &recsize); if (rec == NULL) { SDPERR("SVC REC is null\n"); status = -1; @@ -4143,13 +4216,14 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search } scanned += recsize; pdata += recsize; + pdata_len -= recsize; SDPDBG("Loc seq length : %d\n", recsize); SDPDBG("Svc Rec Handle : 0x%x\n", rec->handle); SDPDBG("Bytes scanned : %d\n", scanned); SDPDBG("Attrlist byte count : %d\n", attr_list_len); rec_list = sdp_list_append(rec_list, rec); - } while (scanned < attr_list_len); + } while (scanned < attr_list_len && pdata_len > 0); SDPDBG("Successful scan of service attr lists\n"); *rsp = rec_list; -- cgit From ca0d3dc0bb5a573b44496847919cc02c9da2016f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 23 Jun 2008 07:29:13 +0000 Subject: More validation of incoming packet lengths --- src/sdp.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/sdp.c b/src/sdp.c index 4217aedd..f8953c42 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -2643,6 +2643,13 @@ int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, if (status < 0) goto end; + if (rspsize < sizeof(sdp_pdu_hdr_t)) { + SDPERR("Unexpected end of packet"); + errno = EPROTO; + status = -1; + goto end; + } + rsphdr = (sdp_pdu_hdr_t *) rsp; p = rsp + sizeof(sdp_pdu_hdr_t); @@ -2654,6 +2661,12 @@ int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device, errno = EPROTO; status = -1; } else { + if (rspsize < sizeof(sdp_pdu_hdr_t) + sizeof(uint32_t)) { + SDPERR("Unexpected end of packet"); + errno = EPROTO; + status = -1; + goto end; + } if (handle) *handle = ntohl(bt_get_unaligned((uint32_t *) p)); } @@ -2749,6 +2762,13 @@ int sdp_device_record_unregister_binary(sdp_session_t *session, bdaddr_t *device if (status < 0) goto end; + if (rspsize < sizeof(sdp_pdu_hdr_t) + sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + errno = EPROTO; + status = -1; + goto end; + } + rsphdr = (sdp_pdu_hdr_t *) rspbuf; p = rspbuf + sizeof(sdp_pdu_hdr_t); status = bt_get_unaligned((uint16_t *) p); @@ -2848,6 +2868,13 @@ int sdp_device_record_update(sdp_session_t *session, bdaddr_t *device, const sdp if (status < 0) goto end; + if (rspsize < sizeof(sdp_pdu_hdr_t) + sizeof(uint16_t)) { + SDPERR("Unexpected end of packet"); + errno = EPROTO; + status = -1; + goto end; + } + SDPDBG("Send req status : %d\n", status); rsphdr = (sdp_pdu_hdr_t *) rspbuf; -- cgit From c7a088963f4c5f767fc08f7e123f4389b0182c53 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 24 Jun 2008 00:33:44 +0000 Subject: Update changelog and bump version number --- ChangeLog | 4 ++++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43b4aa95..c3a98c70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +ver 3.34: + Replace various SDP functions with safe versions. + Add additional length validation for incoming SDP packets. + ver 3.33: Add functions for reading and writing the link policy settings. Add definition for authentication requirements. diff --git a/configure.in b/configure.in index 3b77c1e0..0d52b7cf 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.33) +AM_INIT_AUTOMAKE(bluez-libs, 3.34) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index a03816e7..e458ff06 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 12:0:10 +libbluetooth_la_LDFLAGS = -version-info 13:0:11 INCLUDES = -I$(top_builddir)/include -- cgit From 522cd764e3d3666b773f016609026bf8287979f6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 1 Jul 2008 03:00:53 +0000 Subject: Add two additional company identifiers --- src/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bluetooth.c b/src/bluetooth.c index 463e0e05..f7a46bcf 100644 --- a/src/bluetooth.c +++ b/src/bluetooth.c @@ -436,6 +436,10 @@ char *bt_compidtostr(int compid) return "Apple, Inc."; case 77: return "Staccato Communications, Inc."; + case 78: + return "Avago Technologies"; + case 79: + return "APT Ltd."; case 65535: return "internal use"; default: -- cgit From cd8c7ab8f70bd0f0c1c69bd9454be0ad25809533 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 1 Jul 2008 03:04:06 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3a98c70..94444881 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.35: + Add two additional company identifiers. + ver 3.34: Replace various SDP functions with safe versions. Add additional length validation for incoming SDP packets. diff --git a/configure.in b/configure.in index 0d52b7cf..3d1b8693 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.34) +AM_INIT_AUTOMAKE(bluez-libs, 3.35) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index e458ff06..975c603c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 13:0:11 +libbluetooth_la_LDFLAGS = -version-info 13:1:11 INCLUDES = -I$(top_builddir)/include -- cgit From dbd0371b179c7fc4a6dae79ad66d149eff7687c9 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Jul 2008 01:42:07 +0000 Subject: Avoid the include of --- include/bnep.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/bnep.h b/include/bnep.h index 75eaac05..92c66c14 100644 --- a/include/bnep.h +++ b/include/bnep.h @@ -29,9 +29,12 @@ extern "C" { #endif -#include #include +#ifndef ETH_ALEN +#define ETH_ALEN 6 /* from */ +#endif + /* BNEP UUIDs */ #define BNEP_BASE_UUID 0x0000000000001000800000805F9B34FB #define BNEP_UUID16 0x02 -- cgit From 3a585b6fe13ff35b6c1ecf12295b2db75e9221c2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Jul 2008 01:42:26 +0000 Subject: Define MIN if not available --- src/hci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hci.c b/src/hci.c index e2c355c0..a72b0355 100644 --- a/src/hci.c +++ b/src/hci.c @@ -45,6 +45,10 @@ #include #include +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + typedef struct { char *str; unsigned int val; -- cgit From bd32ca373cd507d9c9746bde40b0e7bb4034adbe Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Jul 2008 01:43:09 +0000 Subject: Fix spelling --- src/sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdp.c b/src/sdp.c index f8953c42..e365370c 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -164,7 +164,7 @@ static struct tupla ServiceClass[] = { { IMAGING_ARCHIVE_SVCLASS_ID, "Imaging Automatic Archive" }, { IMAGING_REFOBJS_SVCLASS_ID, "Imaging Referenced Objects" }, { HANDSFREE_SVCLASS_ID, "Handsfree" }, - { HANDSFREE_AGW_SVCLASS_ID, "Handfree Audio Gateway" }, + { HANDSFREE_AGW_SVCLASS_ID, "Handsfree Audio Gateway" }, { DIRECT_PRT_REFOBJS_SVCLASS_ID, "Direct Printing Ref. Objects" }, { REFLECTED_UI_SVCLASS_ID, "Reflected UI" }, { BASIC_PRINTING_SVCLASS_ID, "Basic Printing" }, -- cgit From 924fa35c97929ff95590a1f33cc2bd8cca7cf1f2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 10 Jul 2008 01:44:16 +0000 Subject: Change order of includes --- src/sdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sdp.c b/src/sdp.c index e365370c..3149c0f1 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -36,10 +36,10 @@ #include #include #include -#include -#include #include #include +#include +#include #include #include -- cgit From 9b58ef755fe8dabbd82a9a9f88e172b7b9d9222a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 11 Jul 2008 10:11:38 +0000 Subject: Update changelog and bump version number --- ChangeLog | 3 +++ configure.in | 2 +- src/Makefile.am | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94444881..2ef82dcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +ver 3.36: + Fix various includes for cross-compilation. + ver 3.35: Add two additional company identifiers. diff --git a/configure.in b/configure.in index 3d1b8693..1eeb7755 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ AC_PREREQ(2.50) AC_INIT() -AM_INIT_AUTOMAKE(bluez-libs, 3.35) +AM_INIT_AUTOMAKE(bluez-libs, 3.36) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/src/Makefile.am b/src/Makefile.am index 975c603c..065bbe60 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libbluetooth.la libbluetooth_la_SOURCES = bluetooth.c hci.c sdp.c -libbluetooth_la_LDFLAGS = -version-info 13:1:11 +libbluetooth_la_LDFLAGS = -version-info 13:2:11 INCLUDES = -I$(top_builddir)/include -- cgit